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

Commit bd9b5935 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

am: 36fc92d5

Change-Id: I0eb25c089d36a36c2546b017cee33c4c7492adc7
parents ca798860 36fc92d5
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -378,14 +378,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
@@ -729,14 +729,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