From 5d2658c61025d2e13e044648ef9fb4c78e8a6d66 Mon Sep 17 00:00:00 2001 From: Curtis Belmonte Date: Thu, 1 Jul 2021 12:35:53 -0700 Subject: [PATCH] Don't start face auth when device is going to sleep Fixes an issue where KeyguardUpdateMonitor would be notified that Keyguard is no longer going away before it was notified that the device was going to sleep. This caused Keyguard to begin listening for face authentication when the device was going to sleep. Test: Manual Fixes: 189475610 Change-Id: Ia73a6cb921828c43eb2b80b5c4686697b75aca5d --- .../systemui/keyguard/KeyguardViewMediator.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index b5fd73984a79e..15f7a1219f3fb 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -975,12 +975,6 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, mPowerGestureIntercepted = false; mGoingToSleep = true; - // Reset keyguard going away state so we can start listening for fingerprint. We - // explicitly DO NOT want to call - // mKeyguardViewControllerLazy.get().setKeyguardGoingAwayState(false) - // here, since that will mess with the device lock state. - mUpdateMonitor.dispatchKeyguardGoingAway(false); - // Lock immediately based on setting if secure (user has a pin/pattern/password). // This also "locks" the device when not secure to provide easy access to the // camera while preventing unwanted input. @@ -1018,7 +1012,15 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, playSounds(true); } } + mUpdateMonitor.dispatchStartedGoingToSleep(offReason); + + // Reset keyguard going away state so we can start listening for fingerprint. We + // explicitly DO NOT want to call + // mKeyguardViewControllerLazy.get().setKeyguardGoingAwayState(false) + // here, since that will mess with the device lock state. + mUpdateMonitor.dispatchKeyguardGoingAway(false); + notifyStartedGoingToSleep(); }