Improve content descriptions for volume dialog icons.
Bug: 27971063
Change-Id: I9282083f68a5cd607fe0cb2893829675559acb6d
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java
index 1d5ca04..91a8493 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java
@@ -761,7 +761,37 @@
: (iconRes == R.drawable.ic_volume_media_bt || iconRes == row.iconRes)
? Events.ICON_STATE_UNMUTE
: Events.ICON_STATE_UNKNOWN;
- row.icon.setContentDescription(ss.name);
+ if (iconEnabled) {
+ if (isRingStream) {
+ if (isRingVibrate) {
+ row.icon.setContentDescription(mContext.getString(
+ R.string.volume_stream_content_description_unmute,
+ ss.name));
+ } else {
+ if (mController.hasVibrator()) {
+ row.icon.setContentDescription(mContext.getString(
+ R.string.volume_stream_content_description_vibrate,
+ ss.name));
+ } else {
+ row.icon.setContentDescription(mContext.getString(
+ R.string.volume_stream_content_description_mute,
+ ss.name));
+ }
+ }
+ } else {
+ if (ss.muted || mAutomute && ss.level == 0) {
+ row.icon.setContentDescription(mContext.getString(
+ R.string.volume_stream_content_description_unmute,
+ ss.name));
+ } else {
+ row.icon.setContentDescription(mContext.getString(
+ R.string.volume_stream_content_description_mute,
+ ss.name));
+ }
+ }
+ } else {
+ row.icon.setContentDescription(ss.name);
+ }
// update slider
final boolean enableSlider = !zenMuted;