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

Commit fef0cf48 authored by Shunkai Yao's avatar Shunkai Yao Committed by Automerger Merge Worker
Browse files

Merge "AudioFlinger: update primaryPlaybackThread_l() getter" into main am: fb33d064

parents defa9989 fb33d064
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -3812,7 +3812,11 @@ audio_unique_id_t AudioFlinger::nextUniqueId(audio_unique_id_use_t use)

IAfPlaybackThread* AudioFlinger::primaryPlaybackThread_l() const
{
    audio_utils::lock_guard lock(hardwareMutex());
    // The atomic ptr mPrimaryHardwareDev requires both the
    // AudioFlinger and the Hardware mutex for modification.
    // As we hold the AudioFlinger mutex, we access it
    // safely without the Hardware mutex, to avoid mutex order
    // inversion with Thread methods and the ThreadBase mutex.
    if (mPrimaryHardwareDev == nullptr) {
        return nullptr;
    }