Skip to content
Snippets Groups Projects
Commit c59af8ef authored by Xin Guan's avatar Xin Guan Committed by Gerrit Code Review
Browse files

Merge "JobSchedulerService:fix arrayIndexOutOfBoundsException to aviod...

Merge "JobSchedulerService:fix arrayIndexOutOfBoundsException to aviod systemServer crash." into main
parents d5dd7d8b a8e15e02
No related branches found
No related tags found
No related merge requests found
......@@ -48,6 +48,7 @@ public final class IdleController extends RestrictingController implements Idlen
private static final String TAG = "JobScheduler.IdleController";
// Policy: we decide that we're "idle" if the device has been unused /
// screen off or dreaming or wireless charging dock idle for at least this long
@GuardedBy("mLock")
final ArraySet<JobStatus> mTrackedTasks = new ArraySet<>();
IdlenessTracker mIdleTracker;
private final FlexibilityController mFlexibilityController;
......@@ -118,8 +119,10 @@ public final class IdleController extends RestrictingController implements Idlen
for (int i = mTrackedTasks.size()-1; i >= 0; i--) {
mTrackedTasks.valueAt(i).setIdleConstraintSatisfied(nowElapsed, isIdle);
}
if (!mTrackedTasks.isEmpty()) {
mStateChangedListener.onControllerStateChanged(mTrackedTasks);
}
}
mStateChangedListener.onControllerStateChanged(mTrackedTasks);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment