Merge "Ensure current product use PRODUCT_* vars directly"
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 949e88d..6c5ecd9 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -689,6 +689,16 @@
 # that they live in the ART APEX (b/142944799).
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/framework/*.jar)
 
+# Remove symlinks for VNDK apexes
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib*/vndk-*)
+
+# Switch to symlinks for VNDK libs
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib*/vndk-*)
+
+# Remove Android Core Library artifacts from the system partition
+# again, as the original change removing them was reverted.
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/framework/*.jar)
+
 # ************************************************
 # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
 # ************************************************
diff --git a/core/Makefile b/core/Makefile
index 9c60855..6015796 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -4815,6 +4815,8 @@
   $(call dump-super-image-info,$(2))
   $(foreach p,$(BOARD_SUPER_PARTITION_PARTITION_LIST), \
     echo "$(p)_image=$(INSTALLED_$(call to-upper,$(p))IMAGE_TARGET)" >> $(2);)
+  $(if $(BUILDING_SYSTEM_OTHER_IMAGE), $(if $(filter system,$(BOARD_SUPER_PARTITION_PARTITION_LIST)), \
+    echo "system_other_image=$(INSTALLED_SYSTEMOTHERIMAGE_TARGET)" >> $(2);))
   mkdir -p $(dir $(1))
   PATH=$(dir $(LPMAKE)):$$PATH \
     $(BUILD_SUPER_IMAGE) -v $(2) $(1)
@@ -4824,6 +4826,12 @@
 INSTALLED_SUPERIMAGE_DEPENDENCIES := $(LPMAKE) $(BUILD_SUPER_IMAGE) \
     $(foreach p, $(BOARD_SUPER_PARTITION_PARTITION_LIST), $(INSTALLED_$(call to-upper,$(p))IMAGE_TARGET))
 
+ifdef BUILDING_SYSTEM_OTHER_IMAGE
+ifneq ($(filter system,$(BOARD_SUPER_PARTITION_PARTITION_LIST)),)
+INSTALLED_SUPERIMAGE_DEPENDENCIES += $(INSTALLED_SYSTEMOTHERIMAGE_TARGET)
+endif
+endif
+
 # If BOARD_BUILD_SUPER_IMAGE_BY_DEFAULT is set, super.img is built from images in the
 # $(PRODUCT_OUT) directory, and is built to $(PRODUCT_OUT)/super.img. Also, it will
 # be built for non-dist builds. This is useful for devices that uses super.img directly, e.g.
diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk
index 2439f79..efb21e7 100644
--- a/core/config_sanitizers.mk
+++ b/core/config_sanitizers.mk
@@ -182,7 +182,9 @@
   my_shared_libraries += $($(LOCAL_2ND_ARCH_VAR_PREFIX)HWADDRESS_SANITIZER_RUNTIME_LIBRARY)
   ifneq ($(filter EXECUTABLES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),)
     ifeq ($(LOCAL_FORCE_STATIC_EXECUTABLE),true)
-      my_static_libraries := $(my_static_libraries) $($(LOCAL_2ND_ARCH_VAR_PREFIX)HWADDRESS_SANITIZER_STATIC_LIBRARY)
+      my_static_libraries := $(my_static_libraries) \
+                             $($(LOCAL_2ND_ARCH_VAR_PREFIX)HWADDRESS_SANITIZER_STATIC_LIBRARY) \
+                             libdl
     endif
   endif
 endif
diff --git a/core/cxx_stl_setup.mk b/core/cxx_stl_setup.mk
index 95b1090..6571d99 100644
--- a/core/cxx_stl_setup.mk
+++ b/core/cxx_stl_setup.mk
@@ -82,7 +82,7 @@
         endif
 
         ifeq ($(my_link_type),static)
-            my_static_libraries += libm libc libdl
+            my_static_libraries += libm libc
         endif
     endif
 else ifeq ($(my_cxx_stl),ndk)
diff --git a/core/envsetup.mk b/core/envsetup.mk
index 0c58cd6..d35cb7e 100644
--- a/core/envsetup.mk
+++ b/core/envsetup.mk
@@ -259,14 +259,6 @@
 # Java libraries in the ART apex build rule.
 ART_APEX_JARS := core-oj core-libart core-icu4j okhttp bouncycastle apache-xml
 TARGET_CORE_JARS := $(ART_APEX_JARS) conscrypt
-ifeq ($(EMMA_INSTRUMENT),true)
-  ifneq ($(EMMA_INSTRUMENT_STATIC),true)
-    # For instrumented build, if Jacoco is not being included statically
-    # in instrumented packages then include Jacoco classes into the
-    # bootclasspath.
-    TARGET_CORE_JARS += jacocoagent
-  endif # EMMA_INSTRUMENT_STATIC
-endif # EMMA_INSTRUMENT
 HOST_CORE_JARS := $(addsuffix -hostdex,$(TARGET_CORE_JARS))
 #################################################################
 
diff --git a/core/main.mk b/core/main.mk
index fab6f23..54023e6 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -1108,11 +1108,11 @@
 endef
 
 # Check that libraries that should only be in APEXes don't end up in the system
-# image. For the Runtime APEX this complements the checks in
+# image. For the ART APEX this complements the checks in
 # art/build/apex/art_apex_test.py.
 # TODO(b/128708192): Implement this restriction in Soong instead.
 
-# Runtime APEX libraries
+# ART APEX (native) libraries
 APEX_MODULE_LIBS := \
   libadbconnection.so \
   libadbconnectiond.so \
@@ -1128,14 +1128,10 @@
   libartd-dexlayout.so \
   libartd.so \
   libartpalette.so \
-  libc.so \
-  libc_malloc_debug.so \
-  libc_malloc_hooks.so \
   libdexfile.so \
   libdexfile_external.so \
   libdexfiled.so \
   libdexfiled_external.so \
-  libdl.so \
   libdt_fd_forward.so \
   libdt_socket.so \
   libicui18n.so \
@@ -1143,11 +1139,9 @@
   libicu_jni.so \
   libjavacore.so \
   libjdwp.so \
-  libm.so \
   libnativebridge.so \
   libnativehelper.so \
   libnativeloader.so \
-  libneuralnetworks.so \
   libnpt.so \
   libopenjdk.so \
   libopenjdkjvm.so \
@@ -1159,16 +1153,45 @@
   libprofiled.so \
   libsigchain.so \
 
+# Runtime (Bionic) APEX (native) libraries
+APEX_MODULE_LIBS += \
+  libc.so \
+  libc_malloc_debug.so \
+  libc_malloc_hooks.so \
+  libdl.so \
+  libm.so \
+
 # Conscrypt APEX libraries
 APEX_MODULE_LIBS += \
   libjavacrypto.so \
 
+# Android Neural Network API (NNAPI) APEX (native) libraries
+APEX_MODULE_LIBS += \
+  libneuralnetworks.so \
+
+# ART APEX JARs (Java libraries)
+APEX_MODULE_LIBS += \
+  apache-xml.jar \
+  bouncycastle.jar \
+  core-icu4j.jar \
+  core-libart.jar \
+  core-oj.jar \
+  okhttp.jar \
+
+# Conscrypt APEX JARs (Java libraries)
+APEX_MODULE_LIBS += \
+  conscrypt.jar \
+
 # An option to disable the check below, for local use since some build targets
 # still may create these libraries in /system (b/129006418).
 DISABLE_APEX_LIBS_ABSENCE_CHECK ?=
 
+# Allow APEX libraries under /system/apex, which happens when APEX flattening
+# is enabled.
+APEX_LIBS_ABSENCE_CHECK_EXCLUDE := apex
+
 # Bionic should not be in /system, except for the bootstrap instance.
-APEX_LIBS_ABSENCE_CHECK_EXCLUDE := lib/bootstrap lib64/bootstrap
+APEX_LIBS_ABSENCE_CHECK_EXCLUDE += lib/bootstrap lib64/bootstrap
 
 # Exclude lib/arm and lib64/arm64 which contain the native bridge proxy libs. They
 # are compiled for the guest architecture and used with an entirely different
@@ -1215,12 +1238,14 @@
   # APEX might be misconfigured or something is wrong in the build system.
   # Please reach out to the APEX package owners and/or soong-team@, or
   # android-building@googlegroups.com externally.
+  #
+  # Likewise, we check for the absence of APEX Java libraries (JARs).
   define check-apex-libs-absence
     $(call maybe-print-list-and-error, \
       $(filter $(foreach lib,$(APEX_MODULE_LIBS),%/$(lib)), \
         $(filter-out $(foreach dir,$(APEX_LIBS_ABSENCE_CHECK_EXCLUDE), \
                        $(TARGET_OUT)/$(if $(findstring %,$(dir)),$(dir),$(dir)/%)), \
-          $(filter $(TARGET_OUT)/lib/% $(TARGET_OUT)/lib64/%,$(1)))), \
+          $(filter $(TARGET_OUT),$(1)))), \
       APEX libraries found in product_target_FILES (see comment for check-apex-libs-absence in \
       build/make/core/main.mk for details))
   endef
@@ -1234,11 +1259,13 @@
   # try "m installclean && m systemimage" to get a correct system image. For
   # local work you can also disable the check with the
   # DISABLE_APEX_LIBS_ABSENCE_CHECK environment variable.
+  #
+  # Likewise, we check for the absence of APEX Java libraries (JARs).
   define check-apex-libs-absence-on-disk
     $(hide) ( \
       cd $(TARGET_OUT) && \
-      findres=$$(find lib* \
-        $(foreach dir,$(APEX_LIBS_ABSENCE_CHECK_EXCLUDE),-path "$(subst %,*,$(dir))" -prune -o) \
+      findres=$$(find . \
+        $(foreach dir,$(APEX_LIBS_ABSENCE_CHECK_EXCLUDE),-path "./$(subst %,*,$(dir))" -prune -o) \
         -type f \( -false $(foreach lib,$(APEX_MODULE_LIBS),-o -name $(lib)) \) \
         -print) && \
       if [ -n "$$findres" ]; then \
@@ -1252,8 +1279,6 @@
   endef
 endif
 
-# TODO(b/142944799): Implement Java library absence check for Core Libraries.
-
 ifdef FULL_BUILD
   ifneq (true,$(ALLOW_MISSING_DEPENDENCIES))
     # Check to ensure that all modules in PRODUCT_PACKAGES exist (opt in per product)
diff --git a/core/notice_files.mk b/core/notice_files.mk
index 680a0b1..9df1c11 100644
--- a/core/notice_files.mk
+++ b/core/notice_files.mk
@@ -71,8 +71,11 @@
       # javalib.jar is the default name for the build module (and isn't meaningful)
       # If that's what we have, substitute the module name instead.  These files
       # aren't included on the device, so this name is synthetic anyway.
+      # Extra path "static" is added to try to avoid name conflict between the notice file of
+      # this 'uninstallable' Java module and the notice file for another 'installable' Java module
+      # whose stem is the same as this module's name.
       ifneq ($(filter javalib.jar,$(module_leaf)),)
-        module_leaf := $(LOCAL_MODULE).jar
+        module_leaf := static/$(LOCAL_MODULE).jar
       endif
       module_installed_filename := \
           $(patsubst $(PRODUCT_OUT)/%,%,$($(my_prefix)OUT_JAVA_LIBRARIES))/$(module_leaf)
diff --git a/core/product_config.mk b/core/product_config.mk
index 1293c94..4fc7bf6 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -184,6 +184,18 @@
 all_product_makefiles :=
 all_product_configs :=
 
+# Jacoco agent JARS to be built and installed, if any.
+ifeq ($(EMMA_INSTRUMENT),true)
+  ifneq ($(EMMA_INSTRUMENT_STATIC),true)
+    # For instrumented build, if Jacoco is not being included statically
+    # in instrumented packages then include Jacoco classes into the
+    # bootclasspath.
+    $(foreach product,$(PRODUCTS),\
+      $(eval PRODUCTS.$(product).PRODUCT_PACKAGES += jacocoagent)\
+      $(eval PRODUCTS.$(product).PRODUCT_BOOT_JARS += jacocoagent))
+  endif # EMMA_INSTRUMENT_STATIC
+endif # EMMA_INSTRUMENT
+
 ############################################################################
 # Strip and assign the PRODUCT_ variables.
 $(call strip-product-vars)
diff --git a/core/soong_cc_prebuilt.mk b/core/soong_cc_prebuilt.mk
index 9e3f0d3..20950ca 100644
--- a/core/soong_cc_prebuilt.mk
+++ b/core/soong_cc_prebuilt.mk
@@ -120,11 +120,12 @@
 endif
 
 ifeq ($(LOCAL_VNDK_DEPEND_ON_CORE_VARIANT),true)
+$(LOCAL_BUILT_MODULE): PRIVATE_TOOLS_PREFIX := $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)TOOLS_PREFIX)
 $(LOCAL_BUILT_MODULE): $(LOCAL_PREBUILT_MODULE_FILE) $(LIBRARY_IDENTITY_CHECK_SCRIPT)
 	$(call verify-vndk-libs-identical,\
 		$(PRIVATE_CORE_VARIANT),\
 		$<,\
-		$($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)TOOLS_PREFIX))
+		$(PRIVATE_TOOLS_PREFIX))
 	$(copy-file-to-target)
 else
 $(LOCAL_BUILT_MODULE): $(LOCAL_PREBUILT_MODULE_FILE)
diff --git a/core/soong_config.mk b/core/soong_config.mk
index bcd025b..1138f08 100644
--- a/core/soong_config.mk
+++ b/core/soong_config.mk
@@ -105,6 +105,8 @@
 $(call add_json_list, XOMExcludePaths,                   $(XOM_EXCLUDE_PATHS) $(PRODUCT_XOM_EXCLUDE_PATHS))
 $(call add_json_list, IntegerOverflowExcludePaths,       $(INTEGER_OVERFLOW_EXCLUDE_PATHS) $(PRODUCT_INTEGER_OVERFLOW_EXCLUDE_PATHS))
 
+$(call add_json_bool, Experimental_mte,                  $(filter true,$(TARGET_EXPERIMENTAL_MTE)))
+
 $(call add_json_bool, DisableScudo,                      $(filter true,$(PRODUCT_DISABLE_SCUDO)))
 
 $(call add_json_bool, ClangTidy,                         $(filter 1 true,$(WITH_TIDY)))
diff --git a/envsetup.sh b/envsetup.sh
index f0c6b9b..a44cd50 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -11,14 +11,17 @@
 - tapas:      tapas [<App1> <App2> ...] [arm|x86|mips|arm64|x86_64|mips64] [eng|userdebug|user]
 - croot:      Changes directory to the top of the tree, or a subdirectory thereof.
 - m:          Makes from the top of the tree.
-- mm:         Builds all of the modules in the current directory, but not their dependencies.
-- mmm:        Builds all of the modules in the supplied directories, but not their dependencies.
+- mm:         Builds and installs all of the modules in the current directory, and their
+              dependencies.
+- mmm:        Builds and installs all of the modules in the supplied directories, and their
+              dependencies.
               To limit the modules being built use the syntax: mmm dir/:target1,target2.
-- mma:        Builds all of the modules in the current directory, and their dependencies.
-- mmma:       Builds all of the modules in the supplied directories, and their dependencies.
+- mma:        Same as 'mm'
+- mmma:       Same as 'mmm'
 - provision:  Flash device with all required partitions. Options will be passed on to fastboot.
 - cgrep:      Greps on all local C/C++ files.
 - ggrep:      Greps on all local Gradle files.
+- gogrep:     Greps on all local Go files.
 - jgrep:      Greps on all local Java files.
 - resgrep:    Greps on all local res/*.xml files.
 - mangrep:    Greps on all local AndroidManifest.xml files.
@@ -968,6 +971,12 @@
         -exec grep --color -n "$@" {} +
 }
 
+function gogrep()
+{
+    find . -name .repo -prune -o -name .git -prune -o -name out -prune -o -type f -name "*\.go" \
+        -exec grep --color -n "$@" {} +
+}
+
 function jgrep()
 {
     find . -name .repo -prune -o -name .git -prune -o -name out -prune -o -type f -name "*\.java" \
@@ -1016,7 +1025,7 @@
     Darwin)
         function mgrep()
         {
-            find -E . -name .repo -prune -o -name .git -prune -o -path ./out -prune -o \( -iregex '.*/(Makefile|Makefile\..*|.*\.make|.*\.mak|.*\.mk|.*\.bp)' -o -regex '(.*/)?soong/[^/]*.go' \) -type f \
+            find -E . -name .repo -prune -o -name .git -prune -o -path ./out -prune -o \( -iregex '.*/(Makefile|Makefile\..*|.*\.make|.*\.mak|.*\.mk|.*\.bp)' -o -regex '(.*/)?(build|soong)/.*[^/]*\.go' \) -type f \
                 -exec grep --color -n "$@" {} +
         }
 
