Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Copyright (C) 2010-2016 eBusiness Information, Excilys Group
* Copyright (C) 2016-2017 the AndroidAnnotations project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
Expand Down Expand Up @@ -27,6 +28,7 @@
import java.util.concurrent.atomic.AtomicBoolean;

import android.os.Looper;
import android.os.SystemClock;
import android.util.Log;

public final class BackgroundExecutor {
Expand Down Expand Up @@ -384,7 +386,7 @@ public Task(String id, long delay, String serial) {
}
if (delay > 0) {
remainingDelay = delay;
targetTimeMillis = System.currentTimeMillis() + delay;
targetTimeMillis = SystemClock.elapsedRealtime() + delay;
}
if (!"".equals(serial)) {
this.serial = serial;
Expand Down Expand Up @@ -424,7 +426,7 @@ private void postExecute() {
if (next != null) {
if (next.remainingDelay != 0) {
/* the delay may not have elapsed yet */
next.remainingDelay = Math.max(0L, next.targetTimeMillis - System.currentTimeMillis());
next.remainingDelay = Math.max(0L, next.targetTimeMillis - SystemClock.elapsedRealtime());
}
/* a task having the same serial was queued, execute it */
BackgroundExecutor.execute(next);
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.