summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuK1337 <priv.luk@gmail.com>2017-02-02 11:26:12 +0100
committerrazorloves <razorloves@gmail.com>2017-02-11 23:15:42 -0600
commitf1c31a5d4d4f13e3249cac825f8e22c8904aaadb (patch)
treeb075f24722fd379e734be2fdf8549003afd718f1
parent4ba10939b7c05e4cf44d053ee8fa37a703c19e9b (diff)
downloadframeworks_base-f1c31a5d4d4f13e3249cac825f8e22c8904aaadb.zip
frameworks_base-f1c31a5d4d4f13e3249cac825f8e22c8904aaadb.tar.gz
frameworks_base-f1c31a5d4d4f13e3249cac825f8e22c8904aaadb.tar.bz2
Use STREAM_RING on non-voice capable devices
* That's what Google does. Change-Id: Iac88d161eb1dccbbb5c538d5e04d8d1fc43edef2
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java13
-rw-r--r--services/core/java/com/android/server/audio/AudioService.java11
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) {