Fix mute icon for streams routed to bluetooth

By using the same logic as when it's not routed to
bluetooth.

Fixes: 119800377
Test: volume down to mute and back when connected to BT headphones
and when not

Change-Id: I2ac4bec3ae1640677c3e854120d6eb708df9ff5c
This commit is contained in:
Julia Reynolds
2019-08-07 13:41:21 -04:00
parent 81fc2a9492
commit deb0e4bdee

View File

@@ -1020,12 +1020,11 @@ public class VolumeDialogImpl implements VolumeDialog,
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 @@ public class VolumeDialogImpl implements VolumeDialog,
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();