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

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

Merge "audio policy: clean up initial spatializer audio patch" into 24D1-dev

parents 2f9438b4 a70bc37c
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -6515,6 +6515,15 @@ void AudioPolicyManager::onNewAudioModulesAvailableInt(DeviceVector *newDevices)
        if ((desc->mFlags & AUDIO_OUTPUT_FLAG_SPATIALIZER) != 0
                && !isOutputOnlyAvailableRouteToSomeDevice(desc)) {
            outputsClosed.push_back(desc->mIoHandle);
            nextAudioPortGeneration();
            ssize_t index = mAudioPatches.indexOfKey(desc->getPatchHandle());
            if (index >= 0) {
                sp<AudioPatch> patchDesc = mAudioPatches.valueAt(index);
                (void) /*status_t status*/ mpClientInterface->releaseAudioPatch(
                            patchDesc->getAfHandle(), 0);
                mAudioPatches.removeItemsAt(index);
                mpClientInterface->onAudioPatchListUpdate();
            }
            desc->close();
        }
    }