Improve dumps and logging around AnimatableClockView and KeyguardClockSwitch am: 941c170c1c am: b5ffa86288

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20140430

Change-Id: I0c2bb042325144735f941e989c5f607e421c81c3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Hawkwood Glazier
2022-10-11 16:07:17 +00:00
committed by Automerger Merge Worker
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 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")
}

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 {
@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.
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();

View File

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