Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 63fd529b authored by Christopher Tate's avatar Christopher Tate
Browse files

Don't automatically decline tracking jobs with met initial delays

Just an already-satisfied initial delay doesn't let us decline to
track the (new) job: it might not actually be runnable yet, and
if it has a deadline as well, we definitely need to track it.

If it has no deadline, though, then a met initial delay means
that the TimeController can indeed safely just mark the delay
constraint as met and stop tracking it.

Change-Id: I20919fa384c1fcb1c619efb8f05b8ba856ed44b3
Fixes: 77233219
Test: atest CtsJobSchedulerTestCases:TimingConstraintsTest
parent d2b1d6d7
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -90,8 +90,11 @@ public final class TimeController extends StateController {
                return;
            } else if (job.hasTimingDelayConstraint() && evaluateTimingDelayConstraint(job,
                    nowElapsedMillis)) {
                if (!job.hasDeadlineConstraint()) {
                    // If it doesn't have a deadline, we'll never have to touch it again.
                    return;
                }
            }

            boolean isInsert = false;
            ListIterator<JobStatus> it = mTrackedJobs.listIterator(mTrackedJobs.size());