From 941c170c1c4b758e36b1624f38eefbb32a09b947 Mon Sep 17 00:00:00 2001 From: Hawkwood Glazier Date: Fri, 7 Oct 2022 15:29:33 +0000 Subject: [PATCH] Improve dumps and logging around AnimatableClockView and KeyguardClockSwitch Bug: 251403277 Test: Manually took a bug report Change-Id: Ie4d11e51e7768d8ad968986c259a70d6b94e2043 --- .../systemui/shared/clocks/AnimatableClockView.kt | 10 ++++++++++ .../systemui/shared/clocks/DefaultClockController.kt | 8 +++++++- .../src/com/android/keyguard/KeyguardClockSwitch.java | 3 +++ .../keyguard/KeyguardClockSwitchController.java | 1 + 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/clocks/AnimatableClockView.kt b/packages/SystemUI/shared/src/com/android/systemui/shared/clocks/AnimatableClockView.kt index c2e74456c032f..860a5da44088e 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/clocks/AnimatableClockView.kt +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/clocks/AnimatableClockView.kt @@ -58,6 +58,7 @@ class AnimatableClockView @JvmOverloads constructor( private var lastOnTextChanged: CharSequence? = null private var lastInvalidate: CharSequence? = null private var lastTimeZoneChange: CharSequence? = null + private var lastAnimationCall: CharSequence? = null private val time = Calendar.getInstance() @@ -222,6 +223,7 @@ class AnimatableClockView @JvmOverloads constructor( } fun animateAppearOnLockscreen() { + lastAnimationCall = "${getTimestamp()} call=animateAppearOnLockscreen" setTextStyle( weight = dozingWeight, textSize = -1f, @@ -246,6 +248,7 @@ class AnimatableClockView @JvmOverloads constructor( if (isAnimationEnabled && textAnimator == null) { return } + lastAnimationCall = "${getTimestamp()} call=animateFoldAppear" setTextStyle( weight = lockScreenWeightInternal, textSize = -1f, @@ -272,6 +275,7 @@ class AnimatableClockView @JvmOverloads constructor( // Skip charge animation if dozing animation is already playing. return } + lastAnimationCall = "${getTimestamp()} call=animateCharge" val startAnimPhase2 = Runnable { setTextStyle( weight = if (isDozing()) dozingWeight else lockScreenWeight, @@ -295,6 +299,7 @@ class AnimatableClockView @JvmOverloads constructor( } fun animateDoze(isDozing: Boolean, animate: Boolean) { + lastAnimationCall = "${getTimestamp()} call=animateDoze" setTextStyle( weight = if (isDozing) dozingWeight else lockScreenWeight, textSize = -1f, @@ -408,6 +413,11 @@ class AnimatableClockView @JvmOverloads constructor( pw.println(" lastTimeZoneChange=$lastTimeZoneChange") pw.println(" currText=$text") pw.println(" currTimeContextDesc=$contentDescription") + pw.println(" lastAnimationCall=$lastAnimationCall") + pw.println(" dozingWeightInternal=$dozingWeightInternal") + pw.println(" lockScreenWeightInternal=$lockScreenWeightInternal") + pw.println(" dozingColor=$dozingColor") + pw.println(" lockScreenColor=$lockScreenColor") pw.println(" time=$time") } diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/clocks/DefaultClockController.kt b/packages/SystemUI/shared/src/com/android/systemui/shared/clocks/DefaultClockController.kt index 9b0d0502c2d08..b88795157a43e 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/clocks/DefaultClockController.kt +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/clocks/DefaultClockController.kt @@ -225,7 +225,13 @@ class DefaultClockController( } } - override fun dump(pw: PrintWriter) = clocks.forEach { it.dump(pw) } + override fun dump(pw: PrintWriter) { + pw.print("smallClock=") + smallClock.view.dump(pw) + + pw.print("largeClock=") + largeClock.view.dump(pw) + } companion object { @VisibleForTesting const val DOZE_COLOR = Color.WHITE diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java index 3feaeb1f2ac98..d03ef984d42ce 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java @@ -105,11 +105,14 @@ public class KeyguardClockSwitch extends RelativeLayout { } // Attach small and big clock views to hierarchy. + Log.i(TAG, "Attached new clock views to switch"); mSmallClockFrame.addView(clock.getSmallClock().getView()); mLargeClockFrame.addView(clock.getLargeClock().getView()); } private void updateClockViews(boolean useLargeClock, boolean animate) { + Log.i(TAG, "updateClockViews; useLargeClock=" + useLargeClock + "; animate=" + animate + + "; mChildrenAreLaidOut=" + mChildrenAreLaidOut); if (mClockInAnim != null) mClockInAnim.cancel(); if (mClockOutAnim != null) mClockOutAnim.cancel(); if (mStatusAreaAnim != null) mStatusAreaAnim.cancel(); diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java index 47bbb5747e512..b450ec35db322 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java @@ -398,6 +398,7 @@ public class KeyguardClockSwitchController extends ViewController