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

Commit 3738695a authored by Matt Pietal's avatar Matt Pietal Committed by Automerger Merge Worker
Browse files

Merge "Run unlock animation when device is already unlocked" into tm-dev am:...

Merge "Run unlock animation when device is already unlocked" into tm-dev am: e16348eb am: 2bf5f9d9 am: b3e3c16d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18674984



Change-Id: Ia010da265b4149ae8e6d58f7951bcd8e0a3aad59
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 61e5ccc3 b3e3c16d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -550,6 +550,9 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
        if (!mUpdateMonitor.isDeviceInteractive()) {
            if (!mKeyguardViewController.isShowing()
                    && !mScreenOffAnimationController.isKeyguardShowDelayed()) {
                if (mKeyguardStateController.isUnlocked()) {
                    return MODE_WAKE_AND_UNLOCK;
                }
                return MODE_ONLY_WAKE;
            } else if (mDozeScrimController.isPulsing() && unlockingAllowed) {
                return MODE_WAKE_AND_UNLOCK_PULSING;
+19 −0
Original line number Diff line number Diff line
@@ -124,6 +124,7 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase {
        when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(true);
        when(mUpdateMonitor.isDeviceInteractive()).thenReturn(true);
        when(mKeyguardStateController.isFaceAuthEnabled()).thenReturn(true);
        when(mKeyguardStateController.isUnlocked()).thenReturn(false);
        when(mKeyguardBypassController.onBiometricAuthenticated(any(), anyBoolean()))
                .thenReturn(true);
        when(mAuthController.isUdfpsFingerDown()).thenReturn(false);
@@ -184,6 +185,24 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase {
                .isEqualTo(BiometricUnlockController.MODE_WAKE_AND_UNLOCK_PULSING);
    }

    @Test
    public void onBiometricAuthenticated_whenDeviceIsAlreadyUnlocked_wakeAndUnlock() {
        reset(mUpdateMonitor);
        reset(mStatusBarKeyguardViewManager);
        when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(false);
        when(mKeyguardStateController.isUnlocked()).thenReturn(true);
        when(mUpdateMonitor.isUnlockingWithBiometricAllowed(anyBoolean())).thenReturn(true);
        when(mDozeScrimController.isPulsing()).thenReturn(false);
        // the value of isStrongBiometric doesn't matter here since we only care about the returned
        // value of isUnlockingWithBiometricAllowed()
        mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT,
                BiometricSourceType.FINGERPRINT, true /* isStrongBiometric */);

        verify(mKeyguardViewMediator).onWakeAndUnlocking();
        assertThat(mBiometricUnlockController.getMode())
                .isEqualTo(BiometricUnlockController.MODE_WAKE_AND_UNLOCK);
    }

    @Test
    public void onBiometricAuthenticated_whenFingerprint_notifyKeyguardAuthenticated() {
        when(mUpdateMonitor.isUnlockingWithBiometricAllowed(anyBoolean())).thenReturn(true);