From 364e9c39de9372d9255e5aeedb0c94f4c8b30125 Mon Sep 17 00:00:00 2001 From: Jiakai Zhang Date: Tue, 28 Nov 2023 13:34:38 +0000 Subject: [PATCH] Remove PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK. This was added by r.android.com/513843 to force dexpreopt some GMS core modules even if dexpreopt is disabled, to avoid some memory usage regression. We no longer need it because dexpreopt is never disabled on production builds. Bug: 313505540 Test: m Change-Id: Iff7f1d340a3ecd64cdc3d2f83f9c37c109a81fda --- core/app_prebuilt_internal.mk | 5 ----- core/dex_preopt_odex_install.mk | 7 ++----- core/prebuilt_internal.mk | 1 - core/product.mk | 2 -- target/product/go_defaults_common.mk | 4 ---- 5 files changed, 2 insertions(+), 17 deletions(-) diff --git a/core/app_prebuilt_internal.mk b/core/app_prebuilt_internal.mk index b141a98525..2671956c7a 100644 --- a/core/app_prebuilt_internal.mk +++ b/core/app_prebuilt_internal.mk @@ -85,11 +85,6 @@ $(my_extracted_apk): $(my_prebuilt_src_file) my_prebuilt_src_file := $(my_extracted_apk) my_extracted_apk := my_extract_apk := -ifeq ($(PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK),true) -# If the product property is set, always preopt for extracted modules to prevent executing out of -# the APK. -my_preopt_for_extracted_apk := true -endif endif rs_compatibility_jni_libs := diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk index 0155c678ae..151591e130 100644 --- a/core/dex_preopt_odex_install.mk +++ b/core/dex_preopt_odex_install.mk @@ -60,10 +60,8 @@ ifeq (,$(strip $(built_dex)$(my_prebuilt_src_file)$(LOCAL_SOONG_DEX_JAR))) LOCAL_DEX_PREOPT := endif -ifneq (true,$(my_preopt_for_extracted_apk)) - ifeq (true,$(WITH_DEXPREOPT_ART_BOOT_IMG_ONLY)) - LOCAL_DEX_PREOPT := - endif +ifeq (true,$(WITH_DEXPREOPT_ART_BOOT_IMG_ONLY)) + LOCAL_DEX_PREOPT := endif my_process_profile := @@ -392,7 +390,6 @@ ifeq ($(my_create_dexpreopt_config), true) $(call add_json_list, DexPreoptImageLocationsOnDevice,$(my_dexpreopt_image_locations_on_device)) $(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)) $(call add_json_bool, NoCreateAppImage, $(filter false,$(LOCAL_DEX_PREOPT_APP_IMAGE))) $(call add_json_bool, ForceCreateAppImage, $(filter true,$(LOCAL_DEX_PREOPT_APP_IMAGE))) $(call add_json_bool, PresignedPrebuilt, $(filter PRESIGNED,$(LOCAL_CERTIFICATE))) diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk index 5bea9b620f..94626402c9 100644 --- a/core/prebuilt_internal.mk +++ b/core/prebuilt_internal.mk @@ -63,4 +63,3 @@ $(if $(filter-out $(SOONG_ANDROID_MK),$(LOCAL_MODULE_MAKEFILE)), \ $(built_module) : $(LOCAL_ADDITIONAL_DEPENDENCIES) my_prebuilt_src_file := -my_preopt_for_extracted_apk := diff --git a/core/product.mk b/core/product.mk index be5ec47388..969b506e30 100644 --- a/core/product.mk +++ b/core/product.mk @@ -183,8 +183,6 @@ _product_list_vars += PRODUCT_SYSTEM_SERVER_JARS_EXTRA # Set to true to disable checks for a product. _product_list_vars += PRODUCT_BROKEN_VERIFY_USES_LIBRARIES -# All of the apps that we force preopt, this overrides WITH_DEXPREOPT. -_product_list_vars += PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK _product_list_vars += PRODUCT_DEXPREOPT_SPEED_APPS _product_list_vars += PRODUCT_LOADED_BY_PRIVILEGED_MODULES _product_single_value_vars += PRODUCT_VBOOT_SIGNING_KEY diff --git a/target/product/go_defaults_common.mk b/target/product/go_defaults_common.mk index 51a1ef6ec4..ba0912cde9 100644 --- a/target/product/go_defaults_common.mk +++ b/target/product/go_defaults_common.mk @@ -24,10 +24,6 @@ PRODUCT_VENDOR_PROPERTIES += \ # Speed profile services and wifi-service to reduce RAM and storage. PRODUCT_SYSTEM_SERVER_COMPILER_FILTER := speed-profile -# Always preopt extracted APKs to prevent extracting out of the APK for gms -# modules. -PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK := true - # Use a profile based boot image for this device. Note that this is currently a # generic profile and not Android Go optimized. PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE := true