From 107a848bc3e5667c3059b81f0f1343ee6a4e8d37 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 6 Feb 2017 12:36:31 +0100 Subject: [PATCH] audio: Add support for voice session mic mute Change-Id: I5277736fffcb4511e4a7adb2e3e10090dcab484c --- audio/audio_hw.c | 2 +- audio/voice.c | 7 +++++++ audio/voice.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/audio/audio_hw.c b/audio/audio_hw.c index d869ae4..7783ae6 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -4080,7 +4080,7 @@ static int adev_set_mic_mute(struct audio_hw_device *dev, bool state) adev->mic_mute = state; if (adev->mode == AUDIO_MODE_IN_CALL) { - /* TODO */ + set_voice_session_mic_mute(adev->voice.session, state); } pthread_mutex_unlock(&adev->lock); diff --git a/audio/voice.c b/audio/voice.c index 440329d..01a7b96 100644 --- a/audio/voice.c +++ b/audio/voice.c @@ -244,6 +244,13 @@ void set_voice_session_volume(struct voice_session *session, float volume) ril_set_call_volume(&session->ril, sound_type, volume); } +void set_voice_session_mic_mute(struct voice_session *session, bool state) +{ + enum _MuteCondition mute_condition = state ? TX_MUTE : TX_UNMUTE; + + ril_set_mute(&session->ril, mute_condition); +} + bool voice_session_uses_twomic(struct voice_session *session) { if (session->two_mic_disabled) { diff --git a/audio/voice.h b/audio/voice.h index 352e839..10f0fef 100644 --- a/audio/voice.h +++ b/audio/voice.h @@ -39,6 +39,7 @@ int start_voice_session(struct voice_session *session); void stop_voice_session(struct voice_session *session); void set_voice_session_volume(struct voice_session *session, float volume); void set_voice_session_audio_path(struct voice_session *session); +void set_voice_session_mic_mute(struct voice_session *session, bool state); bool voice_session_uses_twomic(struct voice_session *session); bool voice_session_uses_wideband(struct voice_session *session); -- 2.20.1