@@ -1030,7 +1039,7 @@
     *)
         function mgrep()
         {
-            find . -name .repo -prune -o -name .git -prune -o -path ./out -prune -o \( -regextype posix-egrep -iregex '(.*\/Makefile|.*\/Makefile\..*|.*\.make|.*\.mak|.*\.mk|.*\.bp)' -o -regextype posix-extended -regex '(.*/)?soong/[^/]*.go' \) -type f \
+            find . -name .repo -prune -o -name .git -prune -o -path ./out -prune -o \( -regextype posix-egrep -iregex '(.*\/Makefile|.*\/Makefile\..*|.*\.make|.*\.mak|.*\.mk|.*\.bp)' -o -regextype posix-extended -regex '(.*/)?(build|soong)/.*[^/]*\.go' \) -type f \
                 -exec grep --color -n "$@" {} +
         }
 
diff --git a/target/product/aosp_arm64.mk b/target/product/aosp_arm64.mk
index cc4785a..dda805f 100644
--- a/target/product/aosp_arm64.mk
+++ b/target/product/aosp_arm64.mk
@@ -39,9 +39,6 @@
 PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed
 endif
 
-PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \
-    root/init.zygote64_32.rc \
-
 #
 # All components inherited here go to product image
 #
diff --git a/target/product/aosp_x86_64.mk b/target/product/aosp_x86_64.mk
index a471702..153f499 100644
--- a/target/product/aosp_x86_64.mk
+++ b/target/product/aosp_x86_64.mk
@@ -39,9 +39,6 @@
 PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed
 endif
 
-PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \
-    root/init.zygote64_32.rc \
-
 #
 # All components inherited here go to product image
 #
diff --git a/target/product/emulator.mk b/target/product/emulator.mk
index 7ff01cd..52fa1a7 100644
--- a/target/product/emulator.mk
+++ b/target/product/emulator.mk
@@ -20,8 +20,6 @@
 
 # Device modules
 PRODUCT_PACKAGES += \
-    libGLES_android \
-    vintf \
     CarrierConfig \
 
 # need this for gles libraries to load properly
diff --git a/target/product/emulator_vendor.mk b/target/product/emulator_vendor.mk
index e67124e..7891a26 100644
--- a/target/product/emulator_vendor.mk
+++ b/target/product/emulator_vendor.mk
@@ -21,21 +21,6 @@
 $(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_vendor.mk)
 $(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_vendor.mk)
 
-# TODO(b/123495142): these files should be clean up
-PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST := \
-    system/bin/vintf \
-    system/etc/permissions/android.software.verified_boot.xml \
-    system/etc/permissions/privapp-permissions-goldfish.xml \
-    system/lib/egl/libGLES_android.so \
-    system/lib64/egl/libGLES_android.so \
-    system/priv-app/SdkSetup/SdkSetup.apk \
-    system/priv-app/SdkSetup/oat/% \
-
-# Device modules
-PRODUCT_PACKAGES += \
-    libGLES_android \
-    vintf \
-
 # need this for gles libraries to load properly
 # after moving to /vendor/lib/
 PRODUCT_PACKAGES += \
