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

Commit ba6117ea authored by Andy Hung's avatar Andy Hung Committed by Automerger Merge Worker
Browse files

Merge "AudioFlinger: Remove unnecessary AudioPolicy check in...

Merge "AudioFlinger: Remove unnecessary AudioPolicy check in onTransactWrapper" into main am: 21261409 am: fe0f3329

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/2832879



Change-Id: I72c76b289b5714bb8e6218eed66894d02f44b367
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents d1f5d0c7 fe0f3329
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();
}