From 96e3b2afb0b172a568ab180b6e71cedf071f9545 Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Wed, 12 Jul 2017 15:32:18 +0200 Subject: [PATCH] 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 --- .../core/java/com/android/server/am/ActivityManagerService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index f106ca0b35cb9..75467f5145407 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -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.