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

Commit 00ec45f4 authored by Chandru's avatar Chandru Committed by Chandru S
Browse files

Stop face auth when bouncerWillBeShown instead of bouncerFullyShown

Fixes: 243749080
Test: atest KeyguardUpdateMonitor passes
Change-Id: I1bcba8641030917a207265f77128b27acdfd5bc1
parent 7b46b29b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ data class KeyguardFaceListenModel(
    val becauseCannotSkipBouncer: Boolean,
    val biometricSettingEnabledForUser: Boolean,
    val bouncerFullyShown: Boolean,
    val bouncerIsOrWillShow: Boolean,
    val faceAuthenticated: Boolean,
    val faceDisabled: Boolean,
    val goingToSleep: Boolean,
+3 −2
Original line number Diff line number Diff line
@@ -2494,7 +2494,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        // on bouncer if both fp and fingerprint are enrolled.
        final boolean awakeKeyguardExcludingBouncerShowing = mKeyguardIsVisible
                && mDeviceInteractive && !mGoingToSleep
                && !statusBarShadeLocked && !mBouncerFullyShown;
                && !statusBarShadeLocked && !mBouncerIsOrWillBeShowing;
        final int user = getCurrentUser();
        final int strongAuth = mStrongAuthTracker.getStrongAuthForUser(user);
        final boolean isLockDown =
@@ -2563,6 +2563,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
                    becauseCannotSkipBouncer,
                    biometricEnabledForUser,
                    mBouncerFullyShown,
                    mBouncerIsOrWillBeShowing,
                    faceAuthenticated,
                    faceDisabledForUser,
                    mGoingToSleep,
@@ -3131,7 +3132,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
                    cb.onKeyguardBouncerStateChanged(mBouncerIsOrWillBeShowing);
                }
            }
            updateFingerprintListeningState(BIOMETRIC_ACTION_UPDATE);
            updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE);
        }

        if (wasBouncerFullyShown != mBouncerFullyShown) {
+1 −0
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ private fun faceModel(user: Int) = KeyguardFaceListenModel(
    becauseCannotSkipBouncer = false,
    biometricSettingEnabledForUser = false,
    bouncerFullyShown = false,
    bouncerIsOrWillShow = false,
    onlyFaceEnrolled = false,
    faceAuthenticated = false,
    faceDisabled = false,
+6 −1
Original line number Diff line number Diff line
@@ -1511,7 +1511,7 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
                anyBoolean());
        CancellationSignal cancelSignal = mCancellationSignalCaptor.getValue();

        bouncerFullyVisible();
        bouncerWillBeVisibleSoon();
        mTestableLooper.processAllMessages();

        assertThat(cancelSignal.isCanceled()).isTrue();
@@ -1669,6 +1669,11 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
        setKeyguardBouncerVisibility(true);
    }

    private void bouncerWillBeVisibleSoon() {
        mKeyguardUpdateMonitor.sendKeyguardBouncerChanged(true, false);
        mTestableLooper.processAllMessages();
    }

    private void setKeyguardBouncerVisibility(boolean isVisible) {
        mKeyguardUpdateMonitor.sendKeyguardBouncerChanged(isVisible, isVisible);
        mTestableLooper.processAllMessages();