Avoid unnecessary work.

If the pending queue is empty, then we don't need to do all the work of
determining job assignments.

Bug: 141645789
Test: Android builds
Change-Id: I3dfad0ea128580ba7e924b332464b807eb2c403f
This commit is contained in:
Kweku Adams
2022-03-29 16:08:45 +00:00
parent c374013da0
commit c9a5e428b3

View File

@@ -606,6 +606,11 @@ class JobConcurrencyManager {
Slog.d(TAG, printPendingQueueLocked());
}
if (mService.getPendingJobQueue().size() == 0) {
// Nothing to do.
return;
}
final PendingJobQueue pendingJobQueue = mService.getPendingJobQueue();
final List<JobServiceContext> activeServices = mActiveServices;