From b6e25d2b819f86558a99447703ea88939f31cdc7 Mon Sep 17 00:00:00 2001 From: Josh Tsuji Date: Thu, 5 Aug 2021 15:45:34 -0400 Subject: [PATCH] Fix KeyguardTests#testScreenOffCausesSingleStopAod When the devices goes into doze mode to display AOD contents, the screen turns off before displaying AOD contents on some devices (i.e. config_displayBlanksAfterDoze=true). On such devices, SysUI calls IActivityTaskManager#setLockScreenShown first before start dozing, otherwise ATMS/WM wakes up the activities when dozing starts. Bug: 193479273 Test: manual 1. adb root && adb shell setprop debug.force_blanking 1 && adb reboot 2. atest KeyguardTests Change-Id: I64cecd8e866f1debdcd7429ca4987cd70eceb45c --- .../com/android/systemui/keyguard/KeyguardViewMediator.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 84cb12cf5e49a..c20ae0b045ac5 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -2759,7 +2759,10 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, // Don't hide the keyguard due to a doze change if there's a lock pending, because we're // just going to show it again. - if (mShowing || !mPendingLock) { + // If the device is not capable of controlling the screen off animation, SysUI needs to + // update lock screen state in ATMS here, otherwise ATMS tries to resume activities when + // enabling doze state. + if (mShowing || !mPendingLock || !mDozeParameters.canControlUnlockedScreenOff()) { setShowingLocked(mShowing); } }