Merge "Add new compiler warning patterns"
diff --git a/core/Makefile b/core/Makefile
index c650022..67d5d3f 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -3778,6 +3778,7 @@
   simg2img \
   sload_f2fs \
   tune2fs \
+  unpack_bootimg \
   update_host_simulator \
   validate_target_files \
   verity_signer \
diff --git a/core/definitions.mk b/core/definitions.mk
index 20b8cf6..ff435e2 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -2628,17 +2628,15 @@
 endef
 
 # Define a rule to create a symlink to a file.
-# $(1): full path to source
+# $(1): any dependencies
 # $(2): source (may be relative)
 # $(3): full path to destination
 define symlink-file
 $(eval $(_symlink-file))
 endef
 
-# Order-only dependency because make/ninja will follow the link when checking
-# the timestamp, so the file must exist
 define _symlink-file
-$(3): | $(1)
+$(3): $(1)
 	@echo "Symlink: $$@ -> $(2)"
 	@mkdir -p $(dir $$@)
 	@rm -rf $$@
diff --git a/core/dex_preopt_config.mk b/core/dex_preopt_config.mk
index 0f994c4..78cc012 100644
--- a/core/dex_preopt_config.mk
+++ b/core/dex_preopt_config.mk
@@ -45,8 +45,6 @@
 DEX2OAT := $(SOONG_HOST_OUT_EXECUTABLES)/dex2oatd$(HOST_EXECUTABLE_SUFFIX)
 endif
 
-DEX2OAT_DEPENDENCY += $(DEX2OAT)
-
 # Use the first preloaded-classes file in PRODUCT_COPY_FILES.
 PRELOADED_CLASSES := $(call word-colon,1,$(firstword \
     $(filter %system/etc/preloaded-classes,$(PRODUCT_COPY_FILES))))
diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk
index aa3fd80..e6b5010 100644
--- a/core/dex_preopt_odex_install.mk
+++ b/core/dex_preopt_odex_install.mk
@@ -111,6 +111,7 @@
 my_dexpreopt_archs :=
 my_dexpreopt_images :=
 my_dexpreopt_images_deps :=
+my_dexpreopt_image_locations :=
 my_dexpreopt_infix := boot
 ifeq (true, $(DEXPREOPT_USE_APEX_IMAGE))
   my_dexpreopt_infix := apex
@@ -183,6 +184,8 @@
     endif  # TARGET_2ND_ARCH
   endif  # LOCAL_MODULE_CLASS
 
+  my_dexpreopt_image_locations += $(DEXPREOPT_IMAGE_LOCATIONS_$(my_dexpreopt_infix))
+
   my_filtered_optional_uses_libraries := $(filter-out $(INTERNAL_PLATFORM_MISSING_USES_LIBRARIES), \
     $(LOCAL_OPTIONAL_USES_LIBRARIES))
 
@@ -234,7 +237,7 @@
   $(call end_json_map)
   $(call add_json_list, Archs,                          $(my_dexpreopt_archs))
   $(call add_json_list, DexPreoptImages,                $(my_dexpreopt_images))
-  $(call add_json_list, DexPreoptImageLocations,        $(DEXPREOPT_IMAGE_LOCATIONS))
+  $(call add_json_list, DexPreoptImageLocations,        $(my_dexpreopt_image_locations))
   $(call add_json_list, PreoptBootClassPathDexFiles,    $(DEXPREOPT_BOOTCLASSPATH_DEX_FILES))
   $(call add_json_list, PreoptBootClassPathDexLocations,$(DEXPREOPT_BOOTCLASSPATH_DEX_LOCATIONS))
   $(call add_json_bool, PreoptExtractedApk,             $(my_preopt_for_extracted_apk))
diff --git a/core/install_jni_libs_internal.mk b/core/install_jni_libs_internal.mk
index eac0414..25a16a3 100644
--- a/core/install_jni_libs_internal.mk
+++ b/core/install_jni_libs_internal.mk
@@ -49,29 +49,21 @@
   my_shared_library_path := $(call get_non_asan_path,\
       $($(my_2nd_arch_prefix)TARGET_OUT$(partition_tag)_SHARED_LIBRARIES))
   my_installed_library := $(addprefix $(my_shared_library_path)/, $(my_jni_filenames))
-  # Do not use order-only dependency, because we want to rebuild the image if an jni is updated.
-  $(LOCAL_INSTALLED_MODULE) : $(my_installed_library)
 
   ALL_MODULES.$(LOCAL_MODULE).INSTALLED += $(my_installed_library)
 
   # Create symlink in the app specific lib path
   # Skip creating this symlink when running the second part of a target sanitization build.
   ifeq ($(filter address,$(SANITIZE_TARGET)),)
