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

Commit ee829765 authored by Matt Pietal's avatar Matt Pietal Committed by Android (Google) Code Review
Browse files

Merge "Display SIM PIN immediately when inserted on unlocked lockscreen" into main

parents d8c141a1 064abbaf
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -622,6 +622,22 @@ class KeyguardSecurityContainerControllerTest : SysuiTestCase() {
        verify(viewFlipperController).getSecurityView(eq(SecurityMode.SimPin), any(), any())
    }

    @Test
    fun showNextSecurityScreenOrFinish_calledWithNoAuthentication_butRequiresSimPin() {
        // GIVEN trust is true (extended unlock)
        whenever(keyguardUpdateMonitor.getUserHasTrust(anyInt())).thenReturn(true)

        // WHEN SIMPIN is the next required screen
        whenever(keyguardSecurityModel.getSecurityMode(TARGET_USER_ID))
            .thenReturn(SecurityMode.SimPin)

        // WHEN a request is made to dismiss
        underTest.dismiss(TARGET_USER_ID)

        // THEN we will show the SIM PIN screen
        verify(viewFlipperController).getSecurityView(eq(SecurityMode.SimPin), any(), any())
    }

    @Test
    fun onSwipeUp_forwardsItToFaceAuthInteractor() {
        val registeredSwipeListener = registeredSwipeListener
+12 −0
Original line number Diff line number Diff line
@@ -897,6 +897,18 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
                    break;
            }
        }
        // A check to dismiss was made without any authentication. Verify there are no remaining SIM
        // screens, which may happen on an unlocked lockscreen
        if (!authenticated) {
            SecurityMode securityMode = mSecurityModel.getSecurityMode(targetUserId);
            if (Arrays.asList(SimPin, SimPuk).contains(securityMode)) {
                Log.v(TAG, "Dismiss called but SIM/PUK unlock screen still required");
                eventSubtype = -1;
                showSecurityScreen(securityMode);
                finish = false;
            }
        }

        // Check for device admin specified additional security measures.
        if (finish && !bypassSecondaryLockScreen) {
            Intent secondaryLockscreenIntent =