From f89a5dc93f7fca14af9945d5dbef0597c47b1cee Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Tue, 18 Jun 2019 15:10:25 -0700 Subject: [PATCH] Enabling auth to succeed whenever the bouncer is showing Previously we could get stuck in a state where the user had to enter their pin. Fixes: 135545123 Test: drag down with face expiring, then click on notifications. Observe working face Change-Id: Ie9644dc8ff9a6a18067634478f96bb51675da80b --- .../phone/KeyguardBypassController.kt | 26 ++++++++++++------- .../systemui/statusbar/phone/StatusBar.java | 1 + 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBypassController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBypassController.kt index 56b64dfff7ac8..4be4d908979f2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBypassController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBypassController.kt @@ -33,20 +33,23 @@ class KeyguardBypassController { private val unlockMethodCache: UnlockMethodCache private val statusBarStateController: StatusBarStateController - lateinit var unlockController: BiometricUnlockController - var isPulseExpanding = false - - /** - * If face unlock dismisses the lock screen or keeps user on keyguard for the current user. - */ - var bypassEnabled: Boolean = false - get() = field && unlockMethodCache.isUnlockingWithFacePossible - private set /** * The pending unlock type which is set if the bypass was blocked when it happened. */ private var pendingUnlockType: BiometricSourceType? = null + lateinit var unlockController: BiometricUnlockController + var isPulseExpanding = false + + /** + * If face unlock dismisses the lock screen or keeps user on keyguard for the current user. + */ + var bypassEnabled: Boolean = false + get() = field && unlockMethodCache.isUnlockingWithFacePossible + private set + + var bouncerShowing: Boolean = false + @Inject constructor(context: Context, tunerService: TunerService, statusBarStateController: StatusBarStateController) { @@ -85,6 +88,11 @@ class KeyguardBypassController { */ fun onBiometricAuthenticated(biometricSourceType: BiometricSourceType): Boolean { if (bypassEnabled) { + if (bouncerShowing) { + // Whenever the bouncer is showing, we want to unlock. Otherwise we can get stuck + // in the shade locked where the bouncer wouldn't unlock + return true + } if (statusBarStateController.state != StatusBarState.KEYGUARD) { // We're bypassing but not actually on the lockscreen, the user should decide when // to unlock diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index 09024842a586b..2d4c1aa0e1791 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -3571,6 +3571,7 @@ public class StatusBar extends SystemUI implements DemoMode, */ public void setBouncerShowing(boolean bouncerShowing) { mBouncerShowing = bouncerShowing; + mKeyguardBypassController.setBouncerShowing(bouncerShowing); if (mStatusBarView != null) mStatusBarView.setBouncerShowing(bouncerShowing); updateHideIconsForBouncer(true /* animate */); mCommandQueue.recomputeDisableFlags(mDisplayId, true /* animate */);