OSDN Git Service

audio framework: manage stream volume per device
authorEric Laurent <elaurent@google.com>
Sat, 19 Nov 2011 00:43:31 +0000 (16:43 -0800)
committerEric Laurent <elaurent@google.com>
Tue, 17 Jan 2012 23:15:04 +0000 (15:15 -0800)
commit83844cc2f95dc279015b47fd1e18c7cb4eabe9a1
tree3e9f329efec962076a0904ce7f093a9a51bac6b1
parent263709e7be37c7040aaef385bc5c9389a9b5f514
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
include/media/AudioSystem.h
include/media/IAudioPolicyService.h
media/libmedia/AudioSystem.cpp
media/libmedia/IAudioPolicyService.cpp
services/audioflinger/AudioPolicyService.cpp
services/audioflinger/AudioPolicyService.h