Merge remote-tracking branch 'goog/qcom/release/LA.UM.9.1.R1.10.00.00.604.035' into rvc-dev am: 29d3fe29dc

Change-Id: Iebefccc8d127b576a702eb4c11bbeaa22a7aca49
diff --git a/conf_files/sm6150/c2_manifest_vendor.xml b/conf_files/sm6150/c2_manifest_vendor.xml
new file mode 100644
index 0000000..bac0865
--- /dev/null
+++ b/conf_files/sm6150/c2_manifest_vendor.xml
@@ -0,0 +1,40 @@
+<!-- Copyright (c) 2018, The Linux Foundation. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+    * Neither the name of The Linux Foundation nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<manifest version="1.0" type="device">
+    <!-- Codec2 HAl service -->
+    <hal format="hidl">
+        <name>android.hardware.media.c2</name>
+        <transport>hwbinder</transport>
+        <version>1.0</version>
+        <interface>
+            <name>IComponentStore</name>
+            <instance>default</instance>
+            <instance>software</instance>
+        </interface>
+   </hal>
+</manifest>
diff --git a/conf_files/sm6150/codec2.vendor.ext.policy b/conf_files/sm6150/codec2.vendor.ext.policy
index df836de..07b7bf7 100644
--- a/conf_files/sm6150/codec2.vendor.ext.policy
+++ b/conf_files/sm6150/codec2.vendor.ext.policy
@@ -1,30 +1,3 @@
-# Copyright (c) 2019, The Linux Foundation. All rights reserved.
-
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#     * Redistributions of source code must retain the above copyright
-#       notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-#       copyright notice, this list of conditions and the following
-#       disclaimer in the documentation and/or other materials provided
-#       with the distribution.
-#     * Neither the name of The Linux Foundation nor the names of its
-#       contributors may be used to endorse or promote products derived
-#       from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-# ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
-# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
 # device specific syscalls
 pselect6: 1
 eventfd2: 1
diff --git a/conf_files/sm6150/sm6150.mk b/conf_files/sm6150/sm6150.mk
index 57f55fe..9872d92 100644
--- a/conf_files/sm6150/sm6150.mk
+++ b/conf_files/sm6150/sm6150.mk
@@ -23,7 +23,6 @@
 PRODUCT_PACKAGES += \
     libcodec2_vndk.vendor \
     libcodec2_hidl@1.0.vendor
-
 ifeq ($(TARGET_FWK_SUPPORTS_FULL_VALUEADDS),true)
   $(warning "Compiling with full value-added framework")
 else
@@ -32,18 +31,22 @@
 endif
 
 # Vendor property overrides
-
+# Enable Codec2.0 HAL for pure AOSP variants.
 ifeq ($(GENERIC_ODM_IMAGE),true)
   $(warning "Forcing codec2.0 HW for generic odm build variant")
+  DEVICE_MANIFEST_FILE += hardware/qcom/media/conf_files/sm6150/c2_manifest_vendor.xml
   #Set default ranks and rank Codec 2.0 over OMX codecs
   PRODUCT_ODM_PROPERTIES += debug.stagefright.ccodec=4
   PRODUCT_ODM_PROPERTIES += debug.stagefright.omx_default_rank=1000
+  PRODUCT_COPY_FILES += \
+      device/qcom/common/media/media_profiles.xml:$(TARGET_COPY_OUT_ODM)/etc/media_profiles_V1_0.xml
 else
   $(warning "Enabling codec2.0 SW only for non-generic odm build variant")
+  DEVICE_MANIFEST_FILE += hardware/qcom/media/conf_files/sm6150/c2_manifest.xml
   #Rank OMX SW codecs lower than OMX HW codecs
   PRODUCT_PROPERTY_OVERRIDES += debug.stagefright.omx_default_rank.sw-audio=1
   PRODUCT_PROPERTY_OVERRIDES += debug.stagefright.omx_default_rank=0
+  PRODUCT_PROPERTY_OVERRIDES += media.settings.xml=/vendor/etc/media_profiles_vendor.xml
+  PRODUCT_COPY_FILES += \
+      device/qcom/common/media/media_profiles.xml:$(TARGET_COPY_OUT_ODM)/etc/media_profiles_V1_0.xml
 endif
-
-# Enable Codec2.0 HAL for pure AOSP variants.
-DEVICE_MANIFEST_FILE += hardware/qcom/media/conf_files/$(MSMSTEPPE)/c2_manifest.xml