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

Commit da60865d authored by Fabián Kozynski's avatar Fabián Kozynski
Browse files

Load wifi icons in bg instead of in composable

Test: manual, perfetto trace
Bug: 389985793
Flag: com.android.systemui.qs_ui_refactor_compose_fragment
Change-Id: I25a4ca54c14991434ddb641ad8019cd84160fe56
parent b34f521a
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import com.android.systemui.common.shared.model.Text
import com.android.systemui.common.shared.model.Text.Companion.loadText
import com.android.systemui.plugins.qs.QSTile
import com.android.systemui.qs.tileimpl.QSTileImpl
import com.android.systemui.qs.tileimpl.QSTileImpl.ResourceIcon

/** Model describing the state that the QS Internet tile should be in. */
sealed interface InternetTileModel {
@@ -49,10 +50,13 @@ sealed interface InternetTileModel {
        state.contentDescription = contentDescription.loadContentDescription(context)

        // To support both SignalDrawable and other icons, give priority to icons over IDs
        if (icon != null) {
            state.icon = icon
        } else if (iconId != null) {
            state.icon = QSTileImpl.maybeLoadResourceIcon(iconId!!, context)
        state.icon =
            when {
                icon is ResourceIcon ->
                    QSTileImpl.maybeLoadResourceIcon((icon as ResourceIcon).resId, context)
                icon != null -> icon
                iconId != null -> QSTileImpl.maybeLoadResourceIcon(iconId!!, context)
                else -> null
            }

        state.state =