diff options
author | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2015-12-22 23:57:01 +0100 |
---|---|---|
committer | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2015-12-22 23:57:01 +0100 |
commit | 5376d9641f7784ff0c9842279e0825fab7081688 (patch) | |
tree | 6430f1570b6dd03970e9967f96223074141ec077 | |
parent | e1489e01792ffd82a9fcff5f97381ab4b4052a02 (diff) | |
download | device_samsung_i9300-5376d9641f7784ff0c9842279e0825fab7081688.zip device_samsung_i9300-5376d9641f7784ff0c9842279e0825fab7081688.tar.gz device_samsung_i9300-5376d9641f7784ff0c9842279e0825fab7081688.tar.bz2 |
SetMute function
allows to mute the mic via the audio-ril-interface
Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
-rw-r--r-- | audio-ril-interface/audio-ril-interface.c | 22 | ||||
-rwxr-xr-x | audio/ril_interface.c | 4 |
2 files changed, 24 insertions, 2 deletions
diff --git a/audio-ril-interface/audio-ril-interface.c b/audio-ril-interface/audio-ril-interface.c index 6170c63..2c0f781 100644 --- a/audio-ril-interface/audio-ril-interface.c +++ b/audio-ril-interface/audio-ril-interface.c @@ -172,6 +172,28 @@ int SetCallAudioPath(void *data, enum ril_audio_path path) return RIL_CLIENT_ERR_SUCCESS; } +int SetMute(void *data, enum ril_mic_mute mute) +{ + struct srs_client *client; + struct srs_snd_mic_mute_data mic_mute_state; + int rc; + + ALOGD("%s(%p, %d)", __func__, data, mute); + + if (data == NULL) + return RIL_CLIENT_ERR_INVAL; + + client = (struct srs_client *) data; + + mic_mute_state.mute = mute; + + rc = srs_client_send(client, SRS_SND_SET_MIC_MUTE, &mic_mute_state, sizeof(mic_mute_state)); + if (rc < 0) + return RIL_CLIENT_ERR_UNKNOWN; + + return RIL_CLIENT_ERR_SUCCESS; +} + int SetCallClockSync(void *data, enum ril_clock_state condition) { struct srs_client *client; diff --git a/audio/ril_interface.c b/audio/ril_interface.c index 78e60b2..493e438 100755 --- a/audio/ril_interface.c +++ b/audio/ril_interface.c @@ -117,8 +117,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_two_mic_control || !_ril_set_call_clock_sync || - !_ril_register_unsolicited_handler) { + !_ril_set_call_audio_path || !_ril_set_two_mic_control || !_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; |