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

Commit 96e3b2af authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Also go to sleep when dozing

Since always-on-screen shows over an occluded activity, we also
need to go to sleep to in that case. Now, we could introduce
another sleep token that's controlled by SystemUI. But that's a
bit complicated. It's much simpler to unconditionally go to sleep
whenever we are dozing.

Test: With always-on-device, open occluded activity, turn off
screen, make sure activity pauses.
Fixes: 62679291

Change-Id: Icd64037d33cc523e498a0a9f5f7df939304e02ed
parent 8b44d372
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -12460,10 +12460,10 @@ public class ActivityManagerService extends IActivityManager.Stub
        switch (mWakefulness) {
            case PowerManagerInternal.WAKEFULNESS_AWAKE:
            case PowerManagerInternal.WAKEFULNESS_DREAMING:
            case PowerManagerInternal.WAKEFULNESS_DOZING:
                // Pause applications whenever the lock screen is shown or any sleep
                // tokens have been acquired.
                return mKeyguardController.isKeyguardShowing() || !mSleepTokens.isEmpty();
            case PowerManagerInternal.WAKEFULNESS_DOZING:
            case PowerManagerInternal.WAKEFULNESS_ASLEEP:
            default:
                // If we're asleep then pause applications unconditionally.