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

Commit 7241eee2 authored by Automerger Merge Worker's avatar Automerger Merge Worker Committed by Android (Google) Code Review
Browse files

Merge "Merge "Revert "Run unlock animation on MODE_ONLY_WAKE"" into tm-dev am:...

Merge "Merge "Revert "Run unlock animation on MODE_ONLY_WAKE"" into tm-dev am: 39f79b0f am: dbb2c088 am: 802d9387 am: 1869a45c"
parents d5014ef6 f65eae7b
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -2810,12 +2810,9 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
        }
    }

    /**
     * Receive a wake event from outside this class (most likely bio auth).
     */
    public void onWake(boolean withUnlock) {
        Trace.beginSection("KeyguardViewMediator#onWake");
        mWakeAndUnlocking = withUnlock;
    public void onWakeAndUnlocking() {
        Trace.beginSection("KeyguardViewMediator#onWakeAndUnlocking");
        mWakeAndUnlocking = true;

        keyguardDone();
        Trace.endSection();
+1 −3
Original line number Diff line number Diff line
@@ -492,12 +492,10 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
                    mUpdateMonitor.awakenFromDream();
                }
                mNotificationShadeWindowController.setNotificationShadeFocusable(false);
                mKeyguardViewMediator.onWake(true /* withUnlock */);
                mKeyguardViewMediator.onWakeAndUnlocking();
                Trace.endSection();
                break;
            case MODE_ONLY_WAKE:
                mKeyguardViewMediator.onWake(false /* withUnlock */);
                break;
            case MODE_NONE:
                break;
        }
+1 −18
Original line number Diff line number Diff line
@@ -179,28 +179,11 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase {
        mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT,
                BiometricSourceType.FINGERPRINT, true /* isStrongBiometric */);

        verify(mKeyguardViewMediator).onWake(true /* withUnlock */);
        verify(mKeyguardViewMediator).onWakeAndUnlocking();
        assertThat(mBiometricUnlockController.getMode())
                .isEqualTo(BiometricUnlockController.MODE_WAKE_AND_UNLOCK_PULSING);
    }

    @Test
    public void onBiometricAuthenticated_whenFingerprintAndInteractive_wakeWithoutUnlock() {
        reset(mUpdateMonitor);
        reset(mStatusBarKeyguardViewManager);
        when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(false);
        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).onWake(false /* withUnlock */);
        assertThat(mBiometricUnlockController.getMode())
                .isEqualTo(BiometricUnlockController.MODE_ONLY_WAKE);
    }

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