Improve dumps and logging around AnimatableClockView and KeyguardClockSwitch

Bug: 251403277
Test: Manually took a bug report
Change-Id: Ie4d11e51e7768d8ad968986c259a70d6b94e2043
This commit is contained in:
Hawkwood Glazier
2022-10-07 15:29:33 +00:00
parent 883ecccdfc
commit 941c170c1c
4 changed files with 21 additions and 1 deletions

View File

@@ -58,6 +58,7 @@ class AnimatableClockView @JvmOverloads constructor(
private var lastOnTextChanged: CharSequence? = null private var lastOnTextChanged: CharSequence? = null
private var lastInvalidate: CharSequence? = null private var lastInvalidate: CharSequence? = null
private var lastTimeZoneChange: CharSequence? = null private var lastTimeZoneChange: CharSequence? = null
private var lastAnimationCall: CharSequence? = null
private val time = Calendar.getInstance() private val time = Calendar.getInstance()
@@ -222,6 +223,7 @@ class AnimatableClockView @JvmOverloads constructor(
} }
fun animateAppearOnLockscreen() { fun animateAppearOnLockscreen() {
lastAnimationCall = "${getTimestamp()} call=animateAppearOnLockscreen"
setTextStyle( setTextStyle(
weight = dozingWeight, weight = dozingWeight,
textSize = -1f, textSize = -1f,
@@ -246,6 +248,7 @@ class AnimatableClockView @JvmOverloads constructor(
if (isAnimationEnabled && textAnimator == null) { if (isAnimationEnabled && textAnimator == null) {
return return
} }
lastAnimationCall = "${getTimestamp()} call=animateFoldAppear"
setTextStyle( setTextStyle(
weight = lockScreenWeightInternal, weight = lockScreenWeightInternal,
textSize = -1f, textSize = -1f,
@@ -272,6 +275,7 @@ class AnimatableClockView @JvmOverloads constructor(
// Skip charge animation if dozing animation is already playing. // Skip charge animation if dozing animation is already playing.
return return
} }
lastAnimationCall = "${getTimestamp()} call=animateCharge"
val startAnimPhase2 = Runnable { val startAnimPhase2 = Runnable {
setTextStyle( setTextStyle(
weight = if (isDozing()) dozingWeight else lockScreenWeight, weight = if (isDozing()) dozingWeight else lockScreenWeight,
@@ -295,6 +299,7 @@ class AnimatableClockView @JvmOverloads constructor(
} }
fun animateDoze(isDozing: Boolean, animate: Boolean) { fun animateDoze(isDozing: Boolean, animate: Boolean) {
lastAnimationCall = "${getTimestamp()} call=animateDoze"
setTextStyle( setTextStyle(
weight = if (isDozing) dozingWeight else lockScreenWeight, weight = if (isDozing) dozingWeight else lockScreenWeight,
textSize = -1f, textSize = -1f,
@@ -408,6 +413,11 @@ class AnimatableClockView @JvmOverloads constructor(
pw.println(" lastTimeZoneChange=$lastTimeZoneChange") pw.println(" lastTimeZoneChange=$lastTimeZoneChange")
pw.println(" currText=$text") pw.println(" currText=$text")
pw.println(" currTimeContextDesc=$contentDescription") 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") pw.println(" time=$time")
} }

View File

@@ -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 { companion object {
@VisibleForTesting const val DOZE_COLOR = Color.WHITE @VisibleForTesting const val DOZE_COLOR = Color.WHITE

View File

@@ -105,11 +105,14 @@ public class KeyguardClockSwitch extends RelativeLayout {
} }
// Attach small and big clock views to hierarchy. // Attach small and big clock views to hierarchy.
Log.i(TAG, "Attached new clock views to switch");
mSmallClockFrame.addView(clock.getSmallClock().getView()); mSmallClockFrame.addView(clock.getSmallClock().getView());
mLargeClockFrame.addView(clock.getLargeClock().getView()); mLargeClockFrame.addView(clock.getLargeClock().getView());
} }
private void updateClockViews(boolean useLargeClock, boolean animate) { private void updateClockViews(boolean useLargeClock, boolean animate) {
Log.i(TAG, "updateClockViews; useLargeClock=" + useLargeClock + "; animate=" + animate
+ "; mChildrenAreLaidOut=" + mChildrenAreLaidOut);
if (mClockInAnim != null) mClockInAnim.cancel(); if (mClockInAnim != null) mClockInAnim.cancel();
if (mClockOutAnim != null) mClockOutAnim.cancel(); if (mClockOutAnim != null) mClockOutAnim.cancel();
if (mStatusAreaAnim != null) mStatusAreaAnim.cancel(); if (mStatusAreaAnim != null) mStatusAreaAnim.cancel();

View File

@@ -398,6 +398,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
public void dump(@NonNull PrintWriter pw, @NonNull String[] args) { public void dump(@NonNull PrintWriter pw, @NonNull String[] args) {
pw.println("currentClockSizeLarge=" + (mCurrentClockSize == LARGE)); pw.println("currentClockSizeLarge=" + (mCurrentClockSize == LARGE));
pw.println("mCanShowDoubleLineClock=" + mCanShowDoubleLineClock); pw.println("mCanShowDoubleLineClock=" + mCanShowDoubleLineClock);
mView.dump(pw, args);
ClockController clock = getClock(); ClockController clock = getClock();
if (clock != null) { if (clock != null) {
clock.dump(pw); clock.dump(pw);