diff options
author | Eric Laurent <elaurent@google.com> | 2011-08-17 10:19:06 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-08-17 10:19:06 -0700 |
commit | bc91ea6bfffde0dd55e6ed1a1677422da86e7462 (patch) | |
tree | bcb64087db7a624ec3f2a4366e7e4eb35f478620 /media/java | |
parent | 21fb6343ce079c23502b6969019d6b8795c47eb5 (diff) | |
parent | c11c3ae4dd5d4054e5b44a7bdfe6b203bdb69976 (diff) | |
download | frameworks_base-bc91ea6bfffde0dd55e6ed1a1677422da86e7462.zip frameworks_base-bc91ea6bfffde0dd55e6ed1a1677422da86e7462.tar.gz frameworks_base-bc91ea6bfffde0dd55e6ed1a1677422da86e7462.tar.bz2 |
Merge "Change condition to enter silent mode."
Diffstat (limited to 'media/java')
-rw-r--r-- | media/java/android/media/AudioService.java | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index ff2e66b..179b8a4 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -1552,14 +1552,17 @@ public class AudioService extends IAudioService.Stub { int newRingerMode = mRingerMode; if (mRingerMode == AudioManager.RINGER_MODE_NORMAL) { - // audible mode, at the bottom of the scale - if ((direction == AudioManager.ADJUST_LOWER && - mPrevVolDirection != AudioManager.ADJUST_LOWER) && - ((oldIndex + 5) / 10 == 0)) { - // "silent mode", but which one? - newRingerMode = System.getInt(mContentResolver, System.VIBRATE_IN_SILENT, 1) == 1 - ? AudioManager.RINGER_MODE_VIBRATE - : AudioManager.RINGER_MODE_SILENT; + if ((direction == AudioManager.ADJUST_LOWER) && ((oldIndex + 5) / 10 <= 1)) { + // enter silent mode if current index is the last audible one and not repeating a + // volume key down + if (mPrevVolDirection != AudioManager.ADJUST_LOWER) { + // "silent mode", but which one? + newRingerMode = System.getInt(mContentResolver, System.VIBRATE_IN_SILENT, 1) == 1 + ? AudioManager.RINGER_MODE_VIBRATE + : AudioManager.RINGER_MODE_SILENT; + } else { + adjustVolumeIndex = false; + } } } else { if (direction == AudioManager.ADJUST_RAISE) { |