Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1c84342e authored by Hawkwood Glazier's avatar Hawkwood Glazier Committed by Automerger Merge Worker
Browse files

Improve dumps and logging around AnimatableClockView and KeyguardClockSwitch...

Improve dumps and logging around AnimatableClockView and KeyguardClockSwitch am: 941c170c am: b5ffa862

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



Change-Id: I0c2bb042325144735f941e989c5f607e421c81c3
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents c502fe48 b5ffa862
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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")
    }

+7 −1
Original line number Diff line number Diff line
@@ -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
+3 −0
Original line number Diff line number Diff line
@@ -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();
+1 −0
Original line number Diff line number Diff line
@@ -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);