hal: Enable parsing of interface tag independent of backend_tag
- Current platform_info file parsing assumes backend tag to be present
always with hw_interface tag.
-With multiCopp changes as we have to have hw_interface entry for
all supported device, it should not be mandatory to have backend_tag.
-Decouple hw_interface from backend_tag.
Change-Id: I1c1163273d92305deac787ccecdcceb1f6943532
diff --git a/hal/platform_info.c b/hal/platform_info.c
index a63b215..6b64261 100644
--- a/hal/platform_info.c
+++ b/hal/platform_info.c
@@ -176,6 +176,7 @@
{
int index;
char *hw_interface = NULL;
+ char *backend = NULL;
if (strcmp(attr[0], "name") != 0) {
ALOGE("%s: 'name' not found, no ACDB ID set!", __func__);
@@ -190,9 +191,10 @@
}
if (strcmp(attr[2], "backend") != 0) {
- ALOGE("%s: Device %s has no backend set!",
- __func__, attr[1]);
- goto done;
+ if (strcmp(attr[2], "interface") == 0)
+ hw_interface = (char *)attr[3];
+ } else {
+ backend = (char *)attr[3];
}
if (attr[4] != NULL) {
@@ -203,7 +205,7 @@
}
}
- if (platform_set_snd_device_backend(index, attr[3], hw_interface) < 0) {
+ if (platform_set_snd_device_backend(index, backend, hw_interface) < 0) {
ALOGE("%s: Device %s backend %s was not set!",
__func__, attr[1], attr[3]);
goto done;