summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJunichi Monma <monma@google.com>2015-03-26 22:54:21 +0900
committerJunichi Monma <monma@google.com>2015-03-26 22:54:21 +0900
commitce8a9f53b2a92d6f7c2cab6069a7390cf535e1d8 (patch)
treef7478f33fd24305b9a9e3d509e51484500856395 /services
parent0afd1905b59446fc471680325bcbea802bb37c5c (diff)
downloadframeworks_base-ce8a9f53b2a92d6f7c2cab6069a7390cf535e1d8.zip
frameworks_base-ce8a9f53b2a92d6f7c2cab6069a7390cf535e1d8.tar.gz
frameworks_base-ce8a9f53b2a92d6f7c2cab6069a7390cf535e1d8.tar.bz2
Fixing to fail android.JobScheduler.TimingConstraintsTest#testSchedulePeriodic in TV test.
bug id : b/19938983 Change-Id: I7568bb9c41b90a57f2e3b89d3fa694ef692f05ac
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/job/controllers/TimeController.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/job/controllers/TimeController.java b/services/core/java/com/android/server/job/controllers/TimeController.java
index 4c6cb17..b3d7287 100644
--- a/services/core/java/com/android/server/job/controllers/TimeController.java
+++ b/services/core/java/com/android/server/job/controllers/TimeController.java
@@ -91,14 +91,20 @@ public class TimeController extends StateController {
public synchronized void maybeStartTrackingJob(JobStatus job) {
if (job.hasTimingDelayConstraint() || job.hasDeadlineConstraint()) {
maybeStopTrackingJob(job);
+ boolean isInsert = false;
ListIterator<JobStatus> it = mTrackedJobs.listIterator(mTrackedJobs.size());
while (it.hasPrevious()) {
JobStatus ts = it.previous();
if (ts.getLatestRunTimeElapsed() < job.getLatestRunTimeElapsed()) {
// Insert
+ isInsert = true;
break;
}
}
+ if(isInsert)
+ {
+ it.next();
+ }
it.add(job);
maybeUpdateAlarms(
job.hasTimingDelayConstraint() ? job.getEarliestRunTime() : Long.MAX_VALUE,