Merge "Copy drawable so that mutations don't affect other uses of the drawable" into main

This commit is contained in:
Treehugger Robot
2025-02-20 10:28:17 -08:00
committed by Android (Google) Code Review
@@ -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)