Merge "Fix mute icon for streams routed to bluetooth"
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
index 7b133f2..24d6c4c 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
@@ -1020,12 +1020,11 @@
row.icon.setAlpha(iconEnabled ? 1 : 0.5f);
final int iconRes =
isRingVibrate ? R.drawable.ic_volume_ringer_vibrate
- : isRingSilent || zenMuted ? row.iconMuteRes
- : ss.routedToBluetooth ?
- (ss.muted ? R.drawable.ic_volume_media_bt_mute
- : R.drawable.ic_volume_media_bt)
- : mAutomute && ss.level == 0 ? row.iconMuteRes
- : (ss.muted ? row.iconMuteRes : row.iconRes);
+ : isRingSilent || zenMuted ? row.iconMuteRes
+ : ss.routedToBluetooth
+ ? isStreamMuted(ss) ? R.drawable.ic_volume_media_bt_mute
+ : R.drawable.ic_volume_media_bt
+ : isStreamMuted(ss) ? row.iconMuteRes : row.iconRes;
row.icon.setImageResource(iconRes);
row.iconState =
iconRes == R.drawable.ic_volume_ringer_vibrate ? Events.ICON_STATE_VIBRATE
@@ -1087,6 +1086,10 @@
updateVolumeRowSliderH(row, enableSlider, vlevel);
}
+ private boolean isStreamMuted(final StreamState streamState) {
+ return (mAutomute && streamState.level == 0) || streamState.muted;
+ }
+
private void updateVolumeRowTintH(VolumeRow row, boolean isActive) {
if (isActive) {
row.slider.requestFocus();