diff options
author | Eric Laurent <elaurent@google.com> | 2014-12-01 17:52:59 -0800 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2014-12-09 15:47:30 -0800 |
commit | baac183f3808d7b68f184647a97bd381620415fe (patch) | |
tree | af81e602db02f55eb35852e3d0851499199166ed /services/audiopolicy | |
parent | 275e8e9de2e11b4b344f5a201f1f0e51fda02d9c (diff) | |
download | frameworks_av-baac183f3808d7b68f184647a97bd381620415fe.zip frameworks_av-baac183f3808d7b68f184647a97bd381620415fe.tar.gz frameworks_av-baac183f3808d7b68f184647a97bd381620415fe.tar.bz2 |
audio policy: binder calls for dynamic audio policy mixes
Add binder calls to register and unregister dynamic mixes
to AudioPolicyManager.
Bug: 16009464.
Change-Id: I4ef38166d0cfc88c984970969380d0cd6eb083ac
Diffstat (limited to 'services/audiopolicy')
-rw-r--r-- | services/audiopolicy/AudioPolicyInterface.h | 4 | ||||
-rw-r--r-- | services/audiopolicy/AudioPolicyInterfaceImpl.cpp | 16 | ||||
-rw-r--r-- | services/audiopolicy/AudioPolicyInterfaceImplLegacy.cpp | 8 | ||||
-rw-r--r-- | services/audiopolicy/AudioPolicyService.h | 3 |
4 files changed, 30 insertions, 1 deletions
diff --git a/services/audiopolicy/AudioPolicyInterface.h b/services/audiopolicy/AudioPolicyInterface.h index 5bcbca8..2826cad 100644 --- a/services/audiopolicy/AudioPolicyInterface.h +++ b/services/audiopolicy/AudioPolicyInterface.h @@ -18,6 +18,7 @@ #define ANDROID_AUDIOPOLICY_INTERFACE_H #include <media/AudioSystem.h> +#include <media/AudioPolicy.h> #include <utils/String8.h> #include <hardware/audio_policy.h> @@ -201,6 +202,9 @@ public: audio_devices_t *device) = 0; virtual status_t releaseSoundTriggerSession(audio_session_t session) = 0; + + virtual status_t registerPolicyMixes(Vector<AudioMix> mixes) = 0; + virtual status_t unregisterPolicyMixes(Vector<AudioMix> mixes) = 0; }; diff --git a/services/audiopolicy/AudioPolicyInterfaceImpl.cpp b/services/audiopolicy/AudioPolicyInterfaceImpl.cpp index abb1b21..d3c9013 100644 --- a/services/audiopolicy/AudioPolicyInterfaceImpl.cpp +++ b/services/audiopolicy/AudioPolicyInterfaceImpl.cpp @@ -614,4 +614,20 @@ status_t AudioPolicyService::releaseSoundTriggerSession(audio_session_t session) return mAudioPolicyManager->releaseSoundTriggerSession(session); } +status_t AudioPolicyService::registerPolicyMixes(Vector<AudioMix> mixes, bool registration) +{ + Mutex::Autolock _l(mLock); + if(!modifyAudioRoutingAllowed()) { + return PERMISSION_DENIED; + } + if (mAudioPolicyManager == NULL) { + return NO_INIT; + } + if (registration) { + return mAudioPolicyManager->registerPolicyMixes(mixes); + } else { + return mAudioPolicyManager->unregisterPolicyMixes(mixes); + } +} + }; // namespace android diff --git a/services/audiopolicy/AudioPolicyInterfaceImplLegacy.cpp b/services/audiopolicy/AudioPolicyInterfaceImplLegacy.cpp index 4e42b25..4bc3c7f 100644 --- a/services/audiopolicy/AudioPolicyInterfaceImplLegacy.cpp +++ b/services/audiopolicy/AudioPolicyInterfaceImplLegacy.cpp @@ -555,7 +555,7 @@ status_t AudioPolicyService::setAudioPortConfig(const struct audio_port_config * status_t AudioPolicyService::getOutputForAttr(const audio_attributes_t *attr, audio_io_handle_t *output, - audio_session_t session, + audio_session_t session __unused, audio_stream_type_t *stream, uint32_t samplingRate, audio_format_t format, @@ -590,4 +590,10 @@ status_t AudioPolicyService::releaseSoundTriggerSession(audio_session_t session return INVALID_OPERATION; } +status_t AudioPolicyService::registerPolicyMixes(Vector<AudioMix> mixes __unused, + bool registration __unused) +{ + return INVALID_OPERATION; +} + }; // namespace android diff --git a/services/audiopolicy/AudioPolicyService.h b/services/audiopolicy/AudioPolicyService.h index da17728..09375cf 100644 --- a/services/audiopolicy/AudioPolicyService.h +++ b/services/audiopolicy/AudioPolicyService.h @@ -30,6 +30,7 @@ #include <media/IAudioPolicyService.h> #include <media/ToneGenerator.h> #include <media/AudioEffect.h> +#include <media/AudioPolicy.h> #include <hardware_legacy/AudioPolicyInterface.h> #include "AudioPolicyEffects.h" #include "AudioPolicyManager.h" @@ -185,6 +186,8 @@ public: virtual audio_mode_t getPhoneState(); + virtual status_t registerPolicyMixes(Vector<AudioMix> mixes, bool registration); + status_t doStopOutput(audio_io_handle_t output, audio_stream_type_t stream, audio_session_t session); |