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

Commit 3e91b5d1 authored by Ricardo Garcia's avatar Ricardo Garcia
Browse files

Fix for getMicMute in AudioFlinger

Previous logic will only check for mic state of Primary Hardware
Device. Current logic checks state of all devices with valid
microphone input.
This is needed for audio_output feature support.

bug: 19439530
Change-Id: Ibbb92412ac70cf2915bbe8660c04fbaf0ab74171
parent ea78b149
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -826,14 +826,20 @@ bool AudioFlinger::getMicMute() const
    if (ret != NO_ERROR) {
        return false;
    }

    bool mute = true;
    bool state = AUDIO_MODE_INVALID;
    AutoMutex lock(mHardwareLock);
    audio_hw_device_t *dev = mPrimaryHardwareDev->hwDevice();
    mHardwareStatus = AUDIO_HW_GET_MIC_MUTE;
    dev->get_mic_mute(dev, &state);
    for (size_t i = 0; i < mAudioHwDevs.size(); i++) {
        audio_hw_device_t *dev = mAudioHwDevs.valueAt(i)->hwDevice();
        status_t result = dev->get_mic_mute(dev, &state);
        if (result == NO_ERROR) {
            mute = mute && state;
        }
    }
    mHardwareStatus = AUDIO_HW_IDLE;
    return state;

    return mute;
}

status_t AudioFlinger::setMasterMute(bool muted)