audio: Add support for voice session mic mute
authorAndreas Schneider <asn@cryptomilk.org>
Mon, 6 Feb 2017 11:36:31 +0000 (12:36 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Sat, 11 Feb 2017 13:23:16 +0000 (14:23 +0100)
Change-Id: I5277736fffcb4511e4a7adb2e3e10090dcab484c

audio/audio_hw.c
audio/voice.c
audio/voice.h

index d869ae4156cf26d260b836d76deb393337b8f17f..7783ae6f93d301d2ba65c1ec22e10796f988f43e 100644 (file)
@@ -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);
index 440329df2287d7bcf0856e6187af9398d38dbe7a..01a7b96ec273562dc868962d85d67c5c28896936 100644 (file)
@@ -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) {
index 352e839aab494d02705db86d3237a10cb46caf98..10f0fef8890dfeb5d602672472769f454b0bd4df 100644 (file)
@@ -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);