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

Commit 36fc92d5 authored by Hochi Huang's avatar Hochi Huang Committed by android-build-merger
Browse files

Merge "audio policy: fix getOutputFromId and getInputFromId" am: f8d13dee

am: 4d9a25cc

Change-Id: I676995ac79a1900df5ccee86a9f36fbed70fb0b7
parents 6ff79a0d 4d9a25cc
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -313,14 +313,13 @@ bool AudioInputCollection::isSourceActive(audio_source_t source) const

sp<AudioInputDescriptor> AudioInputCollection::getInputFromId(audio_port_handle_t id) const
{
    sp<AudioInputDescriptor> inputDesc = NULL;
    for (size_t i = 0; i < size(); i++) {
        inputDesc = valueAt(i);
        if (inputDesc->getId() == id) {
            break;
        const sp<AudioInputDescriptor> inputDescriptor = valueAt(i);
        if (inputDescriptor->getId() == id) {
            return inputDescriptor;
        }
    }
    return inputDesc;
    return NULL;
}

uint32_t AudioInputCollection::activeInputsCountOnDevices(audio_devices_t devices) const
+3 −4
Original line number Diff line number Diff line
@@ -681,14 +681,13 @@ sp<SwAudioOutputDescriptor> SwAudioOutputCollection::getPrimaryOutput() const

sp<SwAudioOutputDescriptor> SwAudioOutputCollection::getOutputFromId(audio_port_handle_t id) const
{
    sp<SwAudioOutputDescriptor> outputDesc = NULL;
    for (size_t i = 0; i < size(); i++) {
        outputDesc = valueAt(i);
        const sp<SwAudioOutputDescriptor> outputDesc = valueAt(i);
        if (outputDesc->getId() == id) {
            break;
            return outputDesc;
        }
    }
    return outputDesc;
    return NULL;
}

bool SwAudioOutputCollection::isAnyOutputActive(audio_stream_type_t streamToIgnore) const