diff options
author | Mike Kasick <mike@kasick.org> | 2012-11-06 16:01:04 -0500 |
---|---|---|
committer | Brian Beloshapka <bbelos@hotmail.com> | 2012-12-03 19:59:25 -0500 |
commit | 9b35cd5321b4cc2110f4b8dcb20601cc92c852c2 (patch) | |
tree | b8e67eadfd1ececfb15f20edeac4c3468eaeb6dd /media | |
parent | 245b5e006874218289f16404b26a23f3ddb811dc (diff) | |
download | frameworks_base-9b35cd5321b4cc2110f4b8dcb20601cc92c852c2.zip frameworks_base-9b35cd5321b4cc2110f4b8dcb20601cc92c852c2.tar.gz frameworks_base-9b35cd5321b4cc2110f4b8dcb20601cc92c852c2.tar.bz2 |
AudioService: Don't adjust volume when vol-downing to vibrate or silent
Pressing vol-down to vibrate or silent would (previously) still adjust the
stream volume, setting the last audible volume to 0, which is not allowed
for voice-capable devices. Thus, the last audible volume would reset to
default on reboot if on vibrate/silent or the lowest volume setting.
By not adjusting volume when vol-downing to vibrate or silent on
voice-capable devices, the last audible volume is always preserved across
reboot.
Diffstat (limited to 'media')
-rw-r--r-- | media/java/android/media/AudioService.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index 9dba53a..0fde942 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -2364,11 +2364,15 @@ public class AudioService extends IAudioService.Stub implements OnFinished { // (step <= oldIndex < 2 * step) is equivalent to: (old UI index == 1) if (step <= oldIndex && oldIndex < 2 * step) { ringerMode = RINGER_MODE_VIBRATE; + if (mVoiceCapable) + adjustVolumeIndex = false; } } else { // (oldIndex < step) is equivalent to (old UI index == 0) if ((oldIndex < step) && mPrevVolDirection != AudioManager.ADJUST_LOWER) { ringerMode = RINGER_MODE_SILENT; + if (mVoiceCapable) + adjustVolumeIndex = false; } } } |