Merge d373a1bb948ea5145591717cae52181c54b6e7f1 on remote branch

Change-Id: Ie86f56bf5cf3b8567d53cf24b6ee4742a9ebe5de
diff --git a/configs/kalama/audio-modules.mk b/configs/kalama/audio-modules.mk
index 73e4eef..1c11240 100644
--- a/configs/kalama/audio-modules.mk
+++ b/configs/kalama/audio-modules.mk
@@ -89,6 +89,8 @@
     AUDIO_MODULES += RB5_GEN2_DVT_acdb_cal.acdb
     AUDIO_MODULES += RB5_GEN2_DVT_workspaceFileXml.qwsp
     AUDIO_MODULES += ffv__5.0.2_0.1__eai_2.10_enpu.pmd
+    AUDIO_MODULES += AIM_acdb_cal.acdb
+    AUDIO_MODULES += AIM_workspaceFileXml.qwsp
 endif
 ifeq ($(call is-board-platform-in-list,crow),true)
     AUDIO_MODULES += audio.primary.crow
diff --git a/configs/kalama/kalama.mk b/configs/kalama/kalama.mk
index 8901a1b..1c3e9c7 100644
--- a/configs/kalama/kalama.mk
+++ b/configs/kalama/kalama.mk
@@ -129,6 +129,7 @@
     $(CONFIG_HAL_SRC_DIR)/microphone_characteristics.xml:$(TARGET_COPY_OUT_VENDOR)/etc/microphone_characteristics.xml \
     $(CONFIG_PAL_SRC_DIR)/card-defs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/card-defs.xml \
     $(CONFIG_PAL_SRC_DIR)/mixer_paths_kalama_qrd.xml:$(CONFIG_SKU_OUT_DIR)/mixer_paths_kalama_qrd.xml \
+    $(CONFIG_PAL_SRC_DIR)/mixer_paths_kalama_aim.xml:$(CONFIG_SKU_OUT_DIR)/mixer_paths_kalama_aim.xml \
     $(CONFIG_PAL_SRC_DIR)/mixer_paths_kalama_mtp.xml:$(CONFIG_SKU_OUT_DIR)/mixer_paths_kalama_mtp.xml \
     $(CONFIG_PAL_SRC_DIR)/mixer_paths_kalama_mtp_apq.xml:$(CONFIG_SKU_OUT_DIR)/mixer_paths_kalama_mtp_apq.xml \
     $(CONFIG_PAL_SRC_DIR)/mixer_paths_kalama_cdp.xml:$(CONFIG_SKU_OUT_DIR)/mixer_paths_kalama_cdp.xml \
@@ -137,6 +138,7 @@
     $(CONFIG_PAL_SRC_DIR)/mixer_paths_kalama_grd.xml:$(CONFIG_SKU_OUT_DIR)/mixer_paths_kalama_grd.xml \
     $(CONFIG_PAL_SRC_DIR)/mixer_paths_kalama_rb5_gen2_dvt.xml:$(CONFIG_SKU_OUT_DIR)/mixer_paths_kalama_rb5_gen2_dvt.xml \
     $(CONFIG_PAL_SRC_DIR)/resourcemanager_kalama_qrd.xml:$(CONFIG_SKU_OUT_DIR)/resourcemanager_kalama_qrd.xml \
+    $(CONFIG_PAL_SRC_DIR)/resourcemanager_kalama_aim.xml:$(CONFIG_SKU_OUT_DIR)/resourcemanager_kalama_aim.xml \
     $(CONFIG_PAL_SRC_DIR)/resourcemanager_kalama_mtp.xml:$(CONFIG_SKU_OUT_DIR)/resourcemanager_kalama_mtp.xml \
     $(CONFIG_PAL_SRC_DIR)/resourcemanager_kalama_mtp_apq.xml:$(CONFIG_SKU_OUT_DIR)/resourcemanager_kalama_mtp_apq.xml \
     $(CONFIG_PAL_SRC_DIR)/resourcemanager_kalama_cdp.xml:$(CONFIG_SKU_OUT_DIR)/resourcemanager_kalama_cdp.xml \
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 *)&param_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*)&param_bt_a2dp,
             sizeof(pal_param_bta2dp_t));