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

Commit 2383d08b authored by Jeff Sharkey's avatar Jeff Sharkey Committed by android-build-merger
Browse files

Merge "Skip cancelling jobs with FLAG_WILL_BE_FOREGROUND." into nyc-dev am: 9bdf289f

am: cc80f0a9

* commit 'cc80f0a9':
  Skip cancelling jobs with FLAG_WILL_BE_FOREGROUND.

Change-Id: I66e3af5f084adf6c03a972c37e8c870be2265092
parents 5ec2c4ae cc80f0a9
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -662,11 +662,13 @@ public final class JobSchedulerService extends com.android.server.SystemService
    public void onDeviceIdleStateChanged(boolean deviceIdle) {
        synchronized (mLock) {
            if (deviceIdle) {
                // When becoming idle, make sure no jobs are actively running.
                // When becoming idle, make sure no jobs are actively running,
                // except those using the idle exemption flag.
                for (int i=0; i<mActiveServices.size(); i++) {
                    JobServiceContext jsc = mActiveServices.get(i);
                    final JobStatus executing = jsc.getRunningJob();
                    if (executing != null) {
                    if (executing != null
                            && (executing.getFlags() & JobInfo.FLAG_WILL_BE_FOREGROUND) == 0) {
                        jsc.cancelExecutingJob(JobParameters.REASON_DEVICE_IDLE);
                    }
                }