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

Commit f079f441 authored by Kweku Adams's avatar Kweku Adams Committed by Presubmit Automerger Backend
Browse files

[automerge] Stop tracking ghost jobs. 2p: c554e927

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17664330

Bug: 228334264
Change-Id: Ia4e01d83b8d35b351a0f8e6f7976ed92022a3843
parents e59878a9 c554e927
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1745,7 +1745,13 @@ public class JobSchedulerService extends com.android.server.SystemService

        // Remove from store as well as controllers.
        final boolean removed = mJobs.remove(jobStatus, removeFromPersisted);
        if (removed && mReadyToRock) {
        if (!removed) {
            // We never create JobStatus objects for the express purpose of removing them, and this
            // method is only ever called for jobs that were saved in the JobStore at some point,
            // so if we can't find it, something went seriously wrong.
            Slog.wtfStack(TAG, "Job didn't exist in JobStore");
        }
        if (mReadyToRock) {
            for (int i = 0; i < mControllers.size(); i++) {
                StateController controller = mControllers.get(i);
                controller.maybeStopTrackingJobLocked(jobStatus, incomingJob, false);
+4 −0
Original line number Diff line number Diff line
@@ -992,6 +992,10 @@ public final class JobServiceContext implements ServiceConnection {
        if (mVerb == VERB_FINISHED) {
            return;
        }
        if (DEBUG) {
            Slog.d(TAG, "Cleaning up " + mRunningJob.toShortString()
                    + " reschedule=" + reschedule + " reason=" + reason);
        }
        applyStoppedReasonLocked(reason);
        completedJob = mRunningJob;
        final int internalStopReason = mParams.getInternalStopReasonCode();