Pass privileged dexpreopt module configuration to Soong

Pass DONT_UNCOMPRESS_PRIV_APPS_DEXS, PRODUCT_LOADED_BY_PRIVILEGED_MODULES,
DEX_PREOPT_DEFAULT, and WITH_DEXPREOPT to Soong so it can determine when
to store uncompressed dex files in APKs and when to strip them.

Also convert DEXPREOPT.$(TARGET_PRODUCT).$(LOCAL_MODULE).CONFIG=disabled
to a DEXPREOPT_DISABLED_MODULES list, and export it to Soong.

Test: m checkbuild
Change-Id: I8652032d4b9f5d2e119e73acdf91b8148563eedd
This commit is contained in:
Colin Cross 2018-10-05 14:41:04 -07:00
parent fc782ad949
commit 3aa2f8f69b
3 changed files with 10 additions and 2 deletions

View File

@ -49,7 +49,7 @@ ifneq (,$(filter $(LOCAL_MODULE_TAGS),tests))
endif
# If we have product-specific config for this module?
ifeq (disable,$(DEXPREOPT.$(TARGET_PRODUCT).$(LOCAL_MODULE).CONFIG))
ifneq (,$(filter $(LOCAL_MODULE),$(DEXPREOPT_DISABLED_MODULES)))
LOCAL_DEX_PREOPT :=
endif

View File

@ -423,6 +423,7 @@ PRODUCT_OTHER_JAVA_DEBUG_INFO := \
# Resolve and setup per-module dex-preopt configs.
PRODUCT_DEX_PREOPT_MODULE_CONFIGS := \
$(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_MODULE_CONFIGS))
DEXPREOPT_DISABLED_MODULES :=
# If a module has multiple setups, the first takes precedence.
_pdpmc_modules :=
$(foreach c,$(PRODUCT_DEX_PREOPT_MODULE_CONFIGS),\
@ -431,7 +432,9 @@ $(foreach c,$(PRODUCT_DEX_PREOPT_MODULE_CONFIGS),\
$(eval _pdpmc_modules += $(m))\
$(eval cf := $(patsubst $(m)=%,%,$(c)))\
$(eval cf := $(subst $(_PDPMC_SP_PLACE_HOLDER),$(space),$(cf)))\
$(eval DEXPREOPT.$(TARGET_PRODUCT).$(m).CONFIG := $(cf))))
$(if $(filter disable,$(cf)),\
$(eval DEXPREOPT_DISABLED_MODULES += $(m)),\
$(eval DEXPREOPT.$(TARGET_PRODUCT).$(m).CONFIG := $(cf)))))
_pdpmc_modules :=
# Resolve and setup per-module sanitizer configs.

View File

@ -123,6 +123,11 @@ $(call add_json_list, DeviceSystemSdkVersions, $(BOARD_SYSTEMSDK_VERSI
$(call add_json_list, Platform_systemsdk_versions, $(PLATFORM_SYSTEMSDK_VERSIONS))
$(call add_json_bool, Malloc_not_svelte, $(call invert_bool,$(filter true,$(MALLOC_SVELTE))))
$(call add_json_str, Override_rs_driver, $(OVERRIDE_RS_DRIVER))
$(call add_json_bool, UncompressPrivAppDex, $(call invert_bool,$(filter true,$(DONT_UNCOMPRESS_PRIV_APPS_DEXS))))
$(call add_json_list, ModulesLoadedByPrivilegedModules, $(PRODUCT_LOADED_BY_PRIVILEGED_MODULES))
$(call add_json_bool, DefaultStripDex, $(call invert_bool,$(filter nostripping,$(DEX_PREOPT_DEFAULT))))
$(call add_json_bool, DisableDexPreopt, $(filter false,$(WITH_DEXPREOPT)))
$(call add_json_list, DisableDexPreoptModules, $(DEXPREOPT_DISABLED_MODULES))
$(call add_json_bool, Product_is_iot, $(filter true,$(PRODUCT_IOT)))