From e8fb7cf87b8525629efbff823b4a870f8c4d1c5a Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Thu, 15 Feb 2018 13:19:38 -0800 Subject: [PATCH] Add a product property for changing the default compiler filter Add product property for changing default compiler filter: PRODUCT_DEX_PREOPT_DEFAULT_COMPILER_FILTER Bug: 70934104 Test: Specify PRODUCT_DEX_PREOPT_DEFAULT_COMPILER_FILTER in a device.mk Change-Id: I264631fc3813ef44d43b802b4cd9a8e92098183e --- core/dex_preopt_odex_install.mk | 9 +++++++-- core/product.mk | 1 + core/product_config.mk | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk index e3372799e..d4f08a8f8 100644 --- a/core/dex_preopt_odex_install.mk +++ b/core/dex_preopt_odex_install.mk @@ -224,6 +224,12 @@ ifeq (,$(my_system_server_compiler_filter)) my_system_server_compiler_filter := speed endif +my_default_compiler_filter := $(PRODUCT_DEX_PREOPT_DEFAULT_COMPILER_FILTER) +ifeq (,$(my_default_compiler_filter)) +# If no default compiler filter is specified, default to 'quicken' to save on storage. +my_default_compiler_filter := quicken +endif + ifeq (,$(filter --compiler-filter=%, $(LOCAL_DEX_PREOPT_FLAGS))) ifneq (,$(filter $(PRODUCT_SYSTEM_SERVER_JARS),$(LOCAL_MODULE))) # Jars of system server, use the product option if it is set, speed otherwise. @@ -238,8 +244,7 @@ ifeq (,$(filter --compiler-filter=%, $(LOCAL_DEX_PREOPT_FLAGS))) # For non system server jars, use speed-profile when we have a profile. LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=speed-profile else - # If no compiler filter is specified, default to 'quicken' to save on storage. - LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=quicken + LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=$(my_default_compiler_filter) endif endif endif diff --git a/core/product.mk b/core/product.mk index 8095b2799..ce1485349 100644 --- a/core/product.mk +++ b/core/product.mk @@ -129,6 +129,7 @@ _product_var_list := \ PRODUCT_PRODUCT_VERITY_PARTITION \ PRODUCT_SYSTEM_SERVER_DEBUG_INFO \ PRODUCT_DEX_PREOPT_MODULE_CONFIGS \ + PRODUCT_DEX_PREOPT_DEFAULT_COMPILER_FILTER \ PRODUCT_DEX_PREOPT_DEFAULT_FLAGS \ PRODUCT_DEX_PREOPT_BOOT_FLAGS \ PRODUCT_DEX_PREOPT_PROFILE_DIR \ diff --git a/core/product_config.mk b/core/product_config.mk index bf607bbc8..0c4654195 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -392,6 +392,8 @@ PRODUCT_OTA_PUBLIC_KEYS := $(sort \ PRODUCT_EXTRA_RECOVERY_KEYS := $(sort \ $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_EXTRA_RECOVERY_KEYS)) +PRODUCT_DEX_PREOPT_DEFAULT_COMPILER_FILTER := \ + $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_DEFAULT_COMPILER_FILTER)) PRODUCT_DEX_PREOPT_DEFAULT_FLAGS := \ $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_DEFAULT_FLAGS)) PRODUCT_DEX_PREOPT_BOOT_FLAGS := \