diff options
author | Eric Laurent <elaurent@google.com> | 2014-11-19 19:04:52 -0800 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2014-11-20 09:15:02 -0800 |
commit | 0ebd5f95b68a3a5c9e5509f21938c9e51e74d71b (patch) | |
tree | 0a2939a70644eb37c401705c8211d65bac553743 /include/media/AudioSystem.h | |
parent | 18899808001ddaea13fa4c5277502c96351f69a5 (diff) | |
download | frameworks_av-0ebd5f95b68a3a5c9e5509f21938c9e51e74d71b.zip frameworks_av-0ebd5f95b68a3a5c9e5509f21938c9e51e74d71b.tar.gz frameworks_av-0ebd5f95b68a3a5c9e5509f21938c9e51e74d71b.tar.bz2 |
AudioSystem: fix cross deadlock
Do not hold gLockAPS when calling
AudioPolicyService::registerClient() in get_audio_policy_service().
registerClient() will need to acquire the AudioPolicyService mutex and
if at the same time a method called from AudioPolicyService
(with mutex held) calls back into AudioSystem and get_audio_policy_service()
a cross deadlock occurs.
Same preventive fix for get_audio_flinger().
Use a separate mutex for notification client list in AudioPolicyService.
This prevents deadlocking if registerClient() is called as a consequence of
AudioFlinger calling back into AudioPolicyManager while executing a method
with AudioPolicyService locked
Bug: 18403952.
Bug: 18450065.
Change-Id: Ia832e41aede8bc6c843fc615508fbdd74e0863b5
Diffstat (limited to 'include/media/AudioSystem.h')
-rw-r--r-- | include/media/AudioSystem.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h index d54eca7..1614525 100644 --- a/include/media/AudioSystem.h +++ b/include/media/AudioSystem.h @@ -90,7 +90,7 @@ public: static void setErrorCallback(audio_error_callback cb); // helper function to obtain AudioFlinger service handle - static const sp<IAudioFlinger>& get_audio_flinger(); + static const sp<IAudioFlinger> get_audio_flinger(); static float linearToLog(int volume); static int logToLinear(float volume); @@ -270,7 +270,7 @@ public: // and output configuration cache (gOutputs) static void clearAudioConfigCache(); - static const sp<IAudioPolicyService>& get_audio_policy_service(); + static const sp<IAudioPolicyService> get_audio_policy_service(); // helpers for android.media.AudioManager.getProperty(), see description there for meaning static uint32_t getPrimaryOutputSamplingRate(); |