diff options
author | Matthew Williams <mjwilliams@google.com> | 2015-04-06 20:43:30 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-04-06 20:43:30 +0000 |
commit | 0b3673c4d39c07779081ef2eaf8705cbad1ee04c (patch) | |
tree | de28f3fe641830a1bc94cd1bd2861c6c98290cda /services | |
parent | bad1356b2d2a229c57160af77aab78be5d3adb49 (diff) | |
parent | 20baa9d944ccb504d0fdf7ce2e553bca9ca2f672 (diff) | |
download | frameworks_base-0b3673c4d39c07779081ef2eaf8705cbad1ee04c.zip frameworks_base-0b3673c4d39c07779081ef2eaf8705cbad1ee04c.tar.gz frameworks_base-0b3673c4d39c07779081ef2eaf8705cbad1ee04c.tar.bz2 |
am 20baa9d9: am 28358eae: Merge "Fixing to fail android.JobScheduler.TimingConstraintsTest#testSchedulePeriodic in TV test." into lmp-mr1-dev
* commit '20baa9d944ccb504d0fdf7ce2e553bca9ca2f672':
Fixing to fail android.JobScheduler.TimingConstraintsTest#testSchedulePeriodic in TV test.
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, |