From 19381579f1e910f0ec3d65ba46485af7676dd3eb Mon Sep 17 00:00:00 2001 From: Uwais Ashraf Date: Thu, 20 Feb 2025 16:26:41 +0000 Subject: [PATCH] Copy drawable so that mutations don't affect other uses of the drawable Fix: 397770855 Flag: EXEMPT - test fix Test: OverviewTaskSelectImageTest Change-Id: I9e0fa179ab3c7de6edf566f50459c51c6efb4377 --- quickstep/src/com/android/quickstep/views/IconView.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/views/IconView.kt b/quickstep/src/com/android/quickstep/views/IconView.kt index 6da52d666c..cb69b22de0 100644 --- a/quickstep/src/com/android/quickstep/views/IconView.kt +++ b/quickstep/src/com/android/quickstep/views/IconView.kt @@ -78,7 +78,8 @@ class IconView : View, TaskViewIcon { override fun setDrawable(d: Drawable?) { drawable?.callback = null - drawable = d + // Copy drawable so that mutations below do not affect other users of the drawable + drawable = d?.constantState?.newDrawable()?.mutate() drawable?.let { it.callback = this setDrawableSizeInternal(width, height)