diff options
-rw-r--r-- | media/java/android/media/AudioManager.java | 1 | ||||
-rw-r--r-- | media/java/android/media/AudioService.java | 16 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java | 8 |
3 files changed, 9 insertions, 16 deletions
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java index ac63ea6..bd50142 100644 --- a/media/java/android/media/AudioManager.java +++ b/media/java/android/media/AudioManager.java @@ -834,6 +834,7 @@ public class AudioManager { /** * Get the stream type whose volume is driving the UI sounds volume. * UI sounds are screen lock/unlock, camera shutter, key clicks... + * It is assumed that this stream type is also tied to ringer mode changes. * @hide */ public int getMasterStreamType() { diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index 17fff8c..705d9c0 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -291,14 +291,14 @@ public class AudioService extends IAudioService.Stub { }; private final int[] STREAM_VOLUME_ALIAS_DEFAULT = new int[] { AudioSystem.STREAM_VOICE_CALL, // STREAM_VOICE_CALL - AudioSystem.STREAM_MUSIC, // STREAM_SYSTEM + AudioSystem.STREAM_RING, // STREAM_SYSTEM AudioSystem.STREAM_RING, // STREAM_RING AudioSystem.STREAM_MUSIC, // STREAM_MUSIC AudioSystem.STREAM_ALARM, // STREAM_ALARM AudioSystem.STREAM_RING, // STREAM_NOTIFICATION AudioSystem.STREAM_BLUETOOTH_SCO, // STREAM_BLUETOOTH_SCO - AudioSystem.STREAM_MUSIC, // STREAM_SYSTEM_ENFORCED - AudioSystem.STREAM_MUSIC, // STREAM_DTMF + AudioSystem.STREAM_RING, // STREAM_SYSTEM_ENFORCED + AudioSystem.STREAM_RING, // STREAM_DTMF AudioSystem.STREAM_MUSIC // STREAM_TTS }; private int[] mStreamVolumeAlias; @@ -1572,15 +1572,7 @@ public class AudioService extends IAudioService.Stub { /** @see AudioManager#getMasterStreamType() */ public int getMasterStreamType() { - switch (mPlatformType) { - case PLATFORM_VOICE: - return AudioSystem.STREAM_RING; - case PLATFORM_TELEVISION: - return AudioSystem.STREAM_MUSIC; - default: - break; - } - return AudioSystem.STREAM_NOTIFICATION; + return mStreamVolumeAlias[AudioSystem.STREAM_SYSTEM]; } /** @see AudioManager#setMicrophoneMute(boolean) */ diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java b/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java index 984a5f4..d202036 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java +++ b/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java @@ -680,15 +680,15 @@ public class VolumePanel extends Handler { // never disable touch interactions for remote playback, the muting is not tied to // the state of the phone. sc.seekbarView.setEnabled(!fixedVolume); - } else if (fixedVolume || - (sc.streamType != mAudioManager.getMasterStreamType() && muted) || - (sSafetyWarning != null)) { - sc.seekbarView.setEnabled(false); } else if (isRinger && mAudioManager.getRingerMode() == AudioManager.RINGER_MODE_SILENT) { sc.seekbarView.setEnabled(false); sc.icon.setEnabled(false); sc.icon.setAlpha(mDisabledAlpha); sc.icon.setClickable(false); + } else if (fixedVolume || + (sc.streamType != mAudioManager.getMasterStreamType() && muted) || + (sSafetyWarning != null)) { + sc.seekbarView.setEnabled(false); } else { sc.seekbarView.setEnabled(true); sc.icon.setEnabled(true); |