Merge "hal: remove libmdmdetect library dependency"
diff --git a/hal/Android.mk b/hal/Android.mk
index d6f07fa..25bf66f 100644
--- a/hal/Android.mk
+++ b/hal/Android.mk
@@ -148,8 +148,7 @@
libtinycompress \
libaudioroute \
libdl \
- libexpat \
- libmdmdetect
+ libexpat
LOCAL_C_INCLUDES += \
external/tinyalsa/include \
@@ -159,8 +158,7 @@
$(call include-path-for, audio-effects) \
$(LOCAL_PATH)/$(AUDIO_PLATFORM) \
$(LOCAL_PATH)/audio_extn \
- $(LOCAL_PATH)/voice_extn \
- $(TARGET_OUT_HEADERS)/libmdmdetect/inc
+ $(LOCAL_PATH)/voice_extn
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_LISTEN)),true)
LOCAL_CFLAGS += -DAUDIO_LISTEN_ENABLED
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index 7def48d..298089e 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -33,7 +33,6 @@
#include "audio_extn.h"
#include "voice_extn.h"
#include "sound/compress_params.h"
-#include "mdm_detect.h"
#define MIXER_XML_PATH "/system/etc/mixer_paths.xml"
#define MIXER_XML_PATH_AUXPCM "/system/etc/mixer_paths_auxpcm.xml"
@@ -647,26 +646,6 @@
}
}
-static void platform_csd_init(struct platform_data *plat_data)
-{
- struct dev_info mdm_detect_info;
- int ret = 0;
-
- /* Call ESOC API to get the number of modems.
- * If the number of modems is not zero, load CSD Client specific
- * symbols. Voice call is handled by MDM and apps processor talks to
- * MDM through CSD Client
- */
- ret = get_system_info(&mdm_detect_info);
- if (ret > 0) {
- ALOGE("%s: Failed to get system info, ret %d", __func__, ret);
- }
- ALOGD("%s: num_modems %d\n", __func__, mdm_detect_info.num_modems);
-
- if (mdm_detect_info.num_modems > 0)
- plat_data->csd = open_csd_client(plat_data->is_i2s_ext_modem);
-}
-
static bool platform_is_i2s_ext_modem(const char *snd_card_name,
struct platform_data *plat_data)
{
@@ -709,6 +688,8 @@
void *platform_init(struct audio_device *adev)
{
+ char platform[PROPERTY_VALUE_MAX];
+ char baseband[PROPERTY_VALUE_MAX];
char value[PROPERTY_VALUE_MAX];
struct platform_data *my_data = NULL;
int retry_num = 0, snd_card_num = 0;
@@ -875,8 +856,18 @@
else
platform_info_init(PLATFORM_INFO_XML_PATH);
- /* load csd client */
- platform_csd_init(my_data);
+ /* If platform is apq8084 and baseband is MDM, load CSD Client specific
+ * symbols. Voice call is handled by MDM and apps processor talks to
+ * MDM through CSD Client
+ */
+ property_get("ro.board.platform", platform, "");
+ property_get("ro.baseband", baseband, "");
+ if (!strncmp("apq8084", platform, sizeof("apq8084")) &&
+ !strncmp("mdm", baseband, (sizeof("mdm")-1))) {
+ my_data->csd = open_csd_client(my_data->is_i2s_ext_modem);
+ } else {
+ my_data->csd = NULL;
+ }
/* init usb */
audio_extn_usb_init(adev);