From 106fa4f771c7317eb6a25ee1d8e643081cdb2989 Mon Sep 17 00:00:00 2001 From: Jaekyun Seok Date: Fri, 1 Sep 2017 17:23:25 +0900 Subject: [PATCH] Support excluding overlays when enforcing RRO PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS will be used to specify overlays to be excluded from enforcing RRO. The excluded overlays will be applied into the original package. Bug: 63600240 Bug: 65001751 Test: succeeded building with PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS := \ vendor/google/google_overlay/static_only \ vendor/google/nexus_overlay/common/static_only and confirmed that config_webview_packages existed in framework-res.apk with the overlayed value, but not in framework-res__auto_generated_rro.apk. Merged-In: I0bfb44fc7726710bb78d9100404bc6dd29d06a73 Change-Id: I0bfb44fc7726710bb78d9100404bc6dd29d06a73 (cherry picked from commit ccee95e6ec94196bfca775e526e27276a09856ae) --- core/package_internal.mk | 13 ++++++++++++- core/product.mk | 1 + core/product_config.mk | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/core/package_internal.mk b/core/package_internal.mk index 87a15d23f..5c4ad2866 100644 --- a/core/package_internal.mk +++ b/core/package_internal.mk @@ -122,7 +122,18 @@ ifneq ($(PRODUCT_ENFORCE_RRO_TARGETS),) endif endif -ifndef enforce_rro_enabled +ifdef enforce_rro_enabled + ifneq ($(PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS),) + static_only_resource_overlays := $(filter $(addsuffix %,$(PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS)),$(package_resource_overlays)) + ifneq ($(static_only_resource_overlays),) + package_resource_overlays := $(filter-out $(static_only_resource_overlays),$(package_resource_overlays)) + LOCAL_RESOURCE_DIR := $(static_only_resource_overlays) $(LOCAL_RESOURCE_DIR) + ifeq ($(package_resource_overlays),) + enforce_rro_enabled := + endif + endif + endif +else LOCAL_RESOURCE_DIR := $(package_resource_overlays) $(LOCAL_RESOURCE_DIR) endif diff --git a/core/product.mk b/core/product.mk index 8f7db19ef..c955ccc06 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_EXCLUDED_OVERLAYS \ PRODUCT_ENFORCE_RRO_TARGETS \ PRODUCT_SDK_ATREE_FILES \ PRODUCT_SDK_ADDON_NAME \ diff --git a/core/product_config.mk b/core/product_config.mk index 6812b05d4..cd62fb2e4 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -434,6 +434,10 @@ PRODUCT_ART_USE_READ_BARRIER := \ PRODUCT_IOT := \ $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_IOT)) +# Resource overlay list which must be excluded from enforcing RRO. +PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS := \ + $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS)) + # Package list to apply enforcing RRO. PRODUCT_ENFORCE_RRO_TARGETS := \ $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ENFORCE_RRO_TARGETS))