Copy drawable so that mutations don't affect other uses of the drawable

Fix: 397770855
Flag: EXEMPT - test fix
Test: OverviewTaskSelectImageTest
Change-Id: I9e0fa179ab3c7de6edf566f50459c51c6efb4377
This commit is contained in:
Uwais Ashraf
2025-02-20 08:28:28 -08:00
parent c7e545674d
commit 19381579f1
@@ -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)