Snap for 8564071 from 31b3f779fe1bf7deab5ad80f0996e0e1c8f5237d to mainline-conscrypt-release

Change-Id: Ia978629cd7c7850c20b8691a30219a49b22c37f7
diff --git a/Android.bp b/Android.bp
index 64cdc29..5ecf01e 100644
--- a/Android.bp
+++ b/Android.bp
@@ -13,3 +13,7 @@
 // limitations under the License.
 
 soong_namespace {}
+
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
diff --git a/Android.mk b/Android.mk
index 6768aca..142eb37 100644
--- a/Android.mk
+++ b/Android.mk
@@ -22,6 +22,10 @@
 
 ifneq ($(filter beagle_x15%, $(TARGET_DEVICE)),)
 
+$(eval $(call declare-1p-copy-files,device/ti/beagle_x15/,.rc))
+$(eval $(call declare-1p-copy-files,device/ti/beagle_x15/,.xml))
+$(eval $(call declare-1p-copy-files,device/ti/beagle_x15/,fstab.beagle_x15board))
+
 LOCAL_PATH := $(call my-dir)
 
 # if some modules are built directly from this directory (not subdirectories),
diff --git a/METADATA b/METADATA
new file mode 100644
index 0000000..d97975c
--- /dev/null
+++ b/METADATA
@@ -0,0 +1,3 @@
+third_party {
+  license_type: NOTICE
+}
diff --git a/MODULE_LICENSE_APACHE2 b/MODULE_LICENSE_APACHE2
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/MODULE_LICENSE_APACHE2
diff --git a/MODULE_LICENSE_BSD b/MODULE_LICENSE_BSD
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/MODULE_LICENSE_BSD
diff --git a/MODULE_LICENSE_MIT b/MODULE_LICENSE_MIT
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/MODULE_LICENSE_MIT
diff --git a/auto/device.mk b/auto/device.mk
index 51b7e04..76634e7 100644
--- a/auto/device.mk
+++ b/auto/device.mk
@@ -16,7 +16,7 @@
 
 #Automotive
 PRODUCT_PACKAGES += \
-	android.hardware.automotive.vehicle@2.0-service \
+	android.hardware.automotive.vehicle@2.0-default-service \
 
 PRODUCT_COPY_FILES += \
 	frameworks/native/data/etc/android.hardware.type.automotive.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.type.automotive.xml \
diff --git a/auto/manifest.xml b/auto/manifest.xml
index 660b03d..2bfb869 100644
--- a/auto/manifest.xml
+++ b/auto/manifest.xml
@@ -1,4 +1,4 @@
-<manifest version="1.0" type="device">
+<manifest version="1.0" type="device" target-level="5">
     <hal format="hidl">
         <name>android.hardware.automotive.vehicle</name>
         <transport>hwbinder</transport>
