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

Commit f2e02b8a authored by Kweku Adams's avatar Kweku Adams
Browse files

Adjust queue for test jobs.

Test jobs should always be pulled first, so optimizing the iteration for
batching won't work with tests. Skip the optimization when dealing with
test jobs.

Bug: 226554375
Test: atest FrameworksServicesTests:PendingJobQueueTest
Change-Id: Icd55cb7f2f6efe00c87272f851661a964fb7c4d0
parent 4f027ec4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -182,8 +182,10 @@ class PendingJobQueue {
        if (earliestQueue != null) {
            final JobStatus job = earliestQueue.next();
            // Change the front of the queue if we've pulled pullLimit jobs from the current head
            // or we're dealing with test jobs
            // or the current head has no more jobs to provide.
            if (++mPullCount >= pullLimit
                    || (job != null && earliestQueue.peekNextOverrideState() != job.overrideState)
                    || earliestQueue.peekNextTimestamp() == AppJobQueue.NO_NEXT_TIMESTAMP) {
                mOrderedQueues.poll();
                if (earliestQueue.peekNextTimestamp() != AppJobQueue.NO_NEXT_TIMESTAMP) {