diff options
| author | Jean-Michel Trivi <jmtrivi@google.com> | 2009-10-29 01:47:17 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2009-10-29 01:47:17 -0700 |
| commit | 5fc26f609aaf0a878bd821e9d8df96be025fe2f8 (patch) | |
| tree | ba6987a79d4a3e0c45f02d356bbc4a115f93c1a3 /media | |
| parent | a41ff4b7c2b68aa5d651bcecfce9fc9621c145cb (diff) | |
| parent | ee507eb560319643946d73627bc7ad3e13591f2a (diff) | |
| download | frameworks_base-5fc26f609aaf0a878bd821e9d8df96be025fe2f8.zip frameworks_base-5fc26f609aaf0a878bd821e9d8df96be025fe2f8.tar.gz frameworks_base-5fc26f609aaf0a878bd821e9d8df96be025fe2f8.tar.bz2 | |
am ee507eb5: am 89889733: Merge change I4e83a76a into eclair
Merge commit 'ee507eb560319643946d73627bc7ad3e13591f2a' into eclair-mr2-plus-aosp
* commit 'ee507eb560319643946d73627bc7ad3e13591f2a':
Fix bug 2201417. Whenever the System setting that indicates
Diffstat (limited to 'media')
| -rw-r--r-- | media/java/android/media/AudioService.java | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index d90871e..58a0bba 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -959,10 +959,10 @@ public class AudioService extends IAudioService.Stub { /////////////////////////////////////////////////////////////////////////// public class VolumeStreamState { - private final String mVolumeIndexSettingName; - private final String mLastAudibleVolumeIndexSettingName; private final int mStreamType; + private String mVolumeIndexSettingName; + private String mLastAudibleVolumeIndexSettingName; private int mIndexMax; private int mIndex; private int mLastAudibleIndex; @@ -970,8 +970,7 @@ public class AudioService extends IAudioService.Stub { private VolumeStreamState(String settingName, int streamType) { - mVolumeIndexSettingName = settingName; - mLastAudibleVolumeIndexSettingName = settingName + System.APPEND_FOR_LAST_AUDIBLE; + setVolumeIndexSettingName(settingName); mStreamType = streamType; @@ -991,6 +990,11 @@ public class AudioService extends IAudioService.Stub { mDeathHandlers = new ArrayList<VolumeDeathHandler>(); } + public void setVolumeIndexSettingName(String settingName) { + mVolumeIndexSettingName = settingName; + mLastAudibleVolumeIndexSettingName = settingName + System.APPEND_FOR_LAST_AUDIBLE; + } + public boolean adjustIndex(int deltaIndex) { return setIndex(mIndex + deltaIndex * 10, true); } @@ -1370,11 +1374,17 @@ public class AudioService extends IAudioService.Stub { mNotificationsUseRingVolume = notificationsUseRingVolume; if (mNotificationsUseRingVolume == 1) { STREAM_VOLUME_ALIAS[AudioSystem.STREAM_NOTIFICATION] = AudioSystem.STREAM_RING; + mStreamStates[AudioSystem.STREAM_NOTIFICATION].setVolumeIndexSettingName( + System.VOLUME_SETTINGS[AudioSystem.STREAM_RING]); } else { STREAM_VOLUME_ALIAS[AudioSystem.STREAM_NOTIFICATION] = AudioSystem.STREAM_NOTIFICATION; + mStreamStates[AudioSystem.STREAM_NOTIFICATION].setVolumeIndexSettingName( + System.VOLUME_SETTINGS[AudioSystem.STREAM_NOTIFICATION]); // Persist notification volume volume as it was not persisted while aliased to ring volume + // and persist with no delay as there might be registered observers of the persisted + // notification volume. sendMsg(mAudioHandler, MSG_PERSIST_VOLUME, AudioSystem.STREAM_NOTIFICATION, - SENDMSG_REPLACE, 0, 0, mStreamStates[AudioSystem.STREAM_NOTIFICATION], PERSIST_DELAY); + SENDMSG_REPLACE, 0, 0, mStreamStates[AudioSystem.STREAM_NOTIFICATION], 0); } } } |
