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

Commit f38c6eec authored by Daniel Chapin's avatar Daniel Chapin Committed by Android (Google) Code Review
Browse files

Merge "Revert "Issue resets to the SIM bouncer"" into main

parents 0b114540 b20aa4fa
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -2995,7 +2995,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
                @Override
                @Override
                public void onFalse() {
                public void onFalse() {
                    // Hides quick settings, bouncer, and quick-quick settings.
                    // Hides quick settings, bouncer, and quick-quick settings.
                    mStatusBarKeyguardViewManager.reset(true, /* isFalsingReset= */true);
                    mStatusBarKeyguardViewManager.reset(true);
                }
                }
            };
            };


+4 −12
Original line number Original line Diff line number Diff line
@@ -708,7 +708,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
     * Shows the notification keyguard or the bouncer depending on
     * Shows the notification keyguard or the bouncer depending on
     * {@link #needsFullscreenBouncer()}.
     * {@link #needsFullscreenBouncer()}.
     */
     */
    protected void showBouncerOrKeyguard(boolean hideBouncerWhenShowing, boolean isFalsingReset) {
    protected void showBouncerOrKeyguard(boolean hideBouncerWhenShowing) {
        boolean isDozing = mDozing;
        boolean isDozing = mDozing;
        if (Flags.simPinRaceConditionOnRestart()) {
        if (Flags.simPinRaceConditionOnRestart()) {
            KeyguardState toState = mKeyguardTransitionInteractor.getTransitionState().getValue()
            KeyguardState toState = mKeyguardTransitionInteractor.getTransitionState().getValue()
@@ -734,12 +734,8 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
                        mPrimaryBouncerInteractor.show(/* isScrimmed= */ true);
                        mPrimaryBouncerInteractor.show(/* isScrimmed= */ true);
                    }
                    }
                }
                }
            } else if (!isFalsingReset) {
            } else {
                // Falsing resets can cause this to flicker, so don't reset in this case
                Log.e(TAG, "Attempted to show the sim bouncer when it is already showing.");
                Log.i(TAG, "Sim bouncer is already showing, issuing a refresh");
                mPrimaryBouncerInteractor.hide();
                mPrimaryBouncerInteractor.show(/* isScrimmed= */ true);

            }
            }
        } else {
        } else {
            mCentralSurfaces.showKeyguard();
            mCentralSurfaces.showKeyguard();
@@ -961,10 +957,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb


    @Override
    @Override
    public void reset(boolean hideBouncerWhenShowing) {
    public void reset(boolean hideBouncerWhenShowing) {
        reset(hideBouncerWhenShowing, /* isFalsingReset= */false);
    }

    public void reset(boolean hideBouncerWhenShowing, boolean isFalsingReset) {
        if (mKeyguardStateController.isShowing() && !bouncerIsAnimatingAway()) {
        if (mKeyguardStateController.isShowing() && !bouncerIsAnimatingAway()) {
            final boolean isOccluded = mKeyguardStateController.isOccluded();
            final boolean isOccluded = mKeyguardStateController.isOccluded();
            // Hide quick settings.
            // Hide quick settings.
@@ -976,7 +968,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
                    hideBouncer(false /* destroyView */);
                    hideBouncer(false /* destroyView */);
                }
                }
            } else {
            } else {
                showBouncerOrKeyguard(hideBouncerWhenShowing, isFalsingReset);
                showBouncerOrKeyguard(hideBouncerWhenShowing);
            }
            }
            if (hideBouncerWhenShowing) {
            if (hideBouncerWhenShowing) {
                hideAlternateBouncer(true);
                hideAlternateBouncer(true);
+3 −18
Original line number Original line Diff line number Diff line
@@ -1068,7 +1068,7 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase {
    public void testShowBouncerOrKeyguard_needsFullScreen() {
    public void testShowBouncerOrKeyguard_needsFullScreen() {
        when(mKeyguardSecurityModel.getSecurityMode(anyInt())).thenReturn(
        when(mKeyguardSecurityModel.getSecurityMode(anyInt())).thenReturn(
                KeyguardSecurityModel.SecurityMode.SimPin);
                KeyguardSecurityModel.SecurityMode.SimPin);
        mStatusBarKeyguardViewManager.showBouncerOrKeyguard(false, false);
        mStatusBarKeyguardViewManager.showBouncerOrKeyguard(false);
        verify(mCentralSurfaces).hideKeyguard();
        verify(mCentralSurfaces).hideKeyguard();
        verify(mPrimaryBouncerInteractor).show(true);
        verify(mPrimaryBouncerInteractor).show(true);
    }
    }
@@ -1084,7 +1084,7 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase {
                .thenReturn(KeyguardState.LOCKSCREEN);
                .thenReturn(KeyguardState.LOCKSCREEN);


        reset(mCentralSurfaces);
        reset(mCentralSurfaces);
        mStatusBarKeyguardViewManager.showBouncerOrKeyguard(false, false);
        mStatusBarKeyguardViewManager.showBouncerOrKeyguard(false);
        verify(mPrimaryBouncerInteractor).show(true);
        verify(mPrimaryBouncerInteractor).show(true);
        verify(mCentralSurfaces).showKeyguard();
        verify(mCentralSurfaces).showKeyguard();
    }
    }
@@ -1092,26 +1092,11 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase {
    @Test
    @Test
    @DisableSceneContainer
    @DisableSceneContainer
    public void testShowBouncerOrKeyguard_needsFullScreen_bouncerAlreadyShowing() {
    public void testShowBouncerOrKeyguard_needsFullScreen_bouncerAlreadyShowing() {
        boolean isFalsingReset = false;
        when(mKeyguardSecurityModel.getSecurityMode(anyInt())).thenReturn(
        when(mKeyguardSecurityModel.getSecurityMode(anyInt())).thenReturn(
                KeyguardSecurityModel.SecurityMode.SimPin);
                KeyguardSecurityModel.SecurityMode.SimPin);
        when(mPrimaryBouncerInteractor.isFullyShowing()).thenReturn(true);
        when(mPrimaryBouncerInteractor.isFullyShowing()).thenReturn(true);
        mStatusBarKeyguardViewManager.showBouncerOrKeyguard(false, isFalsingReset);
        mStatusBarKeyguardViewManager.showBouncerOrKeyguard(false);
        verify(mCentralSurfaces, never()).hideKeyguard();
        verify(mCentralSurfaces, never()).hideKeyguard();
        verify(mPrimaryBouncerInteractor).show(true);
    }

    @Test
    @DisableSceneContainer
    public void testShowBouncerOrKeyguard_needsFullScreen_bouncerAlreadyShowing_onFalsing() {
        boolean isFalsingReset = true;
        when(mKeyguardSecurityModel.getSecurityMode(anyInt())).thenReturn(
                KeyguardSecurityModel.SecurityMode.SimPin);
        when(mPrimaryBouncerInteractor.isFullyShowing()).thenReturn(true);
        mStatusBarKeyguardViewManager.showBouncerOrKeyguard(false, isFalsingReset);
        verify(mCentralSurfaces, never()).hideKeyguard();

        // Do not refresh the full screen bouncer if the call is from falsing
        verify(mPrimaryBouncerInteractor, never()).show(true);
        verify(mPrimaryBouncerInteractor, never()).show(true);
    }
    }