Fixed car audio crash due to missing lib.

Moved the sound trigger library build info so that it included by
default but vendors can decide not to included by setting
EMULATOR_VENDOR_NO_SOUND_TRIGGER to true.

Bug: 157097833
Test: make installclean
Test: make -j60
Test: run gcar emulator
Change-Id: Ic952169ab6dae497d498b0c97f5c60c7ee37f287
diff --git a/manifest.soundtrigger.xml b/manifest.soundtrigger.xml
new file mode 100644
index 0000000..43bc76f
--- /dev/null
+++ b/manifest.soundtrigger.xml
@@ -0,0 +1,25 @@
+<!-- Copyright (C) 2020 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<manifest version="1.0" type="device" target-level="3">
+    <hal format="hidl">
+        <name>android.hardware.soundtrigger</name>
+        <transport>hwbinder</transport>
+        <version>2.2</version>
+        <interface>
+            <name>ISoundTriggerHw</name>
+            <instance>default</instance>
+        </interface>
+    </hal>
+</manifest>
\ No newline at end of file
diff --git a/manifest.xml b/manifest.xml
index 51c0be1..b54e735 100644
--- a/manifest.xml
+++ b/manifest.xml
@@ -117,14 +117,5 @@
             <instance>slot1</instance>
         </interface>
     </hal>
-    <hal format="hidl">
-        <name>android.hardware.soundtrigger</name>
-        <transport>hwbinder</transport>
-        <version>2.2</version>
-        <interface>
-            <name>ISoundTriggerHw</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
     <kernel target-level="5"/>
 </manifest>
diff --git a/vendor.mk b/vendor.mk
index 57fa76f..0a7dc2f 100644
--- a/vendor.mk
+++ b/vendor.mk
@@ -76,8 +76,7 @@
     audio.r_submix.default \
     android.hardware.audio.service \
     android.hardware.audio@6.0-impl:32 \
-    android.hardware.audio.effect@6.0-impl:32 \
-    android.hardware.soundtrigger@2.2-impl
+    android.hardware.audio.effect@6.0-impl:32
 
 PRODUCT_PACKAGES += \
     android.hardware.bluetooth@1.1-service.sim \
@@ -153,6 +152,12 @@
 DEVICE_MANIFEST_FILE += device/generic/goldfish/manifest.camera.xml
 endif
 
+ifneq ($(EMULATOR_VENDOR_NO_SOUND_TRIGGER),true)
+PRODUCT_PACKAGES += \
+    android.hardware.soundtrigger@2.2-impl
+DEVICE_MANIFEST_FILE += device/generic/goldfish/manifest.soundtrigger.xml
+endif
+
 PRODUCT_PACKAGES += \
     android.hardware.gatekeeper@1.0-service.software