Merge "hal: pass is_in_call flag to suspended setparam for A2DP device"
diff --git a/hal/AudioDevice.cpp b/hal/AudioDevice.cpp
index 0283d5c..1ea826f 100644
--- a/hal/AudioDevice.cpp
+++ b/hal/AudioDevice.cpp
@@ -1798,6 +1798,7 @@
ret = str_parms_get_str(parms, "A2dpSuspended" , value, sizeof(value));
if (ret >= 0) {
+ audio_mode_t mode = AUDIO_MODE_NORMAL;
pal_param_bta2dp_t param_bt_a2dp;
if (strncmp(value, "true", 4) == 0)
@@ -1807,6 +1808,10 @@
param_bt_a2dp.dev_id = PAL_DEVICE_OUT_BLUETOOTH_A2DP;
+ if (voice_)
+ voice_->get_voice_call_state(&mode);
+ param_bt_a2dp.is_in_call = (mode != AUDIO_MODE_NORMAL);
+
AHAL_INFO("BT A2DP Suspended = %s, command received", value);
ret = pal_set_param(PAL_PARAM_ID_BT_A2DP_SUSPENDED, (void *)¶m_bt_a2dp,
sizeof(pal_param_bta2dp_t));
@@ -2007,6 +2012,7 @@
ret = str_parms_get_str(parms, "A2dpCaptureSuspend", value, sizeof(value));
if (ret >= 0) {
+ audio_mode_t mode = AUDIO_MODE_NORMAL;
pal_param_bta2dp_t param_bt_a2dp;
if (strncmp(value, "true", 4) == 0)
@@ -2016,6 +2022,10 @@
param_bt_a2dp.dev_id = PAL_DEVICE_IN_BLUETOOTH_A2DP;
+ if (voice_)
+ voice_->get_voice_call_state(&mode);
+ param_bt_a2dp.is_in_call = (mode != AUDIO_MODE_NORMAL);
+
AHAL_INFO("BT A2DP Capture Suspended = %s, command received", value);
ret = pal_set_param(PAL_PARAM_ID_BT_A2DP_CAPTURE_SUSPENDED, (void*)¶m_bt_a2dp,
sizeof(pal_param_bta2dp_t));