From c4c541d7c6adb90014575182996fa17f234a479c Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Mon, 4 Jun 2018 17:09:41 -0700 Subject: [PATCH] Always cancel clock animation We could end up presenting the wrong state if a non-animated layout arrives while we're still animating. Bug: 109678321 Bug: 86710763 Test: manual, change active users repeatedly Change-Id: I63a73e966c5e7bcfec89e6e4d5f7fc9ce35dfa80 --- .../SystemUI/src/com/android/keyguard/KeyguardSliceView.java | 2 +- .../SystemUI/src/com/android/keyguard/KeyguardStatusView.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java index bb05caa0739c1..67bdd216b13b8 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java @@ -328,7 +328,7 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe } public boolean hasHeader() { - return mTitle.getVisibility() == VISIBLE; + return mHasHeader; } /** diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java index 976b454245020..49dba6833a3a0 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java @@ -231,9 +231,9 @@ public class KeyguardStatusView extends GridLayout implements if (view == mClockView) { float clockScale = smallClock ? mSmallClockScale : 1; Paint.Style style = smallClock ? Paint.Style.FILL_AND_STROKE : Paint.Style.FILL; + mClockView.animate().cancel(); if (shouldAnimate) { mClockView.setY(oldTop + heightOffset); - mClockView.animate().cancel(); mClockView.animate() .setInterpolator(Interpolators.FAST_OUT_SLOW_IN) .setDuration(duration) @@ -257,10 +257,10 @@ public class KeyguardStatusView extends GridLayout implements } else if (view == mClockSeparator) { boolean hasSeparator = hasHeader && !mPulsing; float alpha = hasSeparator ? 1 : 0; + mClockSeparator.animate().cancel(); if (shouldAnimate) { boolean isAwake = mDarkAmount != 0; mClockSeparator.setY(oldTop + heightOffset); - mClockSeparator.animate().cancel(); mClockSeparator.animate() .setInterpolator(Interpolators.FAST_OUT_SLOW_IN) .setDuration(duration)