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

Commit 0160f534 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

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

Merge "Merge "Run unlock animation on MODE_ONLY_WAKE" into tm-dev am: e196a94c am: 37a6f17a am: d98578c1" into tm-qpr-dev-plus-aosp am: ac5063e8

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



Change-Id: I0663d9027cbf3c7f6b629130ad09fa02f68d6724
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 9215c5cd ac5063e8
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -2810,9 +2810,12 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
        }
    }

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

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

        verify(mKeyguardViewMediator).onWakeAndUnlocking();
        verify(mKeyguardViewMediator).onWake(true /* withUnlock */);
        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);