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

Commit c5e35596 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Reject start other output if bit-perfect output is active." into main

parents 3fef84e7 5461bcb4
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -2622,8 +2622,15 @@ status_t AudioPolicyManager::startSource(const sp<SwAudioOutputDescriptor>& outp
                // a volume ramp if there is no mute.
                requiresMuteCheck |= sharedDevice && isActive;

                if (needToCloseBitPerfectOutput && desc->isBitPerfect()) {
                if (desc->isBitPerfect()) {
                    if (needToCloseBitPerfectOutput) {
                        outputsToReopen.push_back(desc);
                    } else if (!desc->devices().filter(devices).isEmpty()) {
                        // There is an active bit-perfect playback on one of the targeted device,
                        // the client should be reattached to the bit-perfect thread.
                        ALOGD("%s, fails as there is bit-perfect playback active", __func__);
                        return DEAD_OBJECT;
                    }
                }
            }
        }