summaryrefslogtreecommitdiffstats
path: root/hal/voice_extn
diff options
context:
space:
mode:
Diffstat (limited to 'hal/voice_extn')
-rw-r--r--hal/voice_extn/voice_extn.c19
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) {