From deb0e4bdeeaf47c2602c55e8e912c8a95cfc9ba2 Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Wed, 7 Aug 2019 13:41:21 -0400 Subject: [PATCH] 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 --- .../android/systemui/volume/VolumeDialogImpl.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java index 7b133f267d49d..24d6c4c54f00b 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 @@ 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();