Use product-based inclusive rule for enforcing RRO

Board-based rule can cause unexpected regression because build-time overlays
are different among products. So each product should be tested with its own
product-based rule considering its build-time overlays before applying
enforcing RRO.

Additionally RRO conversion is mandatory only for overlays of which target is
included in AOSP system image and is critical for CTS/VTS tests with AOSP
system image. So inclusive rule is more suitable instead of exclusive rule
to avoid unexpected regression due to unnecessary RRO conversion.

Note that we still support conversion for all the overlays by specifying
PRODUCT_ENFORCE_RRO_TARGETS as "*".

Test: building succeeded and tested with auto-generated RROs.
Bug: 36231603
Change-Id: I8e1d701d4f78b818c89ef3e7638110105370c5bc
(cherry picked from commit 2a209997e8)
This commit is contained in:
Jaekyun Seok 2017-03-30 11:25:02 +09:00
parent 41febee0cc
commit 1b2242895e
4 changed files with 13 additions and 6 deletions

View File

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

View File

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

View File

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

View File

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