From de8442bc48683cd85555802f40ab0ec7fec1a7c7 Mon Sep 17 00:00:00 2001 From: Issei Suzuki Date: Wed, 13 Jul 2022 15:23:41 +0000 Subject: [PATCH] Reset keyguardGoingAway status when AOD is showing. Bug: 237391074 Test: manual 1. goto lock screen and show AOD 2. touch fingerprint sensor to unlock the device 3. as soon as fingerprint sensor reacts, push power button. 4. see output of `adb logcat -b events` and verify keyguardGoingAway state is reset after SysUI requests to show both lockscreen and AOD. Change-Id: Ibeac8ac92ce51f4fc2aa9cb123812f7ce1cc4b0c --- .../java/com/android/server/wm/KeyguardController.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/services/core/java/com/android/server/wm/KeyguardController.java b/services/core/java/com/android/server/wm/KeyguardController.java index ca4376e0f2637..d76f6be93aebb 100644 --- a/services/core/java/com/android/server/wm/KeyguardController.java +++ b/services/core/java/com/android/server/wm/KeyguardController.java @@ -170,11 +170,12 @@ class KeyguardController { final KeyguardDisplayState state = getDisplayState(displayId); final boolean aodChanged = aodShowing != state.mAodShowing; + final boolean aodRemoved = state.mAodShowing && !aodShowing; // If keyguard is going away, but SystemUI aborted the transition, need to reset state. - // Do not reset keyguardChanged status if this is aodChanged. + // Do not reset keyguardChanged status when only AOD is removed. final boolean keyguardChanged = (keyguardShowing != state.mKeyguardShowing) - || (state.mKeyguardGoingAway && keyguardShowing && !aodChanged); - if (aodChanged && !aodShowing) { + || (state.mKeyguardGoingAway && keyguardShowing && !aodRemoved); + if (aodRemoved) { updateDeferWakeTransition(false /* waiting */); } if (!keyguardChanged && !aodChanged) {