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

Commit 3f220263 authored by Olivier St-Onge's avatar Olivier St-Onge Committed by Android (Google) Code Review
Browse files

Merge "Add accessibility strings for satellite icon" into main

parents 43dfcd48 2f88dd3b
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1599,6 +1599,15 @@
    <!-- Accessibility label for hotspot icon [CHAR LIMIT=NONE] -->
    <string name="accessibility_status_bar_hotspot">Hotspot</string>

    <!-- Accessibility label for no satellite connection [CHAR LIMIT=NONE] -->
    <string name="accessibility_status_bar_satellite_no_connection">Satellite, no connection</string>
    <!-- Accessibility label for poor satellite connection [CHAR LIMIT=NONE] -->
    <string name="accessibility_status_bar_satellite_poor_connection">Satellite, poor connection</string>
    <!-- Accessibility label for good satellite connection [CHAR LIMIT=NONE] -->
    <string name="accessibility_status_bar_satellite_good_connection">Satellite, good connection</string>
    <!-- Accessibility label for available satellite connection [CHAR LIMIT=NONE] -->
    <string name="accessibility_status_bar_satellite_available">Satellite, connection available</string>

    <!-- Accessibility label for managed profile icon (not shown on screen) [CHAR LIMIT=NONE] -->
    <string name="accessibility_managed_profile">Work profile</string>

+29 −4
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.statusbar.pipeline.satellite.ui.model

import com.android.systemui.common.shared.model.ContentDescription
import com.android.systemui.common.shared.model.Icon
import com.android.systemui.res.R
import com.android.systemui.statusbar.pipeline.satellite.shared.model.SatelliteConnectionState
@@ -36,7 +37,10 @@ object SatelliteIconModel {
            SatelliteConnectionState.On ->
                Icon.Resource(
                    res = R.drawable.ic_satellite_not_connected,
                    contentDescription = null,
                    contentDescription =
                        ContentDescription.Resource(
                            R.string.accessibility_status_bar_satellite_available
                        ),
                )
            SatelliteConnectionState.Connected -> fromSignalStrength(signalStrength)
        }
@@ -51,15 +55,36 @@ object SatelliteIconModel {
        // TODO(b/316634365): these need content descriptions
        when (signalStrength) {
            // No signal
            0 -> Icon.Resource(res = R.drawable.ic_satellite_connected_0, contentDescription = null)
            0 ->
                Icon.Resource(
                    res = R.drawable.ic_satellite_connected_0,
                    contentDescription =
                        ContentDescription.Resource(
                            R.string.accessibility_status_bar_satellite_no_connection
                        )
                )

            // Poor -> Moderate
            1,
            2 -> Icon.Resource(res = R.drawable.ic_satellite_connected_1, contentDescription = null)
            2 ->
                Icon.Resource(
                    res = R.drawable.ic_satellite_connected_1,
                    contentDescription =
                        ContentDescription.Resource(
                            R.string.accessibility_status_bar_satellite_poor_connection
                        )
                )

            // Good -> Great
            3,
            4 -> Icon.Resource(res = R.drawable.ic_satellite_connected_2, contentDescription = null)
            4 ->
                Icon.Resource(
                    res = R.drawable.ic_satellite_connected_2,
                    contentDescription =
                        ContentDescription.Resource(
                            R.string.accessibility_status_bar_satellite_good_connection
                        )
                )
            else -> null
        }
}