OSDN Git Service

AudioService: improve initial safe volume delay
authorEric Laurent <elaurent@google.com>
Thu, 29 Nov 2012 20:48:18 +0000 (12:48 -0800)
committerEric Laurent <elaurent@google.com>
Fri, 30 Nov 2012 01:46:05 +0000 (17:46 -0800)
commit05274f348e12983eb8613cc6eb9ae561e8197e28
tree966ea63c905560e2a08ee0d1aeda01e39f3dba41
parent89ac38bf70bb21e34c8c29b96e6316343ee46e87
AudioService: improve initial safe volume delay

AudioService relies on a valid mmc in order to enforce the headset
volume limitation or not. There is a timeout to enforce the limitation
if no mcc is configured after boot.
Until this timeout is reached or a valid SIM is detected the headset
volume is not limited.

This change makes that the last known volume limitation state (enforced or
not) is persisted so that next time we boot, last known state is applied until
a new mcc is configured if any. In most cases, the mcc does not change from one
boot to the next and we do the right thing. If teh mcc does change, the correct
policy will be enforced when the mcc is detected or after the timeout.

Also fix a bug where the volume panel was not displayed if the limitation mechanism
is triggered at the first press on VOL+ key.

Bug 7455275.

Change-Id: Id0f2996d893d38c6a14f4f9e4a0e9e3be17ef127
core/java/android/provider/Settings.java
media/java/android/media/AudioService.java