aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/package_internal.mk17
-rw-r--r--core/product.mk1
-rw-r--r--core/product_config.mk12
-rw-r--r--core/soong_config.mk2
4 files changed, 32 insertions, 0 deletions
diff --git a/core/package_internal.mk b/core/package_internal.mk
index 698784263..75cc547be 100644
--- a/core/package_internal.mk
+++ b/core/package_internal.mk
@@ -87,6 +87,23 @@ else
87 LOCAL_RESOURCE_DIR := $(foreach d,$(LOCAL_RESOURCE_DIR),$(call clean-path,$(d))) 87 LOCAL_RESOURCE_DIR := $(foreach d,$(LOCAL_RESOURCE_DIR),$(call clean-path,$(d)))
88endif 88endif
89 89
90# If LOCAL_MODULE matches a rule in PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES,
91# override the manfest package name by the (first) rule matched
92override_manifest_name := $(strip $(word 1,\
93 $(foreach rule,$(PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES),\
94 $(eval _pkg_name_pat := $(call word-colon,1,$(rule)))\
95 $(eval _manifest_name_pat := $(call word-colon,2,$(rule)))\
96 $(if $(filter $(_pkg_name_pat),$(LOCAL_MODULE)),\
97 $(patsubst $(_pkg_name_pat),$(_manifest_name_pat),$(LOCAL_MODULE))\
98 )\
99 )\
100))
101
102ifneq (,$(override_manifest_name))
103# Note: this can override LOCAL_MANFEST_PACKAGE_NAME value set in Android.mk
104LOCAL_MANIFEST_PACKAGE_NAME := $(override_manifest_name)
105endif
106
90include $(BUILD_SYSTEM)/force_aapt2.mk 107include $(BUILD_SYSTEM)/force_aapt2.mk
91 108
92# Process Support Library dependencies. 109# Process Support Library dependencies.
diff --git a/core/product.mk b/core/product.mk
index 8497b2830..1420b46e1 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -213,6 +213,7 @@ _product_var_list := \
213 PRODUCT_RETROFIT_DYNAMIC_PARTITIONS \ 213 PRODUCT_RETROFIT_DYNAMIC_PARTITIONS \
214 PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS \ 214 PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS \
215 PRODUCT_XOM_EXCLUDE_PATHS \ 215 PRODUCT_XOM_EXCLUDE_PATHS \
216 PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES \
216 217
217define dump-product 218define dump-product
218$(info ==== $(1) ====)\ 219$(info ==== $(1) ====)\
diff --git a/core/product_config.mk b/core/product_config.mk
index f0f7da14e..47b4c7aa0 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -346,6 +346,11 @@ PRODUCT_SHIPPING_API_LEVEL := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SHI
346# used for adding properties to default.prop 346# used for adding properties to default.prop
347PRODUCT_DEFAULT_PROPERTY_OVERRIDES := \ 347PRODUCT_DEFAULT_PROPERTY_OVERRIDES := \
348 $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEFAULT_PROPERTY_OVERRIDES)) 348 $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEFAULT_PROPERTY_OVERRIDES))
349
350$(foreach rule,$(PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES),\
351 $(if $(filter 2,$(words $(subst :,$(space),$(rule)))),,\
352 $(error Rule "$(rule)" in PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDE is not <module_name>:<manifest_name>)))
353
349.KATI_READONLY := PRODUCT_DEFAULT_PROPERTY_OVERRIDES 354.KATI_READONLY := PRODUCT_DEFAULT_PROPERTY_OVERRIDES
350 355
351# A list of property assignments, like "key = value", with zero or more 356# A list of property assignments, like "key = value", with zero or more
@@ -549,3 +554,10 @@ PRODUCT_FORCE_PRODUCT_MODULES_TO_SYSTEM_PARTITION := \
549# set this variable to prevent OTA failures. 554# set this variable to prevent OTA failures.
550PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS := \ 555PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS := \
551 $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS)) 556 $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS))
557
558# List of <module_name>:<manifest_name> pairs to override the manifest package name
559# of a module <module_name> to <manifest_name>. Patterns can be used as in
560# com.android.%:com.acme.android.%.release
561PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES := \
562 $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES))
563.KATI_READONLY := PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES
diff --git a/core/soong_config.mk b/core/soong_config.mk
index 85be1e7a8..31c77d4b8 100644
--- a/core/soong_config.mk
+++ b/core/soong_config.mk
@@ -144,6 +144,8 @@ $(call add_json_bool, FlattenApex, $(filter true,$(TARGET_
144 144
145$(call add_json_str, DexpreoptGlobalConfig, $(DEX_PREOPT_CONFIG)) 145$(call add_json_str, DexpreoptGlobalConfig, $(DEX_PREOPT_CONFIG))
146 146
147$(call add_json_list, ManifestPackageNameOverrides, $(PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES))
148
147$(call add_json_map, VendorVars) 149$(call add_json_map, VendorVars)
148$(foreach namespace,$(SOONG_CONFIG_NAMESPACES),\ 150$(foreach namespace,$(SOONG_CONFIG_NAMESPACES),\
149 $(call add_json_map, $(namespace))\ 151 $(call add_json_map, $(namespace))\