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

Commit 98bfc275 authored by Chris Tate's avatar Chris Tate Committed by Android (Google) Code Review
Browse files

Merge "Fix job enqueue bug when changing constraints"

parents b8d0e762 b0da63c2
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -1025,17 +1025,18 @@ public class JobSchedulerService extends com.android.server.SystemService
            // This may throw a SecurityException.
            jobStatus.prepareLocked();

            if (work != null) {
                // If work has been supplied, enqueue it into the new job.
                jobStatus.enqueueWorkLocked(work);
            }

            if (toCancel != null) {
                // Implicitly replaces the existing job record with the new instance
                cancelJobImplLocked(toCancel, jobStatus, "job rescheduled by app");
            } else {
                startTrackingJobLocked(jobStatus, null);
            }

            if (work != null) {
                // If work has been supplied, enqueue it into the new job.
                jobStatus.enqueueWorkLocked(work);
            }

            StatsLog.write_non_chained(StatsLog.SCHEDULED_JOB_STATE_CHANGED,
                    uId, null, jobStatus.getBatteryName(),
                    StatsLog.SCHEDULED_JOB_STATE_CHANGED__STATE__SCHEDULED,