diff --git a/target/product/gsi/Android.mk b/target/product/gsi/Android.mk
index f9402cb..536fe0c 100644
--- a/target/product/gsi/Android.mk
+++ b/target/product/gsi/Android.mk
@@ -2,7 +2,7 @@
 
 #####################################################################
 # list of vndk libraries from the source code.
-INTERNAL_VNDK_LIB_LIST := $(SOONG_OUT_DIR)/vndk/vndk.libraries.txt
+INTERNAL_VNDK_LIB_LIST := $(SOONG_VNDK_LIBRARIES_FILE)
 
 #####################################################################
 # This is the up-to-date list of vndk libs.
diff --git a/target/product/gsi/current.txt b/target/product/gsi/current.txt
index 03d7681..0f873de 100644
--- a/target/product/gsi/current.txt
+++ b/target/product/gsi/current.txt
@@ -157,6 +157,7 @@
 VNDK-core: android.hardware.radio@1.2.so
 VNDK-core: android.hardware.radio@1.3.so
 VNDK-core: android.hardware.radio@1.4.so
+VNDK-core: android.hardware.radio@1.5.so
 VNDK-core: android.hardware.secure_element@1.0.so
 VNDK-core: android.hardware.secure_element@1.1.so
 VNDK-core: android.hardware.sensors@1.0.so
