Set content description on ambien volume sliders

Added content descriptions to the UI component to improve accessibility for TalkBack users.

Flag: EXEMPT bugfix
Bug: 397134669
Test: manually test with TalkBack
Change-Id: If0c40d7b91061da5e100e49e71279adb6f69e77f
This commit is contained in:
Angela Wang
2025-02-20 10:32:42 +00:00
parent 90feafb10a
commit d16be09086
2 changed files with 13 additions and 0 deletions

View File

@@ -179,6 +179,12 @@
<string name="bluetooth_ambient_volume_control_left">Left</string>
<!-- Connected devices settings. The text to show the control is for right side device. [CHAR LIMIT=30] -->
<string name="bluetooth_ambient_volume_control_right">Right</string>
<!-- Connected devices settings. Content description for unified ambient control slider. [CHAR LIMIT=NONE] -->
<string name="bluetooth_ambient_volume_control_description">Surroundings</string>
<!-- Connected devices settings. Content description for left ambient control slider. [CHAR LIMIT=NONE] -->
<string name="bluetooth_ambient_volume_control_left_description">Left surroundings</string>
<!-- Connected devices settings. Content description for right ambient control slider.. [CHAR LIMIT=NONE] -->
<string name="bluetooth_ambient_volume_control_right_description">Right surroundings</string>
<!-- Connected devices settings. Content description for a button, that mute ambient volume [CHAR_LIMIT=NONE] -->
<string name="bluetooth_ambient_volume_mute">Mute surroundings</string>
<!-- Connected devices settings. Content description for a button, that unmute ambient volume [CHAR LIMIT=NONE] -->

View File

@@ -318,9 +318,16 @@ public class AmbientVolumePreference extends PreferenceGroup implements AmbientV
if (side == SIDE_LEFT) {
slider.setTitle(
getContext().getString(R.string.bluetooth_ambient_volume_control_left));
slider.setSliderContentDescription(getContext().getString(
R.string.bluetooth_ambient_volume_control_left_description));
} else if (side == SIDE_RIGHT) {
slider.setTitle(
getContext().getString(R.string.bluetooth_ambient_volume_control_right));
slider.setSliderContentDescription(getContext().getString(
R.string.bluetooth_ambient_volume_control_right_description));
} else {
slider.setSliderContentDescription(getContext().getString(
R.string.bluetooth_ambient_volume_control_description));
}
mSideToSliderMap.put(side, slider);
}