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

Commit 0bc6456e authored by Shunkai Yao's avatar Shunkai Yao
Browse files

AudioFlinger: getEffectThread_l return with first thread

Also remove ALOG_ASSERT in getEffectThread_l as it only work with
verbose log mode.

Bug: 324983804
Test: atest CtsMediaAudioTestCases
Change-Id: I5501e12e10c3461c76833581ea880d8bbf27ce02
parent 8da94180
Loading
Loading
Loading
Loading
+10 −16
Original line number Original line Diff line number Diff line
@@ -2171,30 +2171,24 @@ sp<IAfThreadBase> AudioFlinger::getEffectThread_l(audio_session_t sessionId,
    sp<IAfThreadBase> thread;
    sp<IAfThreadBase> thread;


    for (size_t i = 0; i < mPlaybackThreads.size(); i++) {
    for (size_t i = 0; i < mPlaybackThreads.size(); i++) {
        if (mPlaybackThreads.valueAt(i)->getEffect(sessionId, effectId) != 0) {
            ALOG_ASSERT(thread == 0);
        thread = mPlaybackThreads.valueAt(i);
        thread = mPlaybackThreads.valueAt(i);
        }
        if (thread->getEffect(sessionId, effectId) != 0) {
    }
    if (thread != nullptr) {
            return thread;
            return thread;
        }
        }
    }
    for (size_t i = 0; i < mRecordThreads.size(); i++) {
    for (size_t i = 0; i < mRecordThreads.size(); i++) {
        if (mRecordThreads.valueAt(i)->getEffect(sessionId, effectId) != 0) {
            ALOG_ASSERT(thread == 0);
        thread = mRecordThreads.valueAt(i);
        thread = mRecordThreads.valueAt(i);
        }
        if (thread->getEffect(sessionId, effectId) != 0) {
    }
    if (thread != nullptr) {
            return thread;
            return thread;
        }
        }
    }
    for (size_t i = 0; i < mMmapThreads.size(); i++) {
    for (size_t i = 0; i < mMmapThreads.size(); i++) {
        if (mMmapThreads.valueAt(i)->getEffect(sessionId, effectId) != 0) {
            ALOG_ASSERT(thread == 0);
        thread = mMmapThreads.valueAt(i);
        thread = mMmapThreads.valueAt(i);
        if (thread->getEffect(sessionId, effectId) != 0) {
            return thread;
        }
        }
    }
    }
    return thread;
    return nullptr;
}
}


// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------