diff --git a/bootloader/MLO b/bootloader/MLO
index 649fdba..13e2c6b 100644
--- a/bootloader/MLO
+++ b/bootloader/MLO
Binary files differ
diff --git a/bootloader/u-boot.img b/bootloader/u-boot.img
index 7123e2e..4181f1d 100644
--- a/bootloader/u-boot.img
+++ b/bootloader/u-boot.img
Binary files differ
diff --git a/build/tasks/boot_fit.mk b/build/tasks/boot_fit.mk
deleted file mode 100644
index 225e2d4..0000000
--- a/build/tasks/boot_fit.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-ifneq ($(filter beagle_x15%, $(TARGET_DEVICE)),)
-ifeq ($(TARGET_BOOTIMAGE_FIT), true)
-
-MKIMAGE := $(HOST_OUT_EXECUTABLES)/mkimage
-DTC := $(HOST_OUT_EXECUTABLES)/dtc
-BOARD_DIR := device/ti/beagle_x15
-ITS := beagle_x15.its
-BOOTIMG_FIT := $(PRODUCT_OUT)/boot_fit.img
-BOOTIMG_FIT_INSTALLED_KERNEL_TARGET := $(PRODUCT_OUT)/kernel
-BOOTIMG_FIT_INSTALLED_RAMDISK_TARGET := $(PRODUCT_OUT)/ramdisk.img
-
-$(BOOTIMG_FIT): PRIVATE_DTC_FLAGS_MKIMAGE = -I dts -O dtb -p 500 -Wno-unit_address_vs_reg
-$(BOOTIMG_FIT): PRIVATE_INTERMEDIATES := $(call intermediates-dir-for,PACKAGING,fit)
-$(BOOTIMG_FIT): PRIVATE_ITS := $(ITS)
-$(BOOTIMG_FIT): PRIVATE_MKIMAGE := $(MKIMAGE)
-$(BOOTIMG_FIT): PRIVATE_BOARD_DIR := $(BOARD_DIR)
-$(BOOTIMG_FIT): PRIVATE_INSTALLED_KERNEL_TARGET := $(BOOTIMG_FIT_INSTALLED_KERNEL_TARGET)
-$(BOOTIMG_FIT): PRIVATE_INSTALLED_RAMDISK_TARGET := $(BOOTIMG_FIT_INSTALLED_RAMDISK_TARGET)
-$(BOOTIMG_FIT): $(BOOTIMG_FIT_INSTALLED_KERNEL_TARGET) $(BOOTIMG_FIT_INSTALLED_RAMDISK_TARGET)
-$(BOOTIMG_FIT): $(BOARD_DIR)/$(ITS) $(MKIMAGE) $(DTC) $(wildcard $(DTB_DIR)/*.dtb)
-	mkdir -p $(PRIVATE_INTERMEDIATES)
-	cp $(PRIVATE_BOARD_DIR)/$(PRIVATE_ITS) $(PRIVATE_INTERMEDIATES)/
-	cp $(PRIVATE_INSTALLED_RAMDISK_TARGET) $(PRIVATE_INTERMEDIATES)/
-	cp $(PRIVATE_INSTALLED_KERNEL_TARGET) $(PRIVATE_INTERMEDIATES)/zImage
-	cp $(DTB_DIR)/*.dtb $(PRIVATE_INTERMEDIATES)/
-ifneq ($(wildcard $(DTBO_DIR)/*.dtbo),)
-	cp $(DTBO_DIR)/*.dtbo $(PRIVATE_INTERMEDIATES)/
-endif
-	PATH=$(HOST_OUT_EXECUTABLES):$$PATH $(PRIVATE_MKIMAGE) -D "$(PRIVATE_DTC_FLAGS_MKIMAGE)" -f $(PRIVATE_INTERMEDIATES)/$(PRIVATE_ITS) $@
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := bootfitimage
-LOCAL_ADDITIONAL_DEPENDENCIES := $(BOOTIMG_FIT)
-include $(BUILD_PHONY_PACKAGE)
-
-droidcore: bootfitimage
-
-endif
-endif
diff --git a/build/tasks/dtimages.mk b/build/tasks/dtimages.mk
index 19ebede..ded4e63 100644
--- a/build/tasks/dtimages.mk
+++ b/build/tasks/dtimages.mk
@@ -28,11 +28,15 @@
 
 include $(CLEAR_VARS)
 LOCAL_MODULE := dtbimage
+LOCAL_LICENSE_KINDS := legacy_notice
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_ADDITIONAL_DEPENDENCIES := $(DTBIMAGE)
 include $(BUILD_PHONY_PACKAGE)
 
 include $(CLEAR_VARS)
 LOCAL_MODULE := dtboimage
+LOCAL_LICENSE_KINDS := legacy_notice
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_ADDITIONAL_DEPENDENCIES := $(DTBOIMAGE)
 include $(BUILD_PHONY_PACKAGE)
 
diff --git a/device.mk b/device.mk
index 081e0b9..ed2122a 100644
--- a/device.mk
+++ b/device.mk
@@ -18,6 +18,7 @@
 
 # Enable updating of APEXes
 $(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk)
 
 PRODUCT_SOONG_NAMESPACES += \
 	device/ti/beagle_x15 \
@@ -26,6 +27,9 @@
 # Adjust the dalvik heap to be appropriate for a tablet.
 $(call inherit-product, frameworks/native/build/tablet-7in-xhdpi-2048-dalvik-heap.mk)
 
+PRODUCT_SHIPPING_API_LEVEL := 29
+PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS := false
+
 # Set custom settings
 DEVICE_PACKAGE_OVERLAYS := device/ti/beagle_x15/overlay
 PREBUILT_DIR := device/ti/beagle_x15-kernel
@@ -51,7 +55,7 @@
   KERNEL_MAJ := $(word 1, $(subst ., ,$(TARGET_KERNEL_USE)))
   KERNEL_MIN := $(word 2, $(subst ., ,$(TARGET_KERNEL_USE)))
 
-  LOCAL_KERNEL_HOME := $(PREBUILT_DIR)/$(TARGET_KERNEL_USE)
+  LOCAL_KERNEL_HOME ?= $(PREBUILT_DIR)/$(TARGET_KERNEL_USE)
   LOCAL_KERNEL := $(LOCAL_KERNEL_HOME)/zImage
   DTB_DIR := $(LOCAL_KERNEL_HOME)
   DTBO_DIR := $(DTB_DIR)
@@ -89,6 +93,10 @@
 PRODUCT_PROPERTY_OVERRIDES += ro.hardware.hwcomposer=drm_imagination
 endif
 
+# Software Gatekeeper HAL
+PRODUCT_PACKAGES += \
+	android.hardware.gatekeeper@1.0-service.software \
+
 #Health
 PRODUCT_PACKAGES += \
 	android.hardware.health@2.1-impl \
@@ -103,10 +111,9 @@
 
 # Audio
 PRODUCT_PACKAGES += \
-	android.hardware.audio@2.0-impl \
-	android.hardware.audio@2.0-service \
-	android.hardware.audio.effect@2.0-impl \
-	android.hardware.audio.effect@2.0-service \
+	android.hardware.audio@6.0-impl \
+	android.hardware.audio.service \
+	android.hardware.audio.effect@6.0-impl \
 
 # Audio policy configuration
 USE_XML_AUDIO_POLICY_CONF := 1
@@ -177,6 +184,7 @@
 	netutils-wrapper-1.0 \
 	messaging \
 	healthd \
+	gatekeeperd \
 
 # Boot control
 PRODUCT_PACKAGES += \
diff --git a/gpu/Android.bp b/gpu/Android.bp
index 0d8941e..ba395c0 100644
--- a/gpu/Android.bp
+++ b/gpu/Android.bp
@@ -15,6 +15,23 @@
 
 // Core dependencies
 
+package {
+    default_applicable_licenses: ["device_ti_beagle_x15_gpu_license"],
+}
+
+// See: http://go/android-license-faq
+license {
+    name: "device_ti_beagle_x15_gpu_license",
+    visibility: [":__subpackages__"],
+    license_kinds: [
+        "SPDX-license-identifier-BSD",
+        "SPDX-license-identifier-MIT",
+    ],
+    license_text: [
+        "NOTICE",
+    ],
+}
+
 cc_prebuilt_library_shared {
     name: "libIMGegl",
     srcs: ["libIMGegl.so"],
diff --git a/gpu/gralloc.am57x.so b/gpu/gralloc.am57x.so
index 42403b2..d835f53 100644
--- a/gpu/gralloc.am57x.so
+++ b/gpu/gralloc.am57x.so
Binary files differ
diff --git a/gpu/libEGL_POWERVR_SGX544_116.so b/gpu/libEGL_POWERVR_SGX544_116.so
index 4c5d525..cc8b270 100644
--- a/gpu/libEGL_POWERVR_SGX544_116.so
+++ b/gpu/libEGL_POWERVR_SGX544_116.so
Binary files differ
diff --git a/gpu/libGLESv1_CM_POWERVR_SGX544_116.so b/gpu/libGLESv1_CM_POWERVR_SGX544_116.so
index 1714b94..3f6f0dc 100644
--- a/gpu/libGLESv1_CM_POWERVR_SGX544_116.so
+++ b/gpu/libGLESv1_CM_POWERVR_SGX544_116.so
Binary files differ
diff --git a/gpu/libGLESv2_POWERVR_SGX544_116.so b/gpu/libGLESv2_POWERVR_SGX544_116.so
index 683c122..ccaa3a8 100644
--- a/gpu/libGLESv2_POWERVR_SGX544_116.so
+++ b/gpu/libGLESv2_POWERVR_SGX544_116.so
Binary files differ
diff --git a/gpu/libIMGegl.so b/gpu/libIMGegl.so
index 9b92ef9..2b33dd2 100644
--- a/gpu/libIMGegl.so
+++ b/gpu/libIMGegl.so
Binary files differ
diff --git a/gpu/libPVRScopeServices.so b/gpu/libPVRScopeServices.so
index d898582..33c286c 100644
--- a/gpu/libPVRScopeServices.so
+++ b/gpu/libPVRScopeServices.so
Binary files differ
diff --git a/gpu/libglslcompiler.so b/gpu/libglslcompiler.so
index 02f90a2..24d2098 100644
--- a/gpu/libglslcompiler.so
+++ b/gpu/libglslcompiler.so
Binary files differ
diff --git a/gpu/libpvr2d.so b/gpu/libpvr2d.so
index fde2e05..7fecdc4 100644
--- a/gpu/libpvr2d.so
+++ b/gpu/libpvr2d.so
Binary files differ
diff --git a/gpu/libpvrANDROID_WSEGL.so b/gpu/libpvrANDROID_WSEGL.so
index 46bdb3f..6f95286 100644
--- a/gpu/libpvrANDROID_WSEGL.so
+++ b/gpu/libpvrANDROID_WSEGL.so
Binary files differ
diff --git a/gpu/libsrv_init.so b/gpu/libsrv_init.so
index 7d7697a..a7c9ded 100644
--- a/gpu/libsrv_init.so
+++ b/gpu/libsrv_init.so
Binary files differ
diff --git a/gpu/libsrv_um.so b/gpu/libsrv_um.so
index f53468c..b30d3fa 100644
--- a/gpu/libsrv_um.so
+++ b/gpu/libsrv_um.so
Binary files differ
diff --git a/gpu/libusc.so b/gpu/libusc.so
index 2557496..245e8e8 100644
--- a/gpu/libusc.so
+++ b/gpu/libusc.so
Binary files differ
diff --git a/gpu/memtrack.am57x.so b/gpu/memtrack.am57x.so
index 46bb88b..36cf3e3 100644
--- a/gpu/memtrack.am57x.so
+++ b/gpu/memtrack.am57x.so
Binary files differ
diff --git a/gpu/pvrsrvctl b/gpu/pvrsrvctl
index 23e035c..1482529 100755
--- a/gpu/pvrsrvctl
+++ b/gpu/pvrsrvctl
Binary files differ
diff --git a/gralloc/Android.bp b/gralloc/Android.bp
index 30c0402..0ad369b 100644
--- a/gralloc/Android.bp
+++ b/gralloc/Android.bp
@@ -1,8 +1,15 @@
+package {
+    // See: http://go/android-license-faq
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_library_shared {
     name: "hwcomposer.drm_imagination",
     defaults: ["hwcomposer.drm_defaults"],
-    srcs: [":drm_hwcomposer_platformimagination"],
-    whole_static_libs: ["drm_hwcomposer"],
+    srcs: [
+        ":drm_hwcomposer_common",
+        ":drm_hwcomposer_platformimagination",
+    ],
     shared_libs: ["libion"],
     include_dirs: [
         "hardware/ti/am57x/libhwcomposer",
diff --git a/init.beagle_x15board.rc b/init.beagle_x15board.rc
index 24d6a65..844e09b 100644
--- a/init.beagle_x15board.rc
+++ b/init.beagle_x15board.rc
@@ -10,6 +10,10 @@
 on fs
     mount_all /vendor/etc/fstab.beagle_x15board
 
+on post-fs
+    # set RLIMIT_MEMLOCK to 64MB
+    setrlimit 8 67108864 67108864
+
 service pvrsrvinit /vendor/bin/pvrsrvctl --start
     class core
     user root
diff --git a/manifest.xml b/manifest.xml
index 48ed414..5e1c19c 100644
--- a/manifest.xml
+++ b/manifest.xml
@@ -1,8 +1,8 @@
-<manifest version="1.0" type="device">
+<manifest version="1.0" type="device" target-level="3">
     <hal format="hidl">
         <name>android.hardware.audio</name>
         <transport>hwbinder</transport>
-        <version>2.0</version>
+        <version>6.0</version>
         <interface>
             <name>IDevicesFactory</name>
             <instance>default</instance>
@@ -11,7 +11,7 @@
     <hal format="hidl">
         <name>android.hardware.audio.effect</name>
         <transport>hwbinder</transport>
-        <version>2.0</version>
+        <version>6.0</version>
         <interface>
             <name>IEffectsFactory</name>
             <instance>default</instance>
diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml
index c2c3095..392fd32 100644
--- a/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/overlay/frameworks/base/core/res/res/values/config.xml
@@ -94,15 +94,10 @@
 
     <!-- Default list of files pinned by the Pinner Service -->
     <string-array translatable="false" name="config_defaultPinnerServiceFiles">
-        <item>"/system/framework/arm/boot-framework.oat"</item>
         <item>"/system/framework/framework.jar"</item>
-        <item>"/system/framework/oat/arm/services.odex"</item>
         <item>"/system/framework/services.jar"</item>
-        <item>"/system/framework/arm/boot.oat"</item>
-        <item>"/system/framework/arm/boot-core-libart.oat"</item>
         <item>"/apex/com.android.art/javalib/core-oj.jar"</item>
         <item>"/apex/com.android.art/javalib/core-libart.jar"</item>
-        <item>"/apex/com.android.media/javalib/updatable-media.jar"</item>
     </string-array>
 
 </resources>
diff --git a/recovery/Android.bp b/recovery/Android.bp
index b2eab67..6096fac 100644
--- a/recovery/Android.bp
+++ b/recovery/Android.bp
@@ -14,6 +14,11 @@
 // limitations under the License.
 //
 
+package {
+    // See: http://go/android-license-faq
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_library_static {
     name: "librecovery_ui_beagle_x15",
     owner: "ti",
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
index 2f4134c..4f602ca 100644
--- a/sepolicy/file_contexts
+++ b/sepolicy/file_contexts
@@ -20,6 +20,8 @@
 /dev/block/platform/44000000.ocp/480b4000.mmc/by-name/userdata   u:object_r:userdata_block_device:s0
 /dev/block/platform/44000000.ocp/480b4000.mmc/by-name/misc       u:object_r:misc_block_device:s0
 
+/vendor/bin/hw/android\.hardware\.gatekeeper@1\.0-service\.software	u:object_r:hal_gatekeeper_default_exec:s0
+
 /vendor/lib/libIMGegl.so			u:object_r:same_process_hal_file:s0
 /vendor/lib/libsrv_um.so			u:object_r:same_process_hal_file:s0
 /vendor/lib/libusc.so				u:object_r:same_process_hal_file:s0
diff --git a/ueventd.beagle_x15board.rc b/ueventd.beagle_x15board.rc
index 42fdd37..cea043d 100644
--- a/ueventd.beagle_x15board.rc
+++ b/ueventd.beagle_x15board.rc
@@ -4,3 +4,8 @@
 # for android sync framework
 /dev/pvr_sync             0666   system     graphics
 /dev/pvrsrvkm             0666   system     graphics
+
+# for C2Store use, do not really care about the graphics group here
+# but it seems to be used by the gralloc.am57x.so library too,
+# set it to graphics for now
+/dev/ion                  0666   system     graphics