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

Commit 454dd9e5 authored by Kweku Adams's avatar Kweku Adams
Browse files

Switch from volatile to lock.

The shell command handling method was the only place
mDeterministicUidIdle was being accessed without a lock already being
held on ActivityManagerService, so switch to just requiring the lock on
the boolean instead of making it volatile.

Bug: 286700610
Test: atest CtsJobSchedulerTestCases:JobThrottlingTest
Test: atest CtsJobSchedulerTestCases:NotificationTest
Test: atest CtsJobSchedulerTestCases:UserInitiatedJobTest
Test: atest FrameworksMockingServicesTests:JobNotificationCoordinatorTest
Test: atest FrameworksMockingServicesTests:MockingOomAdjusterTests
Test: atest FrameworksServicesTests:OomAdjusterTests
Change-Id: I6945cc9b4cda8cd19e876de4b19e0f0a6f6a782e
parent f63877d3
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1526,7 +1526,8 @@ public class ActivityManagerService extends IActivityManager.Stub
     */
    int mBootPhase;
    volatile boolean mDeterministicUidIdle = false;
    @GuardedBy("this")
    boolean mDeterministicUidIdle = false;
    @VisibleForTesting
    public WindowManagerService mWindowManager;
@@ -16512,8 +16513,10 @@ public class ActivityManagerService extends IActivityManager.Stub
    @Override
    public void setDeterministicUidIdle(boolean deterministic) {
        synchronized (this) {
            mDeterministicUidIdle = deterministic;
        }
    }
    /** Make the currently active UIDs idle after a certain grace period. */
    final void idleUids() {