OSDN Git Service

Fix issue #899198 MODE_RINGER_STREAMS_AFFECTED does not restore volumes correctly
authorEric Laurent <elaurent@google.com>
Fri, 12 Jun 2009 13:09:28 +0000 (06:09 -0700)
committerEric Laurent <elaurent@google.com>
Fri, 12 Jun 2009 13:09:28 +0000 (06:09 -0700)
commit9bcf401d13d47416043a704430388abd59aef7cd
tree108eaecdc75fd1cd1a3f7d400f13a31783728934
parent78f0f8cb2efe9410127c39201e240f6d438eb53c
Fix issue #899198 MODE_RINGER_STREAMS_AFFECTED does not restore volumes correctly

The problem is that setRingerModeInt() does not handle streams not affected by ringer mode: when enabling "Alarm in silent mode" while in silent mode, setRingerModeInt is called after alarm streamis removed from ringer mode affected streams, and nothing is done.

The fix constists in also processing streams that are not affected by ringer mode and to restore last audible volume for them. It does not arm reapplying the volume for streams the are never affected by ringer mode as we don't do this very often.

The other problem noted in the bug report (ringer volume always restored to non zero value when exiting silent mode even if set to zero before) is also fixed: a new parameter is added to setIndex() and setStreamVolumeInt() to explicitely request to store the volume index as last audible instead of doing it automatically if index > 0.
media/java/android/media/AudioService.java