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

Commit 47b370e8 authored by Aaron Liu's avatar Aaron Liu Committed by Automerger Merge Worker
Browse files

Merge changes I5150d58a,If6c3edbf into tm-qpr-dev am: 56f76309 am:...

Merge changes I5150d58a,If6c3edbf into tm-qpr-dev am: 56f76309 am: bef584ee am: bdd68aa5 am: 5912d22f

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



Change-Id: I4f78020f82bc45f5126005c0ab84803299b5b014
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 032371e1 5912d22f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -260,6 +260,14 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
         */
        @Override
        public void finish(boolean strongAuth, int targetUserId) {
            if (mFeatureFlags.isEnabled(Flags.PREVENT_BYPASS_KEYGUARD)
                    && !mKeyguardStateController.canDismissLockScreen() && !strongAuth) {
                Log.e(TAG,
                        "Tried to dismiss keyguard when lockscreen is not dismissible and user "
                                + "was not authenticated with a primary security method "
                                + "(pin/password/pattern).");
                return;
            }
            // If there's a pending runnable because the user interacted with a widget
            // and we're leaving keyguard, then run it.
            boolean deferKeyguardDone = false;
+5 −0
Original line number Diff line number Diff line
@@ -228,6 +228,11 @@ object Flags {
    @JvmField
    val ASYNC_INFLATE_BOUNCER = unreleasedFlag(229, "async_inflate_bouncer", teamfood = true)

    /** Whether to inflate the bouncer view on a background thread. */
    // TODO(b/273341787): Tracking Bug
    @JvmField
    val PREVENT_BYPASS_KEYGUARD = unreleasedFlag(230, "prevent_bypass_keyguard")

    // 300 - power menu
    // TODO(b/254512600): Tracking Bug
    @JvmField val POWER_MENU_LITE = releasedFlag(300, "power_menu_lite")
+17 −0
Original line number Diff line number Diff line
@@ -196,6 +196,7 @@ public class KeyguardSecurityContainerControllerTest extends SysuiTestCase {
                .thenReturn(mKeyguardMessageAreaController);
        when(mKeyguardPasswordView.getWindowInsetsController()).thenReturn(mWindowInsetsController);
        when(mKeyguardSecurityModel.getSecurityMode(anyInt())).thenReturn(SecurityMode.PIN);
        when(mKeyguardStateController.canDismissLockScreen()).thenReturn(true);
        mKeyguardPasswordViewController = new KeyguardPasswordViewController(
                (KeyguardPasswordView) mKeyguardPasswordView, mKeyguardUpdateMonitor,
                SecurityMode.Password, mLockPatternUtils, null,
@@ -553,6 +554,22 @@ public class KeyguardSecurityContainerControllerTest extends SysuiTestCase {
        assertThat(mKeyguardSecurityContainerController.willRunDismissFromKeyguard()).isFalse();
    }

    @Test
    public void testSecurityCallbackFinish() {
        when(mKeyguardStateController.canDismissLockScreen()).thenReturn(true);
        when(mKeyguardUpdateMonitor.isUserUnlocked(0)).thenReturn(true);
        mKeyguardSecurityContainerController.finish(true, 0);
        verify(mViewMediatorCallback).keyguardDone(anyBoolean(), anyInt());
    }

    @Test
    public void testSecurityCallbackFinish_cannotDismissLockScreenAndNotStrongAuth() {
        when(mFeatureFlags.isEnabled(Flags.PREVENT_BYPASS_KEYGUARD)).thenReturn(true);
        when(mKeyguardStateController.canDismissLockScreen()).thenReturn(false);
        mKeyguardSecurityContainerController.finish(false, 0);
        verify(mViewMediatorCallback, never()).keyguardDone(anyBoolean(), anyInt());
    }

    @Test
    public void testOnStartingToHide() {
        mKeyguardSecurityContainerController.onStartingToHide();