audioflinger: Allow mixed use of JB A2DP HALs and ICS policy
Old policies don't address the modules by handle and expect them
all to be scanned for supported devices; new modules stopped
listing supported devices. The combination of a new A2DP with
an old policy left policy unable to find A2DP outputs, so the
new HALs couldn't be used.
So... if an old policy is in use, searching for an A2DP output,
and finds a non-primary HAL that doesn't list any device, assume
it's A2DP and use it.
Change-Id: Ie946c065b5c325afd02ba3437077f634e079b386
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index a9c9b56..e95d03b 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -237,6 +237,13 @@
if ((dev->get_supported_devices != NULL) &&
(dev->get_supported_devices(dev) & devices) == devices)
return audioHwDevice;
+#ifdef ICS_AUDIO_BLOB
+ else if (dev->get_supported_devices == NULL && i != 0 &&
+ devices == 0x80)
+ // Reasonably safe assumption: A non-primary HAL without
+ // get_supported_devices is a locally-built A2DP binary
+ return audioHwDevice;
+#endif
}
} else {
// check a match for the requested module handle