diff --git a/core/main.mk b/core/main.mk index 8200a4c4d..63f1bf58e 100644 --- a/core/main.mk +++ b/core/main.mk @@ -497,7 +497,7 @@ ADDITIONAL_DEFAULT_PROPERTIES := $(strip $(ADDITIONAL_DEFAULT_PROPERTIES)) ADDITIONAL_BUILD_PROPERTIES := $(strip $(ADDITIONAL_BUILD_PROPERTIES)) .KATI_READONLY := ADDITIONAL_BUILD_PROPERTIES -ifeq ($(BOARD_ENFORCE_RRO),true) +ifneq ($(PRODUCT_ENFORCE_RRO_TARGETS),) ENFORCE_RRO_SOURCES := endif @@ -571,7 +571,7 @@ endif # ONE_SHOT_MAKEFILE # Enforce to generate all RRO packages for modules having resource # overlays. # ------------------------------------------------------------------- -ifeq ($(BOARD_ENFORCE_RRO),true) +ifneq ($(PRODUCT_ENFORCE_RRO_TARGETS),) $(call generate_all_enforce_rro_packages) endif diff --git a/core/package_internal.mk b/core/package_internal.mk index f68a388e8..312fd9df8 100644 --- a/core/package_internal.mk +++ b/core/package_internal.mk @@ -101,9 +101,11 @@ package_resource_overlays := $(strip \ $(addprefix $(dir)/, $(LOCAL_RESOURCE_DIR))))) enforce_rro_enabled := -ifeq ($(BOARD_ENFORCE_RRO),true) - ifeq (,$(filter $(LOCAL_PACKAGE_NAME), $(BOARD_ENFORCE_RRO_EXEMPT_SOURCES))) - ifneq ($(package_resource_overlays),) +ifneq ($(PRODUCT_ENFORCE_RRO_TARGETS),) + ifneq ($(package_resource_overlays),) + ifeq ($(PRODUCT_ENFORCE_RRO_TARGETS),*) + enforce_rro_enabled := true + else ifneq (,$(filter $(LOCAL_PACKAGE_NAME), $(PRODUCT_ENFORCE_RRO_TARGETS))) enforce_rro_enabled := true endif endif @@ -693,4 +695,4 @@ $(call append_enforce_rro_sources, \ $(enforce_rro_use_res_lib), \ $(package_resource_overlays) \ ) -endif # enforce_rro_enabled \ No newline at end of file +endif # enforce_rro_enabled diff --git a/core/product.mk b/core/product.mk index fffd7c8ff..3d201689b 100644 --- a/core/product.mk +++ b/core/product.mk @@ -94,6 +94,7 @@ _product_var_list := \ PRODUCT_EXTRA_RECOVERY_KEYS \ PRODUCT_PACKAGE_OVERLAYS \ DEVICE_PACKAGE_OVERLAYS \ + PRODUCT_ENFORCE_RRO_TARGETS \ PRODUCT_SDK_ATREE_FILES \ PRODUCT_SDK_ADDON_NAME \ PRODUCT_SDK_ADDON_COPY_FILES \ diff --git a/core/product_config.mk b/core/product_config.mk index 7a2d9cbdd..8246c141f 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -424,3 +424,7 @@ PRODUCT_ART_USE_READ_BARRIER := \ # Whether the product is an Android Things variant. PRODUCT_IOT := \ $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_IOT)) + +# Package list to apply enforcing RRO. +PRODUCT_ENFORCE_RRO_TARGETS := \ + $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ENFORCE_RRO_TARGETS))