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

Commit a3091670 authored by Kweku Adams's avatar Kweku Adams
Browse files

Avoid unnecessary work.

Only requested-expedited-jobs could have their run-in-bg constraint
change (because of EJ quota) without a corresponding call coming through
the ForceAppStandbyListener. Restrict job evaluation to requested-EJ
jobs to avoid making unnecessary/redundant calls for regular jobs.

Bug: 192105110
Test: atest frameworks/base/services/tests/mockingservicestests/src/com/android/server/job
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/job
Test: atest CtsJobSchedulerTestCases
Change-Id: I9acc45e109c32fb77c79df4fe126a9b1845163ff
parent dc9a03db
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -82,8 +82,12 @@ public final class BackgroundJobsController extends StateController {

    @Override
    public void evaluateStateLocked(JobStatus jobStatus) {
        if (jobStatus.isRequestedExpeditedJob()) {
            // Only requested-EJs could have their run-in-bg constraint change outside of something
            // coming through the ForceAppStandbyListener.
            updateSingleJobRestrictionLocked(jobStatus, sElapsedRealtimeClock.millis(), UNKNOWN);
        }
    }

    @Override
    public void dumpControllerStateLocked(final IndentingPrintWriter pw,