summaryrefslogtreecommitdiffstats
path: root/audio/audio_hw.c
diff options
context:
space:
mode:
authorMarcKe <herderkewitz@googlemail.com>2015-01-29 20:32:59 +0100
committertilaksidduram <tilaksidduram@gmail.com>2015-02-11 01:45:30 +0530
commit1c3ccd1cbf98430dc091240fe1aa494a51908980 (patch)
tree035e796b868e28ee034b171d90ad73a8de71724d /audio/audio_hw.c
parent2373d4ad07281d90a19a632e9cb652b07f8ec435 (diff)
downloaddevice_samsung_n7100-1c3ccd1cbf98430dc091240fe1aa494a51908980.zip
device_samsung_n7100-1c3ccd1cbf98430dc091240fe1aa494a51908980.tar.gz
device_samsung_n7100-1c3ccd1cbf98430dc091240fe1aa494a51908980.tar.bz2
audio: fix incall mute
Diffstat (limited to 'audio/audio_hw.c')
-rw-r--r--audio/audio_hw.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index 31aecad..5335d7d 100644
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -2603,10 +2603,52 @@ static int adev_set_mode(struct audio_hw_device *dev, audio_mode_t mode)
static int adev_set_mic_mute(struct audio_hw_device *dev, bool state)
{
+ int headset_on;
+ int headphone_on;
+ int speaker_on;
+ int earpiece_on;
+ int bt_on;
+
struct m0_audio_device *adev = (struct m0_audio_device *)dev;
+ headset_on = adev->out_device & AUDIO_DEVICE_OUT_WIRED_HEADSET;
+ headphone_on = adev->out_device & AUDIO_DEVICE_OUT_WIRED_HEADPHONE;
+ speaker_on = adev->out_device & AUDIO_DEVICE_OUT_SPEAKER;
+ earpiece_on = adev->out_device & AUDIO_DEVICE_OUT_EARPIECE;
+ bt_on = adev->out_device & AUDIO_DEVICE_OUT_ALL_SCO;
+
adev->mic_mute = state;
+ if (adev->mode == AUDIO_MODE_IN_CALL) {
+ if (state) {
+ if (speaker_on || earpiece_on || headphone_on) {
+ ALOGD("%s: set voicecall route: default_input_disable", __func__);
+ set_bigroute_by_array(adev->mixer, default_input_disable, 1);
+ }
+ if (headset_on) {
+ ALOGD("%s: set voicecall route: headset_input_disable", __func__);
+ set_bigroute_by_array(adev->mixer, headset_input_disable, 1);
+ }
+ if (bt_on) {
+ ALOGD("%s: set voicecall route: bt_input_disable", __func__);
+ set_bigroute_by_array(adev->mixer, bt_input_disable, 1);
+ }
+ } else {
+ if (speaker_on || earpiece_on || headphone_on) {
+ ALOGD("%s: set voicecall route: default_input", __func__);
+ set_bigroute_by_array(adev->mixer, default_input, 1);
+ }
+ if (headset_on) {
+ ALOGD("%s: set voicecall route: headset_input", __func__);
+ set_bigroute_by_array(adev->mixer, headset_input, 1);
+ }
+ if (bt_on) {
+ ALOGD("%s: set voicecall route: bt_input", __func__);
+ set_bigroute_by_array(adev->mixer, bt_input, 1);
+ }
+ }
+ }
+
return 0;
}