Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f89a5dc9 authored by Selim Cinek's avatar Selim Cinek
Browse files

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
parent b8cc6efc
Loading
Loading
Loading
Loading
+15 −7
Original line number Diff line number Diff line
@@ -33,6 +33,11 @@ class KeyguardBypassController {
    private val unlockMethodCache: UnlockMethodCache
    private val statusBarStateController: StatusBarStateController

    /**
     * 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

@@ -42,10 +47,8 @@ class KeyguardBypassController {
    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

    var bouncerShowing: Boolean = false

    @Inject
    constructor(context: Context, tunerService: TunerService,
@@ -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
+1 −0
Original line number Diff line number Diff line
@@ -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 */);