Improve dumps and logging around AnimatableClockView and KeyguardClockSwitch am: 941c170c1c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20140430 Change-Id: Ieaf46fe484984247f84cd83e340366c06c116aa8 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user