diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk index b107ded0da..f940c72e8b 100644 --- a/core/dex_preopt.mk +++ b/core/dex_preopt.mk @@ -23,6 +23,9 @@ DEX_PREOPT_DEFAULT ?= true # being used). To bundle everything one should set this to '%' SYSTEM_OTHER_ODEX_FILTER ?= app/% priv-app/% +# Method returning whether the install path $(1) should be for system_other. +install-on-system-other = $(filter-out $(PRODUCT_SYSTEM_SERVER_APPS),$(basename $(notdir $(filter $(foreach f,$(SYSTEM_OTHER_ODEX_FILTER),$(TARGET_OUT)/$(f)),$(1))))) + # The default values for pre-opting: always preopt PIC. # Conditional to building on linux, as dex2oat currently does not work on darwin. ifeq ($(HOST_OS),linux) diff --git a/core/dex_preopt_libart.mk b/core/dex_preopt_libart.mk index ffb888cff0..8ee800b238 100644 --- a/core/dex_preopt_libart.mk +++ b/core/dex_preopt_libart.mk @@ -61,7 +61,7 @@ endef # $(2): the full install path (including file name) of the corresponding .apk. ifeq ($(BOARD_USES_SYSTEM_OTHER_ODEX),true) define get-odex-installed-file-path -$(if $(filter $(foreach f,$(SYSTEM_OTHER_ODEX_FILTER),$(TARGET_OUT)/$(f)),$(2)), +$(if $(call install-on-system-other, $(2)), $(call get-odex-file-path,$(1),$(patsubst $(TARGET_OUT)/%,$(TARGET_OUT_SYSTEM_OTHER)/%,$(2))), $(call get-odex-file-path,$(1),$(2))) endef diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk index a347d05bf6..4d8e2d25bc 100644 --- a/core/dex_preopt_odex_install.mk +++ b/core/dex_preopt_odex_install.mk @@ -42,7 +42,7 @@ endif # if installing into system, and odex are being installed into system_other, don't strip ifeq ($(BOARD_USES_SYSTEM_OTHER_ODEX),true) ifeq ($(LOCAL_DEX_PREOPT),true) -ifneq ($(filter $(foreach f,$(SYSTEM_OTHER_ODEX_FILTER),$(TARGET_OUT)/$(f)),$(my_module_path)),) +ifneq ($(call install-on-system-other, $(my_module_path)),) LOCAL_DEX_PREOPT := nostripping endif endif diff --git a/core/product_config.mk b/core/product_config.mk index 7a2d9cbdd9..5675f2fb60 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -268,6 +268,7 @@ all_product_configs := # A list of module names of BOOTCLASSPATH (jar files) PRODUCT_BOOT_JARS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_BOOT_JARS)) PRODUCT_SYSTEM_SERVER_JARS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_SERVER_JARS)) +PRODUCT_SYSTEM_SERVER_APPS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_SERVER_APPS)) # Find the device that this product maps to. TARGET_DEVICE := $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEVICE)