From aa79befb301bc3451a19021b3fc9e9e6a1f231e8 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Thu, 15 Jan 2015 14:33:51 -0800 Subject: fix audio patch leak. Always wait for status when executing a create audio patch command in audio policy service command thread. The returned patch handle must be passed back to audio policy manager so that the patch can be modified later. Failing to do so causes a leak of patch descriptors in audio flinger. Bug: 19032387. Change-Id: I5462d1437fac244d9c5e38f2c7b8e1a4c01d2b75 --- services/audiopolicy/AudioPolicyService.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'services/audiopolicy') diff --git a/services/audiopolicy/AudioPolicyService.cpp b/services/audiopolicy/AudioPolicyService.cpp index 8a9abc9..0955e10 100644 --- a/services/audiopolicy/AudioPolicyService.cpp +++ b/services/audiopolicy/AudioPolicyService.cpp @@ -907,8 +907,10 @@ void AudioPolicyService::AudioCommandThread::insertCommand_l(sp& c } removedCommands.clear(); - // Disable wait for status if delay is not 0 - if (delayMs != 0) { + // Disable wait for status if delay is not 0. + // Except for create audio patch command because the returned patch handle + // is needed by audio policy manager + if (delayMs != 0 && command->mCommand != CREATE_AUDIO_PATCH) { command->mWaitStatus = false; } -- cgit v1.1