From 2f035f59d1e28728d38d18a7f0f7a9c6e8b0c11b Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Sun, 14 Sep 2014 12:11:52 -0700 Subject: 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 --- services/audioflinger/AudioFlinger.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'services/audioflinger/AudioFlinger.cpp') diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp index 1843722..cee7feb 100644 --- a/services/audioflinger/AudioFlinger.cpp +++ b/services/audioflinger/AudioFlinger.cpp @@ -796,9 +796,14 @@ status_t AudioFlinger::setMicMute(bool state) } AutoMutex lock(mHardwareLock); - audio_hw_device_t *dev = mPrimaryHardwareDev->hwDevice(); 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; return ret; } -- cgit v1.1