summaryrefslogtreecommitdiffstats
path: root/services/audioflinger
diff options
context:
space:
mode:
authorRicardo Garcia <rago@google.com>2015-02-20 00:36:25 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-02-20 00:36:26 +0000
commit0fbad3c813cdd67dcab95f998f1982b2180dc322 (patch)
tree1401cfae977d096245441ce047425e80a1db1633 /services/audioflinger
parenta52b8d1f4890f0a695cfbffda106579bcc3a16b5 (diff)
parent3e91b5d11866599e8f33e63fb3b6c1d81ce1a1d2 (diff)
downloadframeworks_av-0fbad3c813cdd67dcab95f998f1982b2180dc322.zip
frameworks_av-0fbad3c813cdd67dcab95f998f1982b2180dc322.tar.gz
frameworks_av-0fbad3c813cdd67dcab95f998f1982b2180dc322.tar.bz2
Merge "Fix for getMicMute in AudioFlinger"
Diffstat (limited to 'services/audioflinger')
-rw-r--r--services/audioflinger/AudioFlinger.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 9ad437a..f3780a9 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -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)