soundtrigger: Add support for HAL V2.1
Use HAL V2.1 methods if this version is deployed on the device.
Initially the middleware layer requests for HAL V2.0, but if
the interface can be cast to V2.1, then new methods are used.
Made changes to avoid C-style type coercion as it was leading
to erroneous results when using V2.1 and V2.0 data structures
simultaneously.
Bug: 68823037
Test: use "ok google" and music IQ with HAL V2.0 and V2.1
Change-Id: I34924afe3cd4fb45a75fa34888e6e5c72727dbce
diff --git a/services/soundtrigger/Android.mk b/services/soundtrigger/Android.mk
index 10ee141..ca44737 100644
--- a/services/soundtrigger/Android.mk
+++ b/services/soundtrigger/Android.mk
@@ -49,11 +49,15 @@
LOCAL_SHARED_LIBRARIES += \
libhwbinder \
libhidlbase \
+ libhidlmemory \
libhidltransport \
libbase \
libaudiohal \
android.hardware.soundtrigger@2.0 \
- android.hardware.audio.common@2.0
+ android.hardware.soundtrigger@2.1 \
+ android.hardware.audio.common@2.0 \
+ android.hidl.allocator@1.0 \
+ android.hidl.memory@1.0
endif