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

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

Merge "Clean up sim_pin_race_condition flag" into main

parents df464f00 be76b214
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -1441,16 +1441,6 @@ flag {
   }
}

flag {
   name: "sim_pin_race_condition_on_restart"
   namespace: "systemui"
   description: "The SIM PIN screen may be shown incorrectly on reboot"
   bug: "351426938"
   metadata {
        purpose: PURPOSE_BUGFIX
   }
}

flag {
   name: "sim_pin_bouncer_reset"
   namespace: "systemui"
+15 −24
Original line number Diff line number Diff line
@@ -53,7 +53,6 @@ import com.android.keyguard.KeyguardViewController;
import com.android.keyguard.TrustGrantFlags;
import com.android.keyguard.ViewMediatorCallback;
import com.android.systemui.DejankUtils;
import com.android.systemui.Flags;
import com.android.systemui.animation.back.FlingOnBackAnimationCallback;
import com.android.systemui.bouncer.domain.interactor.AlternateBouncerInteractor;
import com.android.systemui.bouncer.domain.interactor.BouncerInteractor;
@@ -710,10 +709,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
     */
    protected void showBouncerOrKeyguard(boolean hideBouncerWhenShowing, boolean isFalsingReset,
            String reason) {
        boolean showBouncer = needsFullscreenBouncer() && !mDozing;
        if (Flags.simPinRaceConditionOnRestart()) {
            showBouncer = showBouncer && !mIsSleeping;
        }
        boolean showBouncer = needsFullscreenBouncer() && !mDozing && !mIsSleeping;
        if (showBouncer) {
            // The keyguard might be showing (already). So we need to hide it.
            if (!primaryBouncerIsShowing()) {
@@ -724,7 +720,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
                            TAG + "#showBouncerOrKeyguard"
                    );
                } else {
                    if (Flags.simPinRaceConditionOnRestart()) {
                    if (mPrimaryBouncerInteractor.show(/* isScrimmed= */ true, reason)) {
                        mAttemptsToShowBouncer = 0;
                        mCentralSurfaces.hideKeyguard();
@@ -738,15 +733,11 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
                            Log.v(TAG, "Failed to show bouncer, attempt #: "
                                    + mAttemptsToShowBouncer++);
                            mExecutor.executeDelayed(() ->
                                        showBouncerOrKeyguard(hideBouncerWhenShowing,
                                            isFalsingReset, reason),
                                    showBouncerOrKeyguard(hideBouncerWhenShowing, isFalsingReset,
                                        reason),
                                    500);
                        }
                    }
                    } else {
                        mCentralSurfaces.hideKeyguard();
                        mPrimaryBouncerInteractor.show(/* isScrimmed= */ true, reason);
                    }
                }
            } else if (!isFalsingReset) {
                // Falsing resets can cause this to flicker, so don't reset in this case
+1 −14
Original line number Diff line number Diff line
@@ -193,7 +193,7 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase {
    public final CheckFlagsRule mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule();

    @Before
    @DisableFlags(com.android.systemui.Flags.FLAG_KEYGUARD_WM_STATE_REFACTOR)
    @DisableFlags(Flags.FLAG_KEYGUARD_WM_STATE_REFACTOR)
    public void setUp() {
        MockitoAnnotations.initMocks(this);
        when(mContainer.findViewById(anyInt())).thenReturn(mKeyguardMessageArea);
@@ -846,18 +846,6 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase {

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

    @Test
    @DisableSceneContainer
    @EnableFlags(Flags.FLAG_SIM_PIN_RACE_CONDITION_ON_RESTART)
    public void testShowBouncerOrKeyguard_showsKeyguardIfShowBouncerReturnsFalse() {
        when(mKeyguardSecurityModel.getSecurityMode(anyInt())).thenReturn(
                KeyguardSecurityModel.SecurityMode.SimPin);
@@ -878,7 +866,6 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase {

    @Test
    @DisableSceneContainer
    @EnableFlags(Flags.FLAG_SIM_PIN_RACE_CONDITION_ON_RESTART)
    public void testShowBouncerOrKeyguard_showsKeyguardIfSleeping() {
        when(mKeyguardTransitionInteractor.getTransitionState().getValue().getTo())
                .thenReturn(KeyguardState.LOCKSCREEN);