diff options
| author | 2021-06-08 14:05:02 -0400 | |
|---|---|---|
| committer | 2021-06-08 14:19:01 -0400 | |
| commit | 1c90e728c9c09138e00aa88811ee6497210b0eaf (patch) | |
| tree | 233e57c7a31e61ba12b557b6a9afc3a4a6d37c7a | |
| parent | 00d26d7185c0886eb5a4cd2fb2c7a0fea532228b (diff) | |
Smartspace in wrong position
KeyguardClockSwitch will be recreated by
NotificationPanelViewController for a variety of reasons, including
onDensityOrFontScaleChanged(). When this happens, the large/small
clock state can get out of sync with the initial state. Set the clock
state to null on creation to avoid this.
Fixes: 188390632
Test: manual, it's a race condition that can be hard to trigger
Change-Id: I49cda9afd5c708b05aba56a40d29c1cefe847de4
| -rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java index 619bf1bb6ded..92ffb42d7921 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java @@ -64,9 +64,10 @@ public class KeyguardClockSwitch extends RelativeLayout { private float mDarkAmount; /** - * Boolean value indicating if notifications are visible on lock screen. + * Boolean value indicating if notifications are visible on lock screen. Use null to signify + * it is uninitialized. */ - private boolean mHasVisibleNotifications = true; + private Boolean mHasVisibleNotifications = null; private AnimatorSet mClockInAnim = null; private AnimatorSet mClockOutAnim = null; @@ -263,7 +264,8 @@ public class KeyguardClockSwitch extends RelativeLayout { * the smaller version. */ boolean willSwitchToLargeClock(boolean hasVisibleNotifications) { - if (hasVisibleNotifications == mHasVisibleNotifications) { + if (mHasVisibleNotifications != null + && hasVisibleNotifications == mHasVisibleNotifications) { return false; } boolean useLargeClock = !hasVisibleNotifications; |