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

Commit 6d66b371 authored by jiabin's avatar jiabin Committed by Android Build Cherrypicker Worker
Browse files

Do not include selected output in secondary output list.

Bug: 380006470
Test: repro steps in bug
Flag: EXEMPT bugfix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:6838cdade7dd8fdd410ae97234503f1d2a3df24d)
Merged-In: I629303ad5ee2e2ddf3f65edc9875e310d8048b21
Change-Id: I629303ad5ee2e2ddf3f65edc9875e310d8048b21
parent b5147053
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1492,7 +1492,8 @@ status_t AudioPolicyManager::getOutputForAttr(const audio_attributes_t *attr,
        for (auto &secondaryMix : secondaryMixes) {
            sp<SwAudioOutputDescriptor> outputDesc = secondaryMix->getOutput();
            if (outputDesc != nullptr &&
                outputDesc->mIoHandle != AUDIO_IO_HANDLE_NONE) {
                outputDesc->mIoHandle != AUDIO_IO_HANDLE_NONE &&
                outputDesc->mIoHandle != *output) {
                secondaryOutputs->push_back(outputDesc->mIoHandle);
                weakSecondaryOutputDescs.push_back(outputDesc);
            }
@@ -7432,7 +7433,8 @@ void AudioPolicyManager::checkSecondaryOutputs() {
            for (auto &secondaryMix : secondaryMixes) {
                sp<SwAudioOutputDescriptor> outputDesc = secondaryMix->getOutput();
                if (outputDesc != nullptr &&
                    outputDesc->mIoHandle != AUDIO_IO_HANDLE_NONE) {
                    outputDesc->mIoHandle != AUDIO_IO_HANDLE_NONE &&
                    outputDesc != outputDescriptor) {
                    secondaryDescs.push_back(outputDesc);
                }
            }