summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
Diffstat (limited to 'audio')
-rw-r--r--audio/audio_hw.c3
-rw-r--r--audio/ril_interface.c13
-rw-r--r--audio/ril_interface.h5
3 files changed, 20 insertions, 1 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index 7635c6f..58254cd 100644
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -3464,6 +3464,9 @@ static int adev_set_mic_mute(struct audio_hw_device *dev, bool state)
{
struct tuna_audio_device *adev = (struct tuna_audio_device *)dev;
+ if (adev->mode == AUDIO_MODE_IN_CALL)
+ ril_set_mic_mute(&adev->ril, state);
+
adev->mic_mute = state;
return 0;
diff --git a/audio/ril_interface.c b/audio/ril_interface.c
index 3d7ce06..0f9cb30 100644
--- a/audio/ril_interface.c
+++ b/audio/ril_interface.c
@@ -38,6 +38,7 @@ int (*_ril_set_call_volume)(void *, enum ril_sound_type, int);
int (*_ril_set_call_audio_path)(void *, enum ril_audio_path);
int (*_ril_register_unsolicited_handler)(void *, int, void *);
int (*_ril_get_wb_amr)(void *, void *);
+int (*_ril_set_mic_mute)(void *, enum ril_mic_mute);
/* Audio WB AMR callback */
void (*_audio_set_wb_amr_callback)(void *, int);
@@ -104,6 +105,7 @@ int ril_open(struct ril_handle *ril)
_ril_disconnect = dlsym(ril->handle, "Disconnect_RILD");
_ril_set_call_volume = dlsym(ril->handle, "SetCallVolume");
_ril_set_call_audio_path = dlsym(ril->handle, "SetCallAudioPath");
+ _ril_set_mic_mute = dlsym(ril->handle, "SetMute");
_ril_register_unsolicited_handler = dlsym(ril->handle,
"RegisterUnsolicitedHandler");
/* since this function is not supported in all RILs, don't require it */
@@ -111,7 +113,8 @@ int ril_open(struct ril_handle *ril)
if (!_ril_open_client || !_ril_close_client || !_ril_connect ||
!_ril_is_connected || !_ril_disconnect || !_ril_set_call_volume ||
- !_ril_set_call_audio_path || !_ril_register_unsolicited_handler) {
+ !_ril_set_call_audio_path || !_ril_register_unsolicited_handler ||
+ !_ril_set_mic_mute) {
ALOGE("Cannot get symbols from '%s'", RIL_CLIENT_LIBPATH);
dlclose(ril->handle);
return -1;
@@ -170,3 +173,11 @@ int ril_set_call_audio_path(struct ril_handle *ril, enum ril_audio_path path)
return _ril_set_call_audio_path(ril->client, path);
}
+
+int ril_set_mic_mute(struct ril_handle *ril, enum ril_mic_mute state)
+{
+ if (ril_connect_if_required(ril))
+ return 0;
+
+ return _ril_set_mic_mute(ril->client, state);
+}
diff --git a/audio/ril_interface.h b/audio/ril_interface.h
index 2ea83f8..a3da6e2 100644
--- a/audio/ril_interface.h
+++ b/audio/ril_interface.h
@@ -60,6 +60,11 @@ enum ril_clock_state {
SOUND_CLOCK_START
};
+enum ril_mic_mute {
+ MIC_UNMUTE,
+ MIC_MUTE
+};
+
/* Function prototypes */
int ril_open(struct ril_handle *ril);
int ril_close(struct ril_handle *ril);