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

Commit a3cac0b7 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Enter device on non-bypass face auth on transition to altBouncer" into main

parents 5deb3ba4 bc374260
Loading
Loading
Loading
Loading
+18 −0
Original line number Original line Diff line number Diff line
@@ -438,6 +438,24 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase {
                .isEqualTo(BiometricSourceType.FACE);
                .isEqualTo(BiometricSourceType.FACE);
    }
    }


    @Test
    public void onBiometricAuthenticated_whenFaceOnTransitionToAlternateBouncer_dismissBouncer() {
        when(mUpdateMonitor.isUnlockingWithBiometricAllowed(anyBoolean())).thenReturn(true);
        when(mStatusBarKeyguardViewManager.primaryBouncerIsOrWillBeShowing()).thenReturn(false);
        when(mKeyguardTransitionInteractor.getStartedState())
                .thenReturn(KeyguardState.ALTERNATE_BOUNCER);
        // the value of isStrongBiometric doesn't matter here since we only care about the returned
        // value of isUnlockingWithBiometricAllowed()
        mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT,
                BiometricSourceType.FACE, true /* isStrongBiometric */);

        verify(mStatusBarKeyguardViewManager).notifyKeyguardAuthenticated(eq(false));
        assertThat(mBiometricUnlockController.getMode())
                .isEqualTo(BiometricUnlockController.MODE_DISMISS_BOUNCER);
        assertThat(mBiometricUnlockController.getBiometricType())
                .isEqualTo(BiometricSourceType.FACE);
    }

    @Test
    @Test
    public void onBiometricAuthenticated_whenBypassOnBouncer_dismissBouncer() {
    public void onBiometricAuthenticated_whenBypassOnBouncer_dismissBouncer() {
        reset(mKeyguardBypassController);
        reset(mKeyguardBypassController);
+2 −0
Original line number Original line Diff line number Diff line
@@ -665,6 +665,8 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
                || mAuthController.isUdfpsFingerDown();
                || mAuthController.isUdfpsFingerDown();
        final boolean isBouncerShowing = mKeyguardViewController.primaryBouncerIsOrWillBeShowing()
        final boolean isBouncerShowing = mKeyguardViewController.primaryBouncerIsOrWillBeShowing()
                || mKeyguardTransitionInteractor.getCurrentState()
                || mKeyguardTransitionInteractor.getCurrentState()
                    == KeyguardState.ALTERNATE_BOUNCER
                || mKeyguardTransitionInteractor.getStartedState()
                    == KeyguardState.ALTERNATE_BOUNCER;
                    == KeyguardState.ALTERNATE_BOUNCER;


        logCalculateModeForPassiveAuth(unlockingAllowed, deviceInteractive, isKeyguardShowing,
        logCalculateModeForPassiveAuth(unlockingAllowed, deviceInteractive, isKeyguardShowing,