Merge "Reevaluate constraints on run command." into rvc-dev am: c3e1b7ddff

Change-Id: I6bf3f1c59f79f222b12ace8b9dcb4eed68940cb9
This commit is contained in:
Automerger Merge Worker
2020-03-03 23:22:24 +00:00

View File

@@ -2833,6 +2833,13 @@ public class JobSchedulerService extends com.android.server.SystemService
} }
js.overrideState = (force) ? JobStatus.OVERRIDE_FULL : JobStatus.OVERRIDE_SOFT; js.overrideState = (force) ? JobStatus.OVERRIDE_FULL : JobStatus.OVERRIDE_SOFT;
// Re-evaluate constraints after the override is set in case one of the overridden
// constraints was preventing another constraint from thinking it needed to update.
for (int c = mControllers.size() - 1; c >= 0; --c) {
mControllers.get(c).reevaluateStateLocked(uid);
}
if (!js.isConstraintsSatisfied()) { if (!js.isConstraintsSatisfied()) {
js.overrideState = 0; js.overrideState = 0;
return JobSchedulerShellCommand.CMD_ERR_CONSTRAINTS; return JobSchedulerShellCommand.CMD_ERR_CONSTRAINTS;