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

Commit b49bf786 authored by amehfooz's avatar amehfooz
Browse files

[DesktopStatusBar] Fix legacy status icon tint

Bug: 438503097
Test: manual
Flag: com.android.systemui.status_bar_for_desktop
Change-Id: I1bf7e9d0b56d54e94b41e5e6aa1d3dac46ef51fe
parent c9223c6d
Loading
Loading
Loading
Loading
+19 −23
Original line number Diff line number Diff line
@@ -34,11 +34,11 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.layout.onLayoutRectChanged
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.dp
import com.android.settingslib.Utils
import com.android.systemui.clock.ui.composable.ClockLegacy
import com.android.systemui.clock.ui.viewmodel.AmPmStyle
import com.android.systemui.clock.ui.viewmodel.ClockViewModel
@@ -213,15 +213,6 @@ private fun QuickSettingsChip(
            }
        } else {
            val localContext = LocalContext.current
            val themedContext = ContextThemeWrapper(localContext, R.style.Theme_SystemUI)
            val foregroundColor =
                Utils.getColorAttrDefaultColor(themedContext, android.R.attr.textColorPrimary)
            val backgroundColor =
                Utils.getColorAttrDefaultColor(
                    themedContext,
                    android.R.attr.textColorPrimaryInverse,
                )

            val iconContainer =
                remember(localContext, iconManagerFactory) {
                    StatusIconContainer(
@@ -234,13 +225,17 @@ private fun QuickSettingsChip(
                    iconManagerFactory.create(iconContainer, StatusBarLocation.HOME)
                }

            WithAdaptiveTint(
                isHighlighted = viewModel.isQuickSettingsChipHighlighted,
                isDarkProvider = { bounds -> viewModel.areaDark.isDarkTheme(bounds) },
            ) { tint ->
                SystemStatusIconsLegacy(
                    statusBarIconController = statusBarIconController,
                    iconContainer = iconContainer,
                    iconManager = iconManager,
                    useExpandedFormat = true,
                foregroundColor = foregroundColor,
                backgroundColor = backgroundColor,
                    foregroundColor = tint.toArgb(),
                    backgroundColor = ChipHighlightModel.Strong.backgroundColor.toArgb(),
                    isSingleCarrier = true,
                    isMicCameraIndicationEnabled = true,
                    isPrivacyChipEnabled = true,
@@ -248,6 +243,7 @@ private fun QuickSettingsChip(
                    isLocationIndicationEnabled = true,
                )
            }
        }

        val batteryHeight =
            with(LocalDensity.current) {