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

Commit a3e51f34 authored by Xin Guan's avatar Xin Guan Committed by Android (Google) Code Review
Browse files

Merge "JobScheduler: Fix reporting the active job status." into main

parents 0e39ea34 570de574
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -127,3 +127,12 @@ flag {
    }
}

flag {
    name: "fix_reporting_active_jobs"
    namespace: "backstage_power"
    description: "Correctly report the active jobs to idle controller"
    bug: "425761099"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}
+10 −3
Original line number Diff line number Diff line
@@ -1789,10 +1789,17 @@ public final class JobServiceContext implements ServiceConnection {
        if (completedJob.isUserVisibleJob()) {
            mService.informObserversOfUserVisibleJobChange(this, completedJob, false);
        }

        if (Flags.fixReportingActiveJobs()) {
            mJobConcurrencyManager.onJobCompletedLocked(this, completedJob, workType);
            mCompletedListener.onJobCompletedLocked(completedJob,
                    reschedulingStopReason, reschedulingInternalStopReason, reschedule);
        } else {
            mCompletedListener.onJobCompletedLocked(completedJob,
                    reschedulingStopReason, reschedulingInternalStopReason, reschedule);
            mJobConcurrencyManager.onJobCompletedLocked(this, completedJob, workType);
        }
    }

    private void applyStoppedReasonLocked(@Nullable String reason) {
        if (reason != null && mStoppedReason == null) {