OSDN Git Service

Fix issue 2472495: Phone cannot be set to silent mode via volume keys while Driveabou...
authorEric Laurent <elaurent@google.com>
Sat, 20 Mar 2010 03:02:21 +0000 (20:02 -0700)
committerEric Laurent <elaurent@google.com>
Mon, 22 Mar 2010 22:46:58 +0000 (15:46 -0700)
commit5b4e654d0c7de8e4d58d73e73b0d5220f19b68f7
tree19da1650f66dafc64bb49e2ef1e2d57d04bf4af6
parent38390b4592cfdceb6ed21e49e0f22af400acac26
Fix issue 2472495: Phone cannot be set to silent mode via volume keys while Driveabout is taking.

The problem is that AudioService.adjustStreamVolume() only handles the ringer mode change when the
STREAM_RING volume changes from 1 to 0 or 0 to 1. If another stream is soloed, the STREAM_RING stream
volume is forced to 0 and then never transits from 0 to 0 when volume down key is pressed.

The fix consists in considering the saved value instead of current value when ajusting or setting
the volume of a muted stream: only the saved value is adjusted too, leaving the stream muted but updating
the value that will be restored when it will be unmuted.

Also changed implementation of stream volume control by setRingerModeInt() to use stream mute feature
instead of direct volume control.

Change-Id: Id85d76450b36d61a0fe8195eb4bffe63ffbd427c
media/java/android/media/AudioService.java