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

Commit cdc8bb12 authored by Andre Le's avatar Andre Le
Browse files

Flexiglass: Fix QSHeader scenario tests

Apply test tags to the new view so that the scenario test can retrieve
the correct battery UI when flexiglass is enabled.

Bug: 409043418
Test: QSHeaderBatteryVisible, QSHeaderAfterRotationTest
Flag: com.android.systemui.scene_container
Change-Id: I428c5eba9b3c52eac3fe52a7964a6c1b7cffb503
parent f72fe345
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -144,6 +144,8 @@ object ShadeHeader {

    object TestTags {
        const val Root = "shade_header_root"
        const val BatteryTestTag = "battery_meter_composable_view"
        const val BatteryTestTagLegacy = "battery_percentage_view"
    }

    /** Represents the background highlighting of a header icons chip. */
@@ -193,7 +195,7 @@ fun ContentScope.CollapsedShadeHeader(

    // This layout assumes it is globally positioned at (0, 0) and is the same size as the screen.
    CutoutAwareShadeHeader(
        modifier = modifier,
        modifier = modifier.sysuiResTag(ShadeHeader.TestTags.Root),
        startContent = {
            Row(
                verticalAlignment = Alignment.CenterVertically,
@@ -561,13 +563,13 @@ private fun BatteryInfo(
            showIcon = showIcon,
            showEstimate = useExpandedFormat,
            textColor = textColor,
            modifier = modifier,
            modifier = modifier.sysuiResTag(ShadeHeader.TestTags.BatteryTestTag),
        )
    } else {
        BatteryIconLegacy(
            createBatteryMeterViewController = viewModel.createBatteryMeterViewController,
            useExpandedFormat = useExpandedFormat,
            modifier = modifier,
            modifier = modifier.sysuiResTag(ShadeHeader.TestTags.BatteryTestTagLegacy),
            isHighlighted = isHighlighted,
        )
    }