-    ifdef LOCAL_POST_INSTALL_CMD
-      # Add a shell command separator
-      LOCAL_POST_INSTALL_CMD += ;
-    endif
-
     my_symlink_target_dir := $(patsubst $(PRODUCT_OUT)%,%,\
-        $(my_shared_library_path))
-    LOCAL_POST_INSTALL_CMD += \
-        mkdir -p $(my_app_lib_path) \
-        $(foreach lib, $(my_jni_filenames), ;ln -sf $(my_symlink_target_dir)/$(lib) $(my_app_lib_path)/$(lib))
-    $(LOCAL_INSTALLED_MODULE): PRIVATE_POST_INSTALL_CMD := $(LOCAL_POST_INSTALL_CMD)
-  else
-    ifdef LOCAL_POST_INSTALL_CMD
-      $(LOCAL_INSTALLED_MODULE): PRIVATE_POST_INSTALL_CMD := $(LOCAL_POST_INSTALL_CMD)
-    endif
+      $(my_shared_library_path))
+    $(foreach lib,$(my_jni_filenames),\
+      $(call symlink-file, \
+        $(my_shared_library_path)/$(lib), \
+        $(my_symlink_target_dir)/$(lib), \
+        $(my_app_lib_path)/$(lib)) \
+      $(eval $$(LOCAL_INSTALLED_MODULE) : $$(my_app_lib_path)/$$(lib)) \
+      $(eval ALL_MODULES.$$(LOCAL_MODULE).INSTALLED += $$(my_app_lib_path)/$$(lib)))
   endif
 
   # Clear jni_shared_libraries to not embed it into the apk.
diff --git a/target/board/mainline_arm64/BoardConfig.mk b/target/board/mainline_arm64/BoardConfig.mk
index c53da9e..a09960f 100644
--- a/target/board/mainline_arm64/BoardConfig.mk
+++ b/target/board/mainline_arm64/BoardConfig.mk
@@ -40,8 +40,3 @@
 BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4
 BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4
 BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
-
-# Mainline devices support apex
-# TODO: move this to BoardConfigMainlineCommon. Currently, GSI wants flattened
-#       apexes, but emulator wants .apex files, preventing this.
-TARGET_FLATTEN_APEX := false
diff --git a/target/board/mainline_x86/BoardConfig.mk b/target/board/mainline_x86/BoardConfig.mk
index a20d17c..4dda058 100644
--- a/target/board/mainline_x86/BoardConfig.mk
+++ b/target/board/mainline_x86/BoardConfig.mk
@@ -29,7 +29,3 @@
 BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4
 BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4
 BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
-
-# Mainline devices support apex
-# TODO: move this to product makefile and use updatable_apex.mk
-TARGET_FLATTEN_APEX := false
diff --git a/target/board/mainline_x86_arm/BoardConfig.mk b/target/board/mainline_x86_arm/BoardConfig.mk
index 6b282c2..d775a77 100644
--- a/target/board/mainline_x86_arm/BoardConfig.mk
+++ b/target/board/mainline_x86_arm/BoardConfig.mk
@@ -34,7 +34,3 @@
 BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4
 BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4
 BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
-
-# Mainline devices support apex
-# TODO: move this to product makefile and use updatable_apex.mk
-TARGET_FLATTEN_APEX := false
diff --git a/target/product/base_system.mk b/target/product/base_system.mk
index 7d182c4..2895801 100644
--- a/target/product/base_system.mk
+++ b/target/product/base_system.mk
@@ -97,6 +97,7 @@
     idmap2 \
     idmap2d \
     ime \
+    ims-common \
     incident \
     incidentd \
     incident_helper \
@@ -250,6 +251,7 @@
     task_profiles.json \
     tc \
     telecom \
+    telephony-common \
     tombstoned \
     traced \
     traced_probes \
@@ -268,10 +270,6 @@
     wifi-service \
     wm \
 
-# TODO(b/146549048) remove this
-PRODUCT_PACKAGES += \
-    boringssl_self_test
-
 # VINTF data for system image
 PRODUCT_PACKAGES += \
     system_manifest.xml \
@@ -335,8 +333,6 @@
     com.android.ipsec:ike \
     com.android.media:updatable-media \
     com.android.sdkext:framework-sdkext \
-    com.android.telephony:telephony-common \
-    com.android.telephony:ims-common \
     com.android.tethering:framework-tethering
 
 PRODUCT_COPY_FILES += \
diff --git a/target/product/gsi/Android.mk b/target/product/gsi/Android.mk
index 424cf05..243c00f 100644
--- a/target/product/gsi/Android.mk
+++ b/target/product/gsi/Android.mk
@@ -51,7 +51,7 @@
 ifeq (REL,$(PLATFORM_VERSION_CODENAME))
 _vndk_check_failure_message += "       Changing the VNDK library list is not allowed in API locked branches."
 else
-_vndk_check_failure_message += "       Run update-vndk-list.sh to update $(LATEST_VNDK_LIB_LIST)"
+_vndk_check_failure_message += "       Run \`update-vndk-list.sh\` to update $(LATEST_VNDK_LIB_LIST)"
 endif
 
 $(check-vndk-list-timestamp): $(INTERNAL_VNDK_LIB_LIST) $(LATEST_VNDK_LIB_LIST) $(HOST_OUT_EXECUTABLES)/update-vndk-list.sh
diff --git a/target/product/mainline_system_x86_64.mk b/target/product/mainline_system_x86_64.mk
index 1b1a42f..473ff72 100644
--- a/target/product/mainline_system_x86_64.mk
+++ b/target/product/mainline_system_x86_64.mk
@@ -24,9 +24,6 @@
 # Enable mainline checking
 PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := true
 
-# Enable nonflat APEX
-$(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk)
-
 PRODUCT_BUILD_CACHE_IMAGE := false
 PRODUCT_BUILD_ODM_IMAGE := false
 PRODUCT_BUILD_PRODUCT_IMAGE  := false