audioflinger: refactor thread config events
Merge config events and set parameters messaging mechanism.
- setting parameters now uses the config event mechanism
- config event now allow to wait for a condition and synchronize caller
binder thread with execution thread and return an execution status.
- simplify locking mechanism to avoid unlocking the thread
mutex while processing events.
Change-Id: Ia49cb3e617abec4bacb6c1f9a8cb304c4ed3902e
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index ec32edd..bfbc46c 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -452,7 +452,11 @@
// no range check, doesn't check per-thread stream volume, AudioFlinger::mLock held
float streamVolume_l(audio_stream_type_t stream) const
{ return mStreamTypes[stream].volume; }
- void audioConfigChanged_l(int event, audio_io_handle_t ioHandle, const void *param2);
+ void audioConfigChanged_l(const DefaultKeyedVector< pid_t,sp<NotificationClient> >&
+ notificationClients,
+ int event,
+ audio_io_handle_t ioHandle,
+ const void *param2);
// Allocate an audio_io_handle_t, session ID, effect ID, or audio_module_handle_t.
// They all share the same ID space, but the namespaces are actually independent
@@ -477,7 +481,8 @@
void removeClient_l(pid_t pid);
void removeNotificationClient(pid_t pid);
-
+ DefaultKeyedVector< pid_t,sp<NotificationClient> > notificationClients() {
+ Mutex::Autolock _l(mLock); return mNotificationClients; }
bool isNonOffloadableGlobalEffectEnabled_l();
void onNonOffloadableGlobalEffectEnable();