diff --git a/target/product/gsi_arm64.mk b/target/product/gsi_arm64.mk
index 09fb633..645bc3a 100644
--- a/target/product/gsi_arm64.mk
+++ b/target/product/gsi_arm64.mk
@@ -23,9 +23,6 @@
 # Enable mainline checking
 PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed
 
-PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \
-    root/init.zygote64_32.rc \
-
 #
 # All components inherited here go to product image
 #
diff --git a/target/product/gsi_release.mk b/target/product/gsi_release.mk
index cab3916..faaa935 100644
--- a/target/product/gsi_release.mk
+++ b/target/product/gsi_release.mk
@@ -51,19 +51,3 @@
 
 # Support addtional P and Q VNDK packages
 PRODUCT_EXTRA_VNDK_VERSIONS := 28 29
-
-# The 64 bits GSI build targets inhiert core_64_bit.mk to enable 64 bits and
-# include the init.zygote64_32.rc.
-# 64 bits GSI for releasing need to includes different zygote settings for
-# vendor.img to select by setting property ro.zygote=zygote64_32 or
-# ro.zygote=zygote32_64:
-#   1. 64-bit primary, 32-bit secondary, or
-#   2. 32-bit primary, 64-bit secondary
-# Here includes the init.zygote32_64.rc if it had inhierted core_64_bit.mk.
-ifeq (true|true,$(TARGET_SUPPORTS_32_BIT_APPS)|$(TARGET_SUPPORTS_64_BIT_APPS))
-PRODUCT_COPY_FILES += \
-    system/core/rootdir/init.zygote32_64.rc:root/init.zygote32_64.rc
-
-PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \
-    root/init.zygote32_64.rc
-endif
diff --git a/target/product/mainline_arm64.mk b/target/product/mainline_arm64.mk
index 6d998d6..52b3222 100644
--- a/target/product/mainline_arm64.mk
+++ b/target/product/mainline_arm64.mk
@@ -19,18 +19,18 @@
 whitelist := product_manifest.xml
 $(call enforce-product-packages-exist,$(whitelist))
 
