hal: Add change to dynamically load audio config file
Add change to load audio config file at runtime from
different locations
Change-Id: I38512a5ab812f76df7c817c076044124d44f555e
diff --git a/hal/acdb.c b/hal/acdb.c
index d2b2b94..f4cebec 100644
--- a/hal/acdb.c
+++ b/hal/acdb.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
* Not a Contribution.
*
* Copyright (C) 2013 The Android Open Source Project
@@ -102,7 +102,8 @@
int result = -1;
char *cvd_version = NULL;
- char platform_info_file[MIXER_PATH_MAX_LENGTH] = PLATFORM_INFO_XML_PATH;
+ char vendor_config_path[VENDOR_CONFIG_PATH_MAX_LENGTH];
+ char platform_info_file[VENDOR_CONFIG_FILE_MAX_LENGTH];
const char *snd_card_name = NULL;
struct acdb_platform_data *my_data = NULL;
@@ -118,6 +119,10 @@
}
list_init(&my_data->acdb_meta_key_list);
+ audio_get_vendor_config_path(vendor_config_path, sizeof(vendor_config_path));
+ /* Get path for platorm_info_xml_path_name in vendor */
+ snprintf(platform_info_file, sizeof(platform_info_file),
+ "%s/%s", vendor_config_path, PLATFORM_INFO_XML_PATH_NAME);
get_platform_file_for_device(mixer, platform_info_file);
/* Extract META KEY LIST INFO */
platform_info_init(platform_info_file, my_data, ACDB_EXTN);