Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa79befb authored by Eric Laurent's avatar Eric Laurent
Browse files

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
parent 5f3194c9
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -907,8 +907,10 @@ void AudioPolicyService::AudioCommandThread::insertCommand_l(sp<AudioCommand>& 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;
    }