Merge "Adjust queue for test jobs." into tm-dev

This commit is contained in:
Kweku Adams
2022-03-24 21:13:04 +00:00
committed by Android (Google) Code Review

View File

@@ -182,8 +182,10 @@ class PendingJobQueue {
if (earliestQueue != null) { if (earliestQueue != null) {
final JobStatus job = earliestQueue.next(); final JobStatus job = earliestQueue.next();
// Change the front of the queue if we've pulled pullLimit jobs from the current head // 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. // or the current head has no more jobs to provide.
if (++mPullCount >= pullLimit if (++mPullCount >= pullLimit
|| (job != null && earliestQueue.peekNextOverrideState() != job.overrideState)
|| earliestQueue.peekNextTimestamp() == AppJobQueue.NO_NEXT_TIMESTAMP) { || earliestQueue.peekNextTimestamp() == AppJobQueue.NO_NEXT_TIMESTAMP) {
mOrderedQueues.poll(); mOrderedQueues.poll();
if (earliestQueue.peekNextTimestamp() != AppJobQueue.NO_NEXT_TIMESTAMP) { if (earliestQueue.peekNextTimestamp() != AppJobQueue.NO_NEXT_TIMESTAMP) {