diff options
author | Junichi Monma <monma@google.com> | 2015-03-26 22:54:21 +0900 |
---|---|---|
committer | Junichi Monma <monma@google.com> | 2015-03-26 22:54:21 +0900 |
commit | ce8a9f53b2a92d6f7c2cab6069a7390cf535e1d8 (patch) | |
tree | f7478f33fd24305b9a9e3d509e51484500856395 /services | |
parent | 0afd1905b59446fc471680325bcbea802bb37c5c (diff) | |
download | frameworks_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.java | 6 |
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, |