OSDN Git Service

Fix issue 2589563: Able to set ringer volume to 0 outside of silent mode.
authorEric Laurent <elaurent@google.com>
Tue, 13 Apr 2010 15:31:02 +0000 (08:31 -0700)
committerEric Laurent <elaurent@google.com>
Wed, 14 Apr 2010 16:32:17 +0000 (09:32 -0700)
The problem happens only if volume down key is pressed while
already in silent or vibrate mode. In this case, AudioService accepts
changing the last audible index for ringer volume from 1 to 0.
When volume up is pressed, current ringer volume value is restored from 0
instead of 1.

The fix consists in keeping last audible index at 1 once in silent of vibrate
mode even is volume down key is pressed.

Change-Id: Id08edd12ce985c22233124545eba2c3e4b8cdc8e

media/java/android/media/AudioService.java

index 9ab02f0..3e38e53 100644 (file)
@@ -1128,6 +1128,9 @@ public class AudioService extends IAudioService.Stub {
             if (direction == AudioManager.ADJUST_RAISE) {
                 // exiting silent mode
                 newRingerMode = AudioManager.RINGER_MODE_NORMAL;
+            } else {
+                // prevent last audible index to reach 0
+                adjustVolumeIndex = false;
             }
         }