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
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 */);
|
||||
|
||||
Reference in New Issue
Block a user