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

Commit d2706717 authored by Aaron Liu's avatar Aaron Liu
Browse files

Remove falsing collection for simpin screen.

When falsing event occurs, it invokes
StatusBarKeyguardViewManager#reset. There is no need to call show again
if the bouncer is already showing. This will prevent a flicker of the
sim screen.

Fixes: 298140114
Fixes: 295116465
Test: tap screen on sim pin screen.
Test: reset device to see the sim pin screen.

Change-Id: Ie4b96eed41e157b882025fc0dca8a9b661cc68de
parent 96fe7f89
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -630,8 +630,12 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
    protected void showBouncerOrKeyguard(boolean hideBouncerWhenShowing) {
        if (needsFullscreenBouncer() && !mDozing) {
            // The keyguard might be showing (already). So we need to hide it.
            if (!primaryBouncerIsShowing()) {
                mCentralSurfaces.hideKeyguard();
                mPrimaryBouncerInteractor.show(true);
            } else {
                Log.e(TAG, "Attempted to show the sim bouncer when it is already showing.");
            }
        } else {
            mCentralSurfaces.showKeyguard();
            if (hideBouncerWhenShowing) {
+19 −0
Original line number Diff line number Diff line
@@ -974,4 +974,23 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase {
        verify(mKeyguardMessageAreaController).setIsVisible(eq(false));
        verify(mKeyguardMessageAreaController).setMessage(eq(""));
    }

    @Test
    public void testShowBouncerOrKeyguard_needsFullScreen() {
        when(mKeyguardSecurityModel.getSecurityMode(anyInt())).thenReturn(
                KeyguardSecurityModel.SecurityMode.SimPin);
        mStatusBarKeyguardViewManager.showBouncerOrKeyguard(false);
        verify(mCentralSurfaces).hideKeyguard();
        verify(mPrimaryBouncerInteractor).show(true);
    }

    @Test
    public void testShowBouncerOrKeyguard_needsFullScreen_bouncerAlreadyShowing() {
        when(mKeyguardSecurityModel.getSecurityMode(anyInt())).thenReturn(
                KeyguardSecurityModel.SecurityMode.SimPin);
        when(mPrimaryBouncerInteractor.isFullyShowing()).thenReturn(true);
        mStatusBarKeyguardViewManager.showBouncerOrKeyguard(false);
        verify(mCentralSurfaces, never()).hideKeyguard();
        verify(mPrimaryBouncerInteractor, never()).show(true);
    }
}