From a4123803d0a0e9e0c69faa4207d357cc74a65d58 Mon Sep 17 00:00:00 2001 From: Steve Kondik Date: Wed, 6 Apr 2016 18:35:02 -0700 Subject: audiopolicy: Be a little smarter with auto-attach * The edge cases, ZOMG! * Instead of relying on effects to be automatically attached, let's just always notify userspace and send a bit more information. This lets the application decide if effects should be attached rather than relying on a hard-coded configuration file. * Perform the setup in getOutputForAttr, but do it on the command thread so we don't block the client. OPO-593 Change-Id: I3900b349f2e895d51fa3a3dcc2de0c4bdf6dbc08 --- include/media/AudioSystem.h | 10 +++++++--- include/media/IAudioPolicyServiceClient.h | 6 ++++-- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h index 35b06ba..be1d114 100644 --- a/include/media/AudioSystem.h +++ b/include/media/AudioSystem.h @@ -32,7 +32,9 @@ namespace android { typedef void (*audio_error_callback)(status_t err); typedef void (*dynamic_policy_callback)(int event, String8 regId, int val); typedef void (*effect_session_callback)(int event, - audio_stream_type_t stream, audio_unique_id_t sessionId, bool added); + audio_stream_type_t stream, audio_unique_id_t sessionId, + audio_output_flags_t flags, audio_channel_mask_t channelMask, + uid_t uid, bool added); class IAudioFlinger; class IAudioPolicyService; @@ -423,8 +425,10 @@ private: virtual void onAudioPatchListUpdate(); virtual void onDynamicPolicyMixStateUpdate(String8 regId, int32_t state); virtual void onOutputSessionEffectsUpdate(audio_stream_type_t stream, - audio_unique_id_t sessionId, - bool added); + audio_session_t sessionId, + audio_output_flags_t flags, + audio_channel_mask_t channelMask, + uid_t uid, bool added); private: Mutex mLock; diff --git a/include/media/IAudioPolicyServiceClient.h b/include/media/IAudioPolicyServiceClient.h index 3bdeb5a..18aed8d 100644 --- a/include/media/IAudioPolicyServiceClient.h +++ b/include/media/IAudioPolicyServiceClient.h @@ -39,8 +39,10 @@ public: virtual void onDynamicPolicyMixStateUpdate(String8 regId, int32_t state) = 0; // Notifies when a default effect set is attached to a session/stream virtual void onOutputSessionEffectsUpdate(audio_stream_type_t stream, - audio_unique_id_t sessionId, - bool added) = 0; + audio_session_t sessionId, + audio_output_flags_t flags, + audio_channel_mask_t channelMask, + uid_t uid, bool added) = 0; }; -- cgit v1.1