From ce4653f7afa7c24cc34ba4d07974e0805dcdc783 Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Wed, 21 Jun 2023 12:32:55 -0700 Subject: [PATCH] Ensure that disappear animation callback is run. When we authenticate sim pin with a None security method, we are running into an issue where we are not running the "keyguardDone" runnable when the disappear animation completes. This is because when the sim state changes, we tell the statusbarkeyguardviewmanager to reset. This hides the bouncer and removes the disappear animation finish runnable. When we tell the statusbarkeguardviewmanager to reset, we only want to reset if we are not animating away. Fixes: 288099374 Test: add a unit test Test: unlock sim with none method. Test: disable esim with none method. Test: unlock sim with a pin method. Test: disable esim with pin method. Test: unlock pin method. Change-Id: I52783d0a0d92dbec4dfcfe171df512ec347e4bef --- .../statusbar/phone/StatusBarKeyguardViewManager.java | 2 +- .../phone/StatusBarKeyguardViewManagerTest.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) 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 e63875b92b64a..cb2a78d8be357 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java @@ -703,7 +703,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb @Override public void reset(boolean hideBouncerWhenShowing) { - if (mKeyguardStateController.isShowing()) { + if (mKeyguardStateController.isShowing() && !bouncerIsAnimatingAway()) { final boolean isOccluded = mKeyguardStateController.isOccluded(); // Hide quick settings. mShadeViewController.resetViews(/* animate= */ !isOccluded); 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 548e1b501d45e..c7143debf8a84 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 @@ -736,6 +736,16 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { verify(mAlternateBouncerInteractor, never()).hide(); } + @Test + public void testResetBouncerAnimatingAway() { + reset(mPrimaryBouncerInteractor); + when(mPrimaryBouncerInteractor.isAnimatingAway()).thenReturn(true); + + mStatusBarKeyguardViewManager.reset(true); + + verify(mPrimaryBouncerInteractor, never()).hide(); + } + @Test public void handleDispatchTouchEvent_alternateBouncerNotVisible() { mStatusBarKeyguardViewManager.addCallback(mCallback);