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

Commit 1a158b71 authored by Andy Hung's avatar Andy Hung
Browse files

AudioFlinger: Remove unnecessary AudioPolicy check in onTransactWrapper

Not needed since U, where both AudioFlinger and AudioPolicy are created in
audioserver before exposing through ServiceManager.

Test: adb shell pkill audioserver (during YouTube playback)
Bug: 306066901
Merged-In: Ib3613f3294f8247882ba31564cdcc0c735f948b6
Change-Id: Ib3613f3294f8247882ba31564cdcc0c735f948b6
parent 1381a070
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -4752,16 +4752,6 @@ status_t AudioFlinger::onTransactWrapper(TransactionCode code,
    mediautils::TimeCheck::kDefaultSecondChanceDuration,
    true /* crashOnTimeout */);

    // Make sure we connect to Audio Policy Service before calling into AudioFlinger:
    //  - AudioFlinger can call into Audio Policy Service with its global mutex held
    //  - If this is the first time Audio Policy Service is queried from inside audioserver process
    //  this will trigger Audio Policy Manager initialization.
    //  - Audio Policy Manager initialization calls into AudioFlinger which will try to lock
    //  its global mutex and a deadlock will occur.
    if (IPCThreadState::self()->getCallingPid() != getpid()) {
        AudioSystem::get_audio_policy_service();
    }

    return delegate();
}