From 35a7a43b564009e590a72881a9a69a119ce712a5 Mon Sep 17 00:00:00 2001 From: satayev Date: Tue, 4 May 2021 16:14:02 +0100 Subject: [PATCH] Add 'platform:' prefix to unqualified system server jars. This allows Soong side changes to treat SystemServerJars as android.ConfiguredJarList, same as boot jars. Bug: 180105615, 155630745 Test: m && launch_cvd Change-Id: I717d4351edcd82028ac19cb9265e18b98d11c661 --- core/dex_preopt.mk | 4 +++- core/dex_preopt_odex_install.mk | 3 ++- core/product_config.mk | 19 ++++++++++++++++--- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk index dd31999ab7..593ad66742 100644 --- a/core/dex_preopt.mk +++ b/core/dex_preopt.mk @@ -62,7 +62,9 @@ ifeq ($(PRODUCT_USES_DEFAULT_ART_CONFIG), true) boot_zip := $(PRODUCT_OUT)/boot.zip bootclasspath_jars := $(DEXPREOPT_BOOTCLASSPATH_DEX_FILES) -system_server_jars := $(foreach m,$(PRODUCT_SYSTEM_SERVER_JARS),$(PRODUCT_OUT)/system/framework/$(m).jar) +system_server_jars := \ + $(foreach m,$(PRODUCT_SYSTEM_SERVER_JARS),\ + $(PRODUCT_OUT)/system/framework/$(call word-colon,2,$(m)).jar) $(boot_zip): PRIVATE_BOOTCLASSPATH_JARS := $(bootclasspath_jars) $(boot_zip): PRIVATE_SYSTEM_SERVER_JARS := $(system_server_jars) diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk index a23bae2f70..f5d473c8fa 100644 --- a/core/dex_preopt_odex_install.mk +++ b/core/dex_preopt_odex_install.mk @@ -70,9 +70,10 @@ endif # /data. If we don't do this they will need to be extracted which is not favorable for RAM usage # or performance. If my_preopt_for_extracted_apk is true, we ignore the only preopt boot image # options. +system_server_jars := $(foreach m,$(PRODUCT_SYSTEM_SERVER_JARS),$(call word-colon,2,$(m))) ifneq (true,$(my_preopt_for_extracted_apk)) ifeq (true,$(WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY)) - ifeq ($(filter $(PRODUCT_SYSTEM_SERVER_JARS) $(DEXPREOPT_BOOT_JARS_MODULES),$(LOCAL_MODULE)),) + ifeq ($(filter $(system_server_jars) $(DEXPREOPT_BOOT_JARS_MODULES),$(LOCAL_MODULE)),) LOCAL_DEX_PREOPT := endif endif diff --git a/core/product_config.mk b/core/product_config.mk index eb6f69fec6..5c85fb85f1 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -231,12 +231,23 @@ PRODUCT_AAPT_CONFIG := $(PRODUCT_LOCALES) $(PRODUCT_AAPT_CONFIG) PRODUCT_AAPT_CONFIG_SP := $(PRODUCT_AAPT_CONFIG) PRODUCT_AAPT_CONFIG := $(subst $(space),$(comma),$(PRODUCT_AAPT_CONFIG)) +########################################################### +## Add 'platform:' prefix to jars not in : format. +## +## This makes sure that a jar corresponds to ConfigureJarList format of and pairs +## where needed. +## +## $(1): a list of jars either in or : format +########################################################### + +define qualify-platform-jars + $(foreach jar,$(1),$(if $(findstring :,$(jar)),,platform:)$(jar)) +endef + # Extra boot jars must be appended at the end after common boot jars. PRODUCT_BOOT_JARS += $(PRODUCT_BOOT_JARS_EXTRA) -# Add 'platform:' prefix to unqualified boot jars -PRODUCT_BOOT_JARS := $(foreach pair,$(PRODUCT_BOOT_JARS), \ - $(if $(findstring :,$(pair)),,platform:)$(pair)) +PRODUCT_BOOT_JARS := $(call qualify-platform-jars,$(PRODUCT_BOOT_JARS)) # Replaces references to overridden boot jar modules in a boot jars variable. # $(1): Name of a boot jars variable with : pairs. @@ -254,6 +265,8 @@ $(call replace-boot-jar-module-overrides,ART_APEX_JARS) # The extra system server jars must be appended at the end after common system server jars. PRODUCT_SYSTEM_SERVER_JARS += $(PRODUCT_SYSTEM_SERVER_JARS_EXTRA) +PRODUCT_SYSTEM_SERVER_JARS := $(call qualify-platform-jars,$(PRODUCT_SYSTEM_SERVER_JARS)) + ifndef PRODUCT_SYSTEM_NAME PRODUCT_SYSTEM_NAME := $(PRODUCT_NAME) endif