diff options
author | Eric Laurent <elaurent@google.com> | 2011-11-18 16:43:31 -0800 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2012-01-17 15:15:04 -0800 |
commit | 9bc8358ddaa01c3490f9709991989633a6a3dd42 (patch) | |
tree | 12568959bb7bfd308ff2ef98c2e1ce0902ebdcd3 /include | |
parent | cc767191cfb675f744e0165608b0a4196aba2b37 (diff) | |
download | frameworks_base-9bc8358ddaa01c3490f9709991989633a6a3dd42.zip frameworks_base-9bc8358ddaa01c3490f9709991989633a6a3dd42.tar.gz frameworks_base-9bc8358ddaa01c3490f9709991989633a6a3dd42.tar.bz2 |
audio framework: manage stream volume per device
Improve volume management by keeping track of volume for each type
of device independently.
Volume for each stream (MUSIC, RINGTONE, VOICE_CALL...) is now maintained
per device.
The main changes are:
- AudioService now keeps tracks of stream volumes per device:
volume indexes are kept in a HashMap < device , index>.
active device is queried from policy manager when a volume change request
is received
initalization, mute and unmute happen on all device simultaneously
- Settings: suffixes is added to volume keys to store each device
volume independently.
- AudioSystem/AudioPolicyService/AudioPolicyInterface: added a device argument
to setStreamVolumeIndex() and getStreamVolumeIndex() to address each
device independently.
- AudioPolicyManagerBase: keep track of stream volumes for each device
and apply volume according to current device selection.
Change-Id: I61ef1c45caadca04d16363bca4140e0f81901b3f
Diffstat (limited to 'include')
-rw-r--r-- | include/media/AudioSystem.h | 8 | ||||
-rw-r--r-- | include/media/IAudioPolicyService.h | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h index e49d8f5..13beaa5 100644 --- a/include/media/AudioSystem.h +++ b/include/media/AudioSystem.h @@ -170,8 +170,12 @@ public: static status_t initStreamVolume(audio_stream_type_t stream, int indexMin, int indexMax); - static status_t setStreamVolumeIndex(audio_stream_type_t stream, int index); - static status_t getStreamVolumeIndex(audio_stream_type_t stream, int *index); + static status_t setStreamVolumeIndex(audio_stream_type_t stream, + int index, + audio_devices_t device); + static status_t getStreamVolumeIndex(audio_stream_type_t stream, + int *index, + audio_devices_t device); static uint32_t getStrategyForStream(audio_stream_type_t stream); static uint32_t getDevicesForStream(audio_stream_type_t stream); diff --git a/include/media/IAudioPolicyService.h b/include/media/IAudioPolicyService.h index 1ac0bbf..5a4d59b 100644 --- a/include/media/IAudioPolicyService.h +++ b/include/media/IAudioPolicyService.h @@ -73,8 +73,12 @@ public: virtual status_t initStreamVolume(audio_stream_type_t stream, int indexMin, int indexMax) = 0; - virtual status_t setStreamVolumeIndex(audio_stream_type_t stream, int index) = 0; - virtual status_t getStreamVolumeIndex(audio_stream_type_t stream, int *index) = 0; + virtual status_t setStreamVolumeIndex(audio_stream_type_t stream, + int index, + audio_devices_t device) = 0; + virtual status_t getStreamVolumeIndex(audio_stream_type_t stream, + int *index, + audio_devices_t device) = 0; virtual uint32_t getStrategyForStream(audio_stream_type_t stream) = 0; virtual uint32_t getDevicesForStream(audio_stream_type_t stream) = 0; virtual audio_io_handle_t getOutputForEffect(effect_descriptor_t *desc) = 0; |