Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 535f5610 authored by Matías Hernández's avatar Matías Hernández
Browse files

Fix performance regression in ModesTileMapper

We were mistakenly obtaining the drawable every time icon() is called instead of once.

Change-Id: I946bdf0bbd4d519f4d14af534be8707c7c5d827c
Fixes: 361611824
Test: atest ModesTileMapperTest
Flag: EXEMPT regression bugfix
parent 920ae6e9
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -41,10 +41,11 @@ constructor(
            if (Flags.modesApi() && Flags.modesUi() && Flags.modesUiIcons() && data.icon != null) {
                icon = { data.icon }
            } else {
                val defaultIconRes =
                val iconRes =
                    if (data.isActivated) R.drawable.qs_dnd_icon_on else R.drawable.qs_dnd_icon_off
                iconRes = defaultIconRes
                icon = { resources.getDrawable(defaultIconRes, theme).asIcon() }
                val icon = resources.getDrawable(iconRes, theme).asIcon()
                this.iconRes = iconRes
                this.icon = { icon }
            }
            activationState =
                if (data.isActivated) {