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

Commit 2f035f59 authored by Eric Laurent's avatar Eric Laurent
Browse files

audioflinger: send mic mute command to all audio HALs

Mic mute should be sent to all audio HALs, not
only the primary HAL as telephony can use
capture devices on other HALs (e.g USB)

Bug: 17321604.
Change-Id: I658f6084d5b5cdc5a70784661d5cea0b6f81c3a9
parent f0b31e63
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -796,9 +796,14 @@ status_t AudioFlinger::setMicMute(bool state)
    }
    }


    AutoMutex lock(mHardwareLock);
    AutoMutex lock(mHardwareLock);
    audio_hw_device_t *dev = mPrimaryHardwareDev->hwDevice();
    mHardwareStatus = AUDIO_HW_SET_MIC_MUTE;
    mHardwareStatus = AUDIO_HW_SET_MIC_MUTE;
    ret = dev->set_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->set_mic_mute(dev, state);
        if (result != NO_ERROR) {
            ret = result;
        }
    }
    mHardwareStatus = AUDIO_HW_IDLE;
    mHardwareStatus = AUDIO_HW_IDLE;
    return ret;
    return ret;
}
}