diff options
author | Ricardo Garcia <rago@google.com> | 2015-02-19 10:54:52 -0800 |
---|---|---|
committer | Ricardo Garcia <rago@google.com> | 2015-02-19 15:49:36 -0800 |
commit | 3e91b5d11866599e8f33e63fb3b6c1d81ce1a1d2 (patch) | |
tree | 44923162a2e46fcd80271fb04975526081a34aac | |
parent | ea78b1497eef36b6a3ba783be20615989e87ed08 (diff) | |
download | frameworks_av-3e91b5d11866599e8f33e63fb3b6c1d81ce1a1d2.zip frameworks_av-3e91b5d11866599e8f33e63fb3b6c1d81ce1a1d2.tar.gz frameworks_av-3e91b5d11866599e8f33e63fb3b6c1d81ce1a1d2.tar.bz2 |
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
-rw-r--r-- | services/audioflinger/AudioFlinger.cpp | 14 |
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) |