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.

Change-Id: I0bfb44fc7726710bb78d9100404bc6dd29d06a73
This commit is contained in:
Jaekyun Seok 2017-09-01 17:23:25 +09:00
parent 631b3a031c
commit ccee95e6ec
3 changed files with 17 additions and 1 deletions

View File

@ -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

View File

@ -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 \

View File

@ -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))