From 36007d262a87ec48a4db72017152302aee8db314 Mon Sep 17 00:00:00 2001 From: Muyuan Li Date: Tue, 21 Jun 2016 14:21:48 -0700 Subject: sysui: handle single master volume case. Bug: 29446492 Change-Id: Id7414b0cb28d5586f4162850cc67b07c4bee2f6a (cherry picked from commit 4715f4bb72ed888e392f501a7c1eb8a533e2b33d) --- .../com/android/systemui/volume/VolumeDialog.java | 26 +++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java index af6fec2f6274..168683bc0eb0 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java +++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java @@ -216,6 +216,9 @@ public class VolumeDialog implements TunerService.Tunable { mExpanded = false; mExpandButton = (ImageButton) mDialogView.findViewById(R.id.volume_expand_button); mExpandButton.setOnClickListener(mClickExpand); + + mExpandButton.setVisibility( + AudioSystem.isSingleVolume(mContext) ? View.GONE : View.VISIBLE); updateWindowWidthH(); updateExpandButtonH(); @@ -237,18 +240,21 @@ public class VolumeDialog implements TunerService.Tunable { }); if (mRows.isEmpty()) { - addRow(AudioManager.STREAM_RING, - R.drawable.ic_volume_ringer, R.drawable.ic_volume_ringer_mute, true); addRow(AudioManager.STREAM_MUSIC, R.drawable.ic_volume_media, R.drawable.ic_volume_media_mute, true); - addRow(AudioManager.STREAM_ALARM, - R.drawable.ic_volume_alarm, R.drawable.ic_volume_alarm_mute, false); - addRow(AudioManager.STREAM_VOICE_CALL, - R.drawable.ic_volume_voice, R.drawable.ic_volume_voice, false); - addRow(AudioManager.STREAM_BLUETOOTH_SCO, - R.drawable.ic_volume_bt_sco, R.drawable.ic_volume_bt_sco, false); - addRow(AudioManager.STREAM_SYSTEM, - R.drawable.ic_volume_system, R.drawable.ic_volume_system_mute, false); + if (!AudioSystem.isSingleVolume(mContext)) { + addRow(AudioManager.STREAM_RING, + R.drawable.ic_volume_ringer, R.drawable.ic_volume_ringer_mute, true); + + addRow(AudioManager.STREAM_ALARM, + R.drawable.ic_volume_alarm, R.drawable.ic_volume_alarm_mute, false); + addRow(AudioManager.STREAM_VOICE_CALL, + R.drawable.ic_volume_voice, R.drawable.ic_volume_voice, false); + addRow(AudioManager.STREAM_BLUETOOTH_SCO, + R.drawable.ic_volume_bt_sco, R.drawable.ic_volume_bt_sco, false); + addRow(AudioManager.STREAM_SYSTEM, + R.drawable.ic_volume_system, R.drawable.ic_volume_system_mute, false); + } } else { addExistingRows(); } -- cgit v1.2.3-59-g8ed1b