summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
diff options
context:
space:
mode:
authorBeverly <beverlyt@google.com>2021-05-14 16:03:46 -0400
committerBeverly <beverlyt@google.com>2021-05-14 16:22:18 -0400
commitf18b2894e4a4cd1f27ec1026bd13fc84c6a4b15c (patch)
treee742de09fbd0af05bd7f3a239242ca8ac43bd94c /packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
parent66dc0f32ede6e8748564aa5b261cf3ed0d284eaa (diff)
Consider the clock detached if the keyguard isn't visible
Update AnimatableClockController's definition of attached to include whether the keyguard is visible or not. This way, we won't animate if the view isn't actually visible & we'll reset the clock state when the keyguard is newly visible. Only create a new AnimatableClockController onInit instead of in the onAttach method for KeyguardClockSwitchController. Fixes: 188203771 Test: manual Change-Id: Id02132dba8b5392046cb46766aa64fd58e04a4ad
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java')
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
index 4245fbc2c3cd..932860f6c29c 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
@@ -124,16 +124,6 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
@Override
public void onInit() {
mKeyguardSliceViewController.init();
- }
-
- @Override
- protected void onViewAttached() {
- if (CUSTOM_CLOCKS_ENABLED) {
- mClockManager.addOnClockChangedListener(mClockChangedListener);
- }
- mColorExtractor.addOnColorsChangedListener(mColorsListener);
- mView.updateColors(getGradientColors());
- updateAodIcons();
mClockFrame = mView.findViewById(R.id.lockscreen_clock_view);
mLargeClockFrame = mView.findViewById(R.id.lockscreen_clock_view_large);
@@ -157,6 +147,16 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
mKeyguardUpdateMonitor,
mBypassController);
mLargeClockViewController.init();
+ }
+
+ @Override
+ protected void onViewAttached() {
+ if (CUSTOM_CLOCKS_ENABLED) {
+ mClockManager.addOnClockChangedListener(mClockChangedListener);
+ }
+ mColorExtractor.addOnColorsChangedListener(mColorsListener);
+ mView.updateColors(getGradientColors());
+ updateAodIcons();
if (mSmartspaceController.isEnabled()) {
mSmartspaceView = mSmartspaceController.buildAndConnectView(mView);