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.
Conflicts:
hal/msm8916/platform.c
hal/msm8974/platform.c
Change-Id: I30e90f398ef204d106b5d8dac8fba166583bdbc8
diff --git a/hal/platform_info.c b/hal/platform_info.c
index 2be66c4..973d4c4 100644
--- a/hal/platform_info.c
+++ b/hal/platform_info.c
@@ -177,6 +177,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__);
@@ -196,7 +197,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 backend %s was not set!",
__func__, attr[1], attr[3]);
goto done;