From f1c31a5d4d4f13e3249cac825f8e22c8904aaadb Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Thu, 2 Feb 2017 11:26:12 +0100 Subject: Use STREAM_RING on non-voice capable devices * That's what Google does. Change-Id: Iac88d161eb1dccbbb5c538d5e04d8d1fc43edef2 --- .../src/com/android/systemui/volume/VolumeDialog.java | 13 ++++++++++--- .../core/java/com/android/server/audio/AudioService.java | 11 +++++++---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java index 9fda531..555c2d1 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java +++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java @@ -192,8 +192,13 @@ public class VolumeDialog { } }); - addRow(AudioManager.STREAM_RING, - R.drawable.ic_volume_ringer, R.drawable.ic_volume_ringer_mute, true); + if (Util.isVoiceCapable(mContext)) { + addRow(AudioManager.STREAM_RING, + R.drawable.ic_volume_ringer, R.drawable.ic_volume_ringer_mute, true); + } else { + addRow(AudioManager.STREAM_RING, R.drawable.ic_volume_notification, + R.drawable.ic_volume_notification_mute, true); + } addRow(AudioManager.STREAM_MUSIC, R.drawable.ic_volume_media, R.drawable.ic_volume_media_mute, true); addRow(AudioManager.STREAM_ALARM, @@ -635,7 +640,9 @@ public class VolumeDialog { } } - updateNotificationRowH(); + if (Util.isVoiceCapable(mContext)) { + updateNotificationRowH(); + } if (mActiveStream != state.activeStream) { mActiveStream = state.activeStream; diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java index fe3df61..7b90c83 100644 --- a/services/core/java/com/android/server/audio/AudioService.java +++ b/services/core/java/com/android/server/audio/AudioService.java @@ -1101,10 +1101,13 @@ public class AudioService extends IAudioService.Stub { mStreamVolumeAlias[AudioSystem.STREAM_DTMF] = dtmfStreamAlias; - if (mLinkNotificationWithVolume && mVoiceCapable) { - mStreamVolumeAlias[AudioSystem.STREAM_NOTIFICATION] = AudioSystem.STREAM_RING; - } else { - mStreamVolumeAlias[AudioSystem.STREAM_NOTIFICATION] = AudioSystem.STREAM_NOTIFICATION; + if (mVoiceCapable) { + if (mLinkNotificationWithVolume) { + mStreamVolumeAlias[AudioSystem.STREAM_NOTIFICATION] = AudioSystem.STREAM_RING; + } else { + mStreamVolumeAlias[AudioSystem.STREAM_NOTIFICATION] = + AudioSystem.STREAM_NOTIFICATION; + } } if (updateVolumes) { -- cgit v1.1