-PRODUCT_NAME := mainline_arm64
-PRODUCT_DEVICE := mainline_arm64
-PRODUCT_BRAND := generic
-PRODUCT_SHIPPING_API_LEVEL := 28
-PRODUCT_RESTRICT_VENDOR_FILES := all
-
 PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed
-PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \
-  root/init.zygote64_32.rc \
 
 # Modules that should probably be moved to /product
 PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \
   system/bin/healthd \
   system/etc/init/healthd.rc \
   system/etc/vintf/manifest/manifest_healthd.xml \
+
+PRODUCT_SHIPPING_API_LEVEL := 29
+
+PRODUCT_RESTRICT_VENDOR_FILES := all
+
+PRODUCT_NAME := mainline_arm64
+PRODUCT_DEVICE := mainline_arm64
+PRODUCT_BRAND := generic
diff --git a/target/product/mainline_system.mk b/target/product/mainline_system.mk
index cd6a0f7..f7eb8ad 100644
--- a/target/product/mainline_system.mk
+++ b/target/product/mainline_system.mk
@@ -110,6 +110,13 @@
 PRODUCT_HOST_PACKAGES += \
     tinyplay
 
+# Include all zygote init scripts. "ro.zygote" will select one of them.
+PRODUCT_COPY_FILES += \
+    system/core/rootdir/init.zygote32.rc:root/init.zygote32.rc \
+    system/core/rootdir/init.zygote64.rc:root/init.zygote64.rc \
+    system/core/rootdir/init.zygote32_64.rc:root/init.zygote32_64.rc \
+    system/core/rootdir/init.zygote64_32.rc:root/init.zygote64_32.rc
+
 # Enable dynamic partition size
 PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true
 
