diff options
| author | 2023-09-11 10:20:00 -0700 | |
|---|---|---|
| committer | 2023-09-18 08:11:49 -0700 | |
| commit | d2706717bd3a50e2837fe5175552882b21f54c4b (patch) | |
| tree | 2e8b498cab6fe84b3b025f1fa1703ed2e3fe204f | |
| parent | 96fe7f898286b87cb483478a9d83bef4b518bfc7 (diff) | |
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
2 files changed, 25 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java index 27b8406e3bf9..dc882267d41d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java @@ -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. - mCentralSurfaces.hideKeyguard(); - mPrimaryBouncerInteractor.show(true); + 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) { diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java index 0da736003e22..13ba627c0ab4 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java @@ -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); + } } |