Apply the clockIconDrawable's time in its constructor. am: e628400809 am: 8cc9b842a8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/libs/systemui/+/18673698
Change-Id: I76354253fad980d9af8ad1eb1ca22da45b947650
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/iconloaderlib/src/com/android/launcher3/icons/ClockDrawableWrapper.java b/iconloaderlib/src/com/android/launcher3/icons/ClockDrawableWrapper.java
index 176846f..d624805 100644
--- a/iconloaderlib/src/com/android/launcher3/icons/ClockDrawableWrapper.java
+++ b/iconloaderlib/src/com/android/launcher3/icons/ClockDrawableWrapper.java
@@ -389,6 +389,10 @@
mFullDrawable = (AdaptiveIconDrawable) mAnimInfo.baseDrawableState.newDrawable();
mFG = (LayerDrawable) mFullDrawable.getForeground();
+
+ // Time needs to be applied here since drawInternal is NOT guaranteed to be called
+ // before this foreground drawable is shown on the screen.
+ mAnimInfo.applyTime(mTime, mFG);
mCanvasScale = 1 - 2 * mBoundsOffset;
}
@@ -422,18 +426,6 @@
}
@Override
- public boolean setState(int[] stateSet) {
- // If the user has just pressed the clock icon, and the clock app is launching,
- // we don't want to change the time shown. Doing so can result in jank.
- for (int state: stateSet) {
- if (state == android.R.attr.state_pressed) {
- return false;
- }
- }
- return super.setState(stateSet);
- }
-
- @Override
public boolean isThemed() {
return mBgPaint.getColorFilter() != null;
}