diff --git a/core/product.mk b/core/product.mk index d249adf2c..0baa9f2e8 100644 --- a/core/product.mk +++ b/core/product.mk @@ -217,6 +217,8 @@ _product_var_list := \ PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS \ PRODUCT_XOM_EXCLUDE_PATHS \ PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES \ + PRODUCT_PACKAGE_NAME_OVERRIDES \ + PRODUCT_CERTIFICATE_OVERRIDES \ PRODUCT_BUILD_SYSTEM_IMAGE \ PRODUCT_BUILD_SYSTEM_OTHER_IMAGE \ PRODUCT_BUILD_VENDOR_IMAGE \ diff --git a/core/product_config.mk b/core/product_config.mk index 4823e248f..01fbc0ac9 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -349,10 +349,6 @@ PRODUCT_SHIPPING_API_LEVEL := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SHI PRODUCT_DEFAULT_PROPERTY_OVERRIDES := \ $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEFAULT_PROPERTY_OVERRIDES)) -$(foreach rule,$(PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES),\ - $(if $(filter 2,$(words $(subst :,$(space),$(rule)))),,\ - $(error Rule "$(rule)" in PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDE is not :))) - .KATI_READONLY := PRODUCT_DEFAULT_PROPERTY_OVERRIDES # A list of property assignments, like "key = value", with zero or more @@ -571,12 +567,19 @@ PRODUCT_FORCE_PRODUCT_MODULES_TO_SYSTEM_PARTITION := \ PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS := \ $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS)) -# List of : pairs to override the manifest package name -# of a module to . Patterns can be used as in -# com.android.%:com.acme.android.%.release -PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES := \ - $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES)) -.KATI_READONLY := PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES +define product-overrides-config +PRODUCT_$(1)_OVERRIDES := $$(strip $$(PRODUCTS.$$(INTERNAL_PRODUCT).PRODUCT_$(1)_OVERRIDES)) +.KATI_READONLY := PRODUCT_$(1)_OVERRIDES +$$(foreach rule,$$(PRODUCT_$(1)_OVERRIDES),\ + $$(if $$(filter 2,$$(words $$(subst :,$$(space),$$(rule)))),,\ + $$(error Rule "$$(rule)" in PRODUCT_$(1)_OVERRIDE is not :))) +endef + +$(foreach var, \ + MANIFEST_PACKAGE_NAME \ + PACKAGE_NAME \ + CERTIFICATE, \ + $(eval $(call product-overrides-config,$(var)))) # Macro to use below. $(1) is the name of the partition define product-build-image-config diff --git a/core/soong_config.mk b/core/soong_config.mk index ccfcf871d..9f8626492 100644 --- a/core/soong_config.mk +++ b/core/soong_config.mk @@ -152,6 +152,8 @@ $(call add_json_bool, FlattenApex, $(filter true,$(TARGET_ $(call add_json_str, DexpreoptGlobalConfig, $(DEX_PREOPT_CONFIG)) $(call add_json_list, ManifestPackageNameOverrides, $(PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES)) +$(call add_json_list, PackageNameOverrides, $(PRODUCT_PACKAGE_NAME_OVERRIDES)) +$(call add_json_list, CertificateOverrides, $(PRODUCT_CERTIFICATE_OVERRIDES)) $(call add_json_bool, EnforceSystemCertificate, $(ENFORCE_SYSTEM_CERTIFICATE)) $(call add_json_list, EnforceSystemCertificateWhitelist, $(ENFORCE_SYSTEM_CERTIFICATE_WHITELIST))