diff options
author | Venkata Narendra Kumar Gutta <vgutta@codeaurora.org> | 2014-05-28 17:42:10 +0530 |
---|---|---|
committer | Venkata Narendra Kumar Gutta <vgutta@codeaurora.org> | 2014-05-29 15:05:25 +0530 |
commit | 5f64eea4993a2b48b9cfc49dcac2634aecf3abc4 (patch) | |
tree | ffea7a88e0b6216b1f4f924b3ebb31214a23082b /hal/voice_extn | |
parent | 5a688d0a3277c260f6c52dec690740c60cb2e2b8 (diff) | |
download | android_hardware_qcom_audio-5f64eea4993a2b48b9cfc49dcac2634aecf3abc4.tar.gz android_hardware_qcom_audio-5f64eea4993a2b48b9cfc49dcac2634aecf3abc4.tar.bz2 android_hardware_qcom_audio-5f64eea4993a2b48b9cfc49dcac2634aecf3abc4.zip |
hal: Enhance voice concurrency support for 8916
- All VoIP, compress, deep buffer, record usecases need to close
before voice call setup and don't allow these usecases during
voice call on 8916.
- setMode(IN_CALL) itself is not sufficient to know if we are
in actual voice call.
- Add keyvalue parameters support to know if we are in voice call
and policy hal can query the same and make decissions based on it.
CRs-Fixed: 662804
Change-Id: I20d660fadd07c4d227a7e3dfe356fc39806ca167
Diffstat (limited to 'hal/voice_extn')
-rw-r--r-- | hal/voice_extn/voice_extn.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/hal/voice_extn/voice_extn.c b/hal/voice_extn/voice_extn.c index d42cc536..ea25a4b1 100644 --- a/hal/voice_extn/voice_extn.c +++ b/hal/voice_extn/voice_extn.c @@ -40,6 +40,7 @@ #define AUDIO_PARAMETER_KEY_ALL_CALL_STATES "all_call_states" #define AUDIO_PARAMETER_KEY_DEVICE_MUTE "device_mute" #define AUDIO_PARAMETER_KEY_DIRECTION "direction" +#define AUDIO_PARAMETER_KEY_IN_CALL "in_call" #define VOICE_EXTN_PARAMETER_VALUE_MAX_LEN 256 @@ -505,6 +506,15 @@ int voice_extn_set_parameters(struct audio_device *adev, } } + err = str_parms_get_str(parms, AUDIO_PARAMETER_KEY_IN_CALL, str_value, + sizeof(str_value)); + if (err >= 0) { + str_parms_del(parms, AUDIO_PARAMETER_KEY_IN_CALL); + if (!strncmp("true", str_value, sizeof("true"))) { + adev->voice.is_in_call = true; + } + } + done: ALOGV("%s: exit with code(%d)", __func__, ret); free(kv_pairs); @@ -536,10 +546,19 @@ void voice_extn_get_parameters(const struct audio_device *adev, int ret; char value[VOICE_EXTN_PARAMETER_VALUE_MAX_LEN] = {0}; char *str = str_parms_to_str(query); + int val = 0; ALOGV_IF(str != NULL, "%s: enter %s", __func__, str); free(str); + ret = str_parms_get_str(query, AUDIO_PARAMETER_KEY_IN_CALL, value, + sizeof(value)); + if (ret >=0) { + if (adev->voice.is_in_call) + val = 1; + str_parms_add_int(reply, AUDIO_PARAMETER_KEY_IN_CALL, val); + } + ret = str_parms_get_str(query, AUDIO_PARAMETER_KEY_AUDIO_MODE, value, sizeof(value)); if (ret >= 0) { |