diff options
author | Dheeraj CVR <cvr.dheeraj@gmail.com> | 2015-02-11 10:52:07 +0530 |
---|---|---|
committer | tilaksidduram <tilaksidduram@gmail.com> | 2015-02-25 10:00:57 +0530 |
commit | c7697ed05b3115d2e2c490e411fea59cd0df5717 (patch) | |
tree | 60a8d5560c4876c43a74a5cf7bcc53e3ae0f168e /audio | |
parent | 83df8d9098c290507f1e59e9c7d342327651bf71 (diff) | |
download | device_samsung_n7100-c7697ed05b3115d2e2c490e411fea59cd0df5717.zip device_samsung_n7100-c7697ed05b3115d2e2c490e411fea59cd0df5717.tar.gz device_samsung_n7100-c7697ed05b3115d2e2c490e411fea59cd0df5717.tar.bz2 |
audio: forward call mute to RIL client interface
Change-Id: Iccb763b48a687b88692c84976a7cddf72031b5be
Diffstat (limited to 'audio')
-rw-r--r-- | audio/audio_hw.c | 3 | ||||
-rw-r--r-- | audio/ril_interface.c | 14 | ||||
-rw-r--r-- | audio/ril_interface.h | 6 |
3 files changed, 21 insertions, 2 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c index d728776..d53cd94 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -2608,6 +2608,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 a77efc0..493e438 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_set_call_clock_sync)(void *, enum ril_clock_state); int (*_ril_set_two_mic_control)(void *, enum ril_two_mic_device, enum ril_two_mic_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 *); @@ -108,6 +109,7 @@ int ril_open(struct ril_handle *ril) _ril_set_call_audio_path = dlsym(ril->handle, "SetCallAudioPath"); _ril_set_call_clock_sync = dlsym(ril->handle, "SetCallClockSync"); _ril_set_two_mic_control = dlsym(ril->handle, "SetTwoMicControl"); + _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 */ @@ -115,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; @@ -191,3 +193,11 @@ int ril_set_two_mic_control(struct ril_handle *ril, enum ril_two_mic_device devi return _ril_set_two_mic_control(ril->client, device, 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 4b401aa..7d4b87e 100644 --- a/audio/ril_interface.h +++ b/audio/ril_interface.h @@ -70,6 +70,11 @@ enum ril_two_mic_state { TWO_MIC_SOLUTION_ON }; +enum ril_mic_mute { + MIC_UNMUTE, + MIC_MUTE +}; + /* Function prototypes */ int ril_open(struct ril_handle *ril); int ril_close(struct ril_handle *ril); @@ -79,5 +84,6 @@ 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_two_mic_control(struct ril_handle *ril, enum ril_two_mic_device device, enum ril_two_mic_state state); +int ril_set_mic_mute(struct ril_handle *ril, enum ril_mic_mute state); #endif |