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

Commit 867992c8 authored by Kweku Adams's avatar Kweku Adams
Browse files

Improve logic for RESTRICTED stop reason.

Now that we have explicit stop reasons, we can improve how we determine
whether the internal stop reason is due to the restricted bucket or due
to other constraints.

Bug: 141645789
Test: atest CtsJobSchedulerTestCases
Change-Id: I82a9641762544ab04bf897c6386d6b18eb607406
parent 7efcc4df
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -2110,11 +2110,8 @@ public class JobSchedulerService extends com.android.server.SystemService
                continue;
            }
            if (!running.isReady()) {
                // If a restricted job doesn't have dynamic constraints satisfied, assume that's
                // the reason the job is being stopped, instead of because of other constraints
                // not being satisfied.
                if (running.getEffectiveStandbyBucket() == RESTRICTED_INDEX
                        && !running.areDynamicConstraintsSatisfied()) {
                        && running.getStopReason() == JobParameters.STOP_REASON_APP_STANDBY) {
                    serviceContext.cancelExecutingJobLocked(
                            running.getStopReason(),
                            JobParameters.INTERNAL_STOP_REASON_RESTRICTED_BUCKET,