From 2a7fbee0d43ee64689054ac4280234e82d9b2830 Mon Sep 17 00:00:00 2001 From: Stefan Andonian Date: Fri, 27 May 2022 22:34:52 +0000 Subject: [PATCH] Give FloatingIconView a copy of, rather than, the original icon. Previously, if a user tapped on the clock icon then rapidly swiped back, the clock icon would stop updating. This fixes that issue by avoiding changes to the original icon's inner callback state while preparing and displaying the FloatingIconView. Bug: 188377749 Test: Locally enabled the second hand on the clock icon in addition to the minute and hour hands, then verified that it was incrementing correctly every second even after tapping then rapidly swiping back on the clock icon. Change-Id: Ib8eddb53de293194e5f9dce2fcafe8a481a6116c --- src/com/android/launcher3/views/FloatingIconView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java index babe607ca1..acdd9a19df 100644 --- a/src/com/android/launcher3/views/FloatingIconView.java +++ b/src/com/android/launcher3/views/FloatingIconView.java @@ -525,7 +525,7 @@ public class FloatingIconView extends FrameLayout implements & ItemInfoWithIcon.FLAG_SHOW_DOWNLOAD_PROGRESS_MASK) != 0) { btvIcon = btv.makePreloadIcon(); } else { - btvIcon = btv.getIcon(); + btvIcon = (FastBitmapDrawable) btv.getIcon().getConstantState().newDrawable(); } } else { btvIcon = null;