diff --git a/target/product/mainline_system_arm64.mk b/target/product/mainline_system_arm64.mk
index 4031371..772c687 100644
--- a/target/product/mainline_system_arm64.mk
+++ b/target/product/mainline_system_arm64.mk
@@ -23,8 +23,6 @@
 
 # Enable mainline checking
 PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := true
-PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \
-  root/init.zygote64_32.rc \
 
 PRODUCT_BUILD_CACHE_IMAGE := false
 PRODUCT_BUILD_ODM_IMAGE := false
@@ -36,8 +34,10 @@
 PRODUCT_BUILD_USERDATA_IMAGE := false
 PRODUCT_BUILD_VENDOR_IMAGE := false
 
+PRODUCT_SHIPPING_API_LEVEL := 29
+
+PRODUCT_RESTRICT_VENDOR_FILES := all
+
 PRODUCT_NAME := mainline_system_arm64
 PRODUCT_DEVICE := mainline_arm64
 PRODUCT_BRAND := generic
-PRODUCT_SHIPPING_API_LEVEL := 28
-PRODUCT_RESTRICT_VENDOR_FILES := all
diff --git a/target/product/mainline_system_x86.mk b/target/product/mainline_system_x86.mk
index ac33068..05e51a9 100644
--- a/target/product/mainline_system_x86.mk
+++ b/target/product/mainline_system_x86.mk
@@ -33,8 +33,10 @@
 PRODUCT_BUILD_USERDATA_IMAGE := false
 PRODUCT_BUILD_VENDOR_IMAGE := false
 
+PRODUCT_SHIPPING_API_LEVEL := 29
+
+PRODUCT_RESTRICT_VENDOR_FILES := all
+
 PRODUCT_NAME := mainline_system_x86
 PRODUCT_DEVICE := mainline_x86
 PRODUCT_BRAND := generic
-PRODUCT_SHIPPING_API_LEVEL := 28
-PRODUCT_RESTRICT_VENDOR_FILES := all
diff --git a/target/product/mainline_system_x86_arm.mk b/target/product/mainline_system_x86_arm.mk
index 0ed86cc..cc11c55 100644
--- a/target/product/mainline_system_x86_arm.mk
+++ b/target/product/mainline_system_x86_arm.mk
@@ -33,8 +33,10 @@
 PRODUCT_BUILD_USERDATA_IMAGE := false
 PRODUCT_BUILD_VENDOR_IMAGE := false
 
+PRODUCT_SHIPPING_API_LEVEL := 29
+
+PRODUCT_RESTRICT_VENDOR_FILES := all
+
 PRODUCT_NAME := mainline_system_x86_arm
 PRODUCT_DEVICE := mainline_x86_arm
 PRODUCT_BRAND := generic
-PRODUCT_SHIPPING_API_LEVEL := 28
-PRODUCT_RESTRICT_VENDOR_FILES := all
diff --git a/target/product/sdk_phone_x86_64.mk b/target/product/sdk_phone_x86_64.mk
index 267796f..2d0d6e1 100644
--- a/target/product/sdk_phone_x86_64.mk
+++ b/target/product/sdk_phone_x86_64.mk
@@ -27,9 +27,6 @@
 PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed
 endif
 
-PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \
-    root/init.zygote64_32.rc \
-
 #
 # All components inherited here go to product image
 #
diff --git a/target/product/security/com_google_android_permissioncontroller-container.x509.pem b/target/product/security/com_google_android_permissioncontroller-container.x509.pem
new file mode 100644
index 0000000..95f476f
--- /dev/null
+++ b/target/product/security/com_google_android_permissioncontroller-container.x509.pem
@@ -0,0 +1,30 @@
+-----BEGIN CERTIFICATE-----

+MIIGHDCCBASgAwIBAgIUQ6US4BMtEWcSr2vuqJ5tlHLrBuYwDQYJKoZIhvcNAQELBQAwgZ4xCzAJ

+BgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQw

+EgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDE6MDgGA1UEAwwxY29tX2dvb2ds

+ZV9hbmRyb2lkX3Blcm1pc3Npb25jb250cm9sbGVyLWNvbnRhaW5lcjAeFw0xOTAyMDEwMzU2MDZa

+Fw00OTAyMDEwMzU2MDZaMIGeMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQG

+A1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJv

+aWQxOjA4BgNVBAMMMWNvbV9nb29nbGVfYW5kcm9pZF9wZXJtaXNzaW9uY29udHJvbGxlci1jb250

+YWluZXIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCFBJYVLl8bg+dW9nE2R7pnwPAA

+q6JpnMzYnQb4lycDxugACxiWRTZ7wUSpIv/QY3Mu/dv6GnWJhrRwJFhCq0jISzsmRwMMi7DFEujc

+osO80s6kVjaQ71yYqMRhw2IfSIphFU0YMEgcucNAUG/ELFBDsnqxHqVdLxGDQZAwJ/Iz30olEBS4

+26VuwlpZrbIku/k0IO0B5NdzvSAQJECo2uOzEhEgQFQlTE5Lku9MX1PsC+pkokIRcYiOkXoXT6Qk

+wSkP23bpvsjbjwNOgavPs8Pdx4tHfTs60ysOdbNpHl5dWlDKvKRelxxUPS9yjTRFd6U8MZN0Ldt1

+8k4bzuptQ1yXML4csFGjsbhapqzEEO267ULdrWz58L+C1Rx/fBIV1efZOkNfdrrgGTIfnD8kbI9j

+kLPPPhOuPgMl2huflB4CcLLGyk2h7BkTYn6tM16Q/+i/qHtph81GZqdeDZRG9dG/VFqR8vD6JwCS

+aVci28zmzBR1kUlWoSRk2xiQmv7/ZGtgKVXppipVVasR2XUr+z3AFJm41TPAqei9xqeA6eRUmBbs

+YS0q/zSBPef0zTyyrQQLhkSW/D5sELEg9lidbpMUwe+myE9yNXnvbsQbzJFHrPanVLLeY896opaV

+GSjiIMaJdWrcp9OOYZQHO7W05UWmDvQHKg7Un6OxdFL/TEaZAwIDAQABo1AwTjAMBgNVHRMEBTAD

+AQH/MB0GA1UdDgQWBBTuRKWeFsHYvfDR4eoKuuMEz3iJrTAfBgNVHSMEGDAWgBTuRKWeFsHYvfDR

+4eoKuuMEz3iJrTANBgkqhkiG9w0BAQsFAAOCAgEAY6ua1I9ERwbs6SXZFqMGe5oryg/3Kbhx5Q+z

+uL8B8Nr85Ez/DR6Lr9PNBqR4Mc0/Rb8f1lHlxx5DcKggT1YjbbM9aULdrGI+wpvDwHp6kCo1T58L

+xn97KeJbTMy5uogLiBabXIiScyDEzz2GpdajbgsI9Io1i+v9uDv/RFWnZV+C7l3ZEZ2klo8Elexo

+BFOD0WdAptxERyBF549URonUxq3UWLbUisg0j8P3yKe9lmhZwO2tUmxaKQGlL4LAGRsQ4kTgXCwN

+WWUMRIYcdmW4TxLZy/KDKwLc6ezik07Ifc5bHajY3OSzRtp17Hf3U+/LnQt5KZD6MuoQu7Rxh1Fv

+pbUAgsD4UPEjUcsEEa3BbIcSfN6l68mkbf7AioGaKvOKXx9DVrrQYfW4gy5vskFyRMbLw5iTQ3Od

+WdViiw3ZmrCtnZLnUQY29B/04Ma0ejrtSonEJBl2VIakpyM0g5gyOcg17vl9xrAoITkbMp26GcUd

+1DQOlyBI2Uct7KKM2d9nuIEJwHn6D2eboRBk0Y/XPeg8IDNDUMx6K2ArOL5RUkBz3oGCdPQkLT+b

+PIps1fAOCGbE6HEPB6OEcTZNv8XXnchEjdwocTUgjAtnDhuGqcooQnCFbPodXISJURNZb5QUH2Ic

+Q4BDiSNSs38AF9dzBaFoUowHUySA0wrVDjT5tC0=

+-----END CERTIFICATE-----