summaryrefslogtreecommitdiffstats
path: root/media/libmedia/AudioSystem.cpp
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2011-11-18 16:43:31 -0800
committerEric Laurent <elaurent@google.com>2012-01-17 15:15:04 -0800
commit83844cc2f95dc279015b47fd1e18c7cb4eabe9a1 (patch)
tree3e9f329efec962076a0904ce7f093a9a51bac6b1 /media/libmedia/AudioSystem.cpp
parent263709e7be37c7040aaef385bc5c9389a9b5f514 (diff)
downloadframeworks_av-83844cc2f95dc279015b47fd1e18c7cb4eabe9a1.zip
frameworks_av-83844cc2f95dc279015b47fd1e18c7cb4eabe9a1.tar.gz
frameworks_av-83844cc2f95dc279015b47fd1e18c7cb4eabe9a1.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 'media/libmedia/AudioSystem.cpp')
-rw-r--r--media/libmedia/AudioSystem.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/media/libmedia/AudioSystem.cpp b/media/libmedia/AudioSystem.cpp
index 5193848..d52f8f8 100644
--- a/media/libmedia/AudioSystem.cpp
+++ b/media/libmedia/AudioSystem.cpp
@@ -668,18 +668,22 @@ status_t AudioSystem::initStreamVolume(audio_stream_type_t stream,
return aps->initStreamVolume(stream, indexMin, indexMax);
}
-status_t AudioSystem::setStreamVolumeIndex(audio_stream_type_t stream, int index)
+status_t AudioSystem::setStreamVolumeIndex(audio_stream_type_t stream,
+ int index,
+ audio_devices_t device)
{
const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service();
if (aps == 0) return PERMISSION_DENIED;
- return aps->setStreamVolumeIndex(stream, index);
+ return aps->setStreamVolumeIndex(stream, index, device);
}
-status_t AudioSystem::getStreamVolumeIndex(audio_stream_type_t stream, int *index)
+status_t AudioSystem::getStreamVolumeIndex(audio_stream_type_t stream,
+ int *index,
+ audio_devices_t device)
{
const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service();
if (aps == 0) return PERMISSION_DENIED;
- return aps->getStreamVolumeIndex(stream, index);
+ return aps->getStreamVolumeIndex(stream, index, device);
}
uint32_t AudioSystem::getStrategyForStream(audio_stream_type_t stream)