aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2017-07-14 20:51:18 +0200
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2017-07-14 20:51:18 +0200
commit16ed4da7a6d340cd2b4e43ed0dc4c64f7e4f183e (patch)
tree5f6baa0aedbc0db0ed911f1bfb032b979de9a04b
parentea93eb886b7b8c02d187331ace5bd48b69b59e0c (diff)
downloaddevice_samsung_kona-common-replicant-6.0.zip
device_samsung_kona-common-replicant-6.0.tar.gz
device_samsung_kona-common-replicant-6.0.tar.bz2
audio: forward mic mute to Audio-RIL-InterfaceHEADreplicant-6.0
adapted from n7100 audio code Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
-rwxr-xr-xaudio/audio_hw.c3
-rwxr-xr-xaudio/ril_interface.c14
-rwxr-xr-xaudio/ril_interface.h6
3 files changed, 21 insertions, 2 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index ea0903d..119e093 100755
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -2649,6 +2649,9 @@ static int adev_set_mic_mute(struct audio_hw_device *dev, bool state)
{
struct m0_audio_device *adev = (struct m0_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 89a0aef..89a114e 100755
--- a/audio/ril_interface.c
+++ b/audio/ril_interface.c
@@ -37,6 +37,7 @@ int (*_ril_disconnect)(void *);
int (*_ril_set_call_volume)(void *, enum ril_sound_type, int);
int (*_ril_set_call_audio_path)(void *, enum ril_audio_path);
int (*_ril_set_call_clock_sync)(void *, enum ril_clock_state);
+int (*_ril_set_mic_mute)(void *, enum ril_mic_mute);
int (*_ril_register_unsolicited_handler)(void *, int, void *);
int (*_ril_get_wb_amr)(void *, void *);
@@ -106,6 +107,7 @@ int ril_open(struct ril_handle *ril)
_ril_set_call_volume = dlsym(ril->handle, "SetCallVolume");
_ril_set_call_audio_path = dlsym(ril->handle, "SetCallAudioPath");
_ril_set_call_clock_sync = dlsym(ril->handle, "SetCallClockSync");
+ _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 */
@@ -113,8 +115,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_set_call_clock_sync ||
- !_ril_register_unsolicited_handler) {
+ !_ril_set_call_audio_path || !_ril_set_mic_mute ||
+ !_ril_set_call_clock_sync || !_ril_register_unsolicited_handler) {
ALOGE("Cannot get symbols from '%s'", RIL_CLIENT_LIBPATH);
dlclose(ril->handle);
return -1;
@@ -181,3 +183,11 @@ int ril_set_call_clock_sync(struct ril_handle *ril, enum ril_clock_state state)
return _ril_set_call_clock_sync(ril->client, state);
}
+
+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 76e25d8..7dadec2 100755
--- 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);
@@ -68,5 +73,6 @@ int ril_set_call_volume(struct ril_handle *ril, enum ril_sound_type sound_type,
int ril_set_call_audio_path(struct ril_handle *ril, enum ril_audio_path path);
int ril_set_call_clock_sync(struct ril_handle *ril, enum ril_clock_state state);
void ril_register_set_wb_amr_callback(void *function, void *data);
+int ril_set_mic_mute(struct ril_handle *ril, enum ril_mic_mute state);
#endif