summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Fabian Kozynski <kozynski@google.com> 2025-02-19 06:30:34 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2025-02-19 06:30:34 -0800
commitf6296c9d7e3f27aa49873535d39fe820187177f5 (patch)
treed8c84bc02992122f4f33915b6aa0f22593706a1d
parentc9450097cf29e723a3635b434459a1e216022e09 (diff)
parentda60865dfe68335edc35045f74fc89ee171516ff (diff)
Merge "Load wifi icons in bg instead of in composable" into main
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/model/InternetTileModel.kt14
1 files changed, 9 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/model/InternetTileModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/model/InternetTileModel.kt
index d3e37119fdcb..2433d112bc69 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/model/InternetTileModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/model/InternetTileModel.kt
@@ -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,11 +50,14 @@ 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 =
if (this is Active) {