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
This commit is contained in:
Josh Tsuji
2021-08-05 15:45:34 -04:00
committed by Issei Suzuki
parent 20c38783c2
commit b6e25d2b81

View File

@@ -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);
}
}