summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Julia Reynolds <juliacr@google.com> 2019-08-07 13:41:21 -0400
committer Julia Reynolds <juliacr@google.com> 2019-08-07 17:54:46 +0000
commitdeb0e4bdeeaf47c2602c55e8e912c8a95cfc9ba2 (patch)
treed7183e4a8260bc3d3edb6c484ccefc3f66eb8657
parent81fc2a94920128ab6b7f07d2aa5ea46783f1f93b (diff)
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
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java15
1 files 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 7b133f267d49..24d6c4c54f00 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();