hal: update combo device handling
If the wired headset/headphone/line devices are handled by
a different backend than speaker/earpiece devices, the combo
devices such as speaker+headphones can be split into individual
devices and enabled/disabled independently.
Bug: 21581860.
Change-Id: Icdd962a4dc1da536fe89c4de2202e7383275603d
diff --git a/hal/platform_info.c b/hal/platform_info.c
index 832c0f0..e1ff361 100644
--- a/hal/platform_info.c
+++ b/hal/platform_info.c
@@ -128,6 +128,7 @@
static void process_backend_name(const XML_Char **attr)
{
int index;
+ char *hw_interface = NULL;
if (strcmp(attr[0], "name") != 0) {
ALOGE("%s: 'name' not found, no ACDB ID set!", __func__);
@@ -147,7 +148,15 @@
goto done;
}
- if (platform_set_snd_device_backend(index, attr[3]) < 0) {
+ if (attr[4] != NULL) {
+ if (strcmp(attr[4], "interface") != 0) {
+ hw_interface = NULL;
+ } else {
+ hw_interface = (char *)attr[5];
+ }
+ }
+
+ if (platform_set_snd_device_backend(index, attr[3], hw_interface) < 0) {
ALOGE("%s: Device %s in %s, backend %s was not set!",
__func__, attr[1], PLATFORM_INFO_XML_PATH, attr[3]);
goto done;