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
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 @@
     }
 
     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;
 }