From dc072507d0f52deb7e23ca5618816dbf18952204 Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Thu, 20 Jul 2023 15:14:36 -0700 Subject: [PATCH] Fix user switcher flicker. User switcher flickers when bouncer shows scrimmed. This is because when the bouncer hides, the alpha of the view is considered to be 1f. When we are showing the bouncer, we are asynchronously inflating the view and waiting for this operation to complete to start the appear animation. In order to fix this, we reset the view before making this async call to ensure that the view alpha is 0f. It will be set to 1f in #appear. Fixes: 290355544 Test: test pattern, pin, password back button and success. Change-Id: I1680d66336b5b6d5d1065c85ac4b09ca56e12d7a --- .../src/com/android/keyguard/KeyguardSecurityContainer.java | 2 ++ .../systemui/bouncer/ui/binder/KeyguardBouncerViewBinder.kt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java index 42a4e7202c824..dc1ddc77dd6ca 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java @@ -1197,6 +1197,8 @@ public class KeyguardSecurityContainer extends ConstraintLayout { }); mPopup.show(); }); + + mUserSwitcherViewGroup.setAlpha(0f); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/bouncer/ui/binder/KeyguardBouncerViewBinder.kt b/packages/SystemUI/src/com/android/systemui/bouncer/ui/binder/KeyguardBouncerViewBinder.kt index 34e934bec0032..d9ec5d0d17442 100644 --- a/packages/SystemUI/src/com/android/systemui/bouncer/ui/binder/KeyguardBouncerViewBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/bouncer/ui/binder/KeyguardBouncerViewBinder.kt @@ -120,6 +120,8 @@ object KeyguardBouncerViewBinder { viewModel.isShowing.collect { isShowing -> view.visibility = if (isShowing) View.VISIBLE else View.INVISIBLE if (isShowing) { + // Reset security container because these views are not reinflated. + securityContainerController.reset() securityContainerController.reinflateViewFlipper { // Reset Security Container entirely. securityContainerController.onBouncerVisibilityChanged(