Merge "Make RRO packages for system_ext" into rvc-dev

This commit is contained in:
TreeHugger Robot 2020-04-23 01:25:48 +00:00 committed by Android (Google) Code Review
commit c0f3be1309
4 changed files with 17 additions and 4 deletions

View File

@ -100,19 +100,19 @@ include $(BUILD_SYSTEM)/support_libraries.mk
# Determine whether auto-RRO is enabled for this package.
enforce_rro_enabled :=
ifneq (,$(filter *, $(PRODUCT_ENFORCE_RRO_TARGETS)))
# * means all system APKs, so enable conditionally based on module path.
# * means all system and system_ext APKs, so enable conditionally based on module path.
# Note that modules in PRODUCT_ENFORCE_RRO_EXEMPTED_TARGETS are excluded even if it is '*'
# Note that base_rules.mk has not yet been included, so it's likely that only
# one of LOCAL_MODULE_PATH and the LOCAL_X_MODULE flags has been set.
ifeq (,$(LOCAL_MODULE_PATH))
non_system_module := $(filter true,\
non_rro_target_module := $(filter true,\
$(LOCAL_ODM_MODULE) \
$(LOCAL_OEM_MODULE) \
$(LOCAL_PRODUCT_MODULE) \
$(LOCAL_SYSTEM_EXT_MODULE) \
$(LOCAL_PROPRIETARY_MODULE) \
$(LOCAL_VENDOR_MODULE))
enforce_rro_enabled := $(if $(non_system_module),,true)
enforce_rro_enabled := $(if $(non_rro_target_module),,true)
else ifneq ($(filter $(TARGET_OUT)/%,$(LOCAL_MODULE_PATH)),)
enforce_rro_enabled := true
endif
@ -120,6 +120,12 @@ else ifneq (,$(filter $(LOCAL_PACKAGE_NAME), $(PRODUCT_ENFORCE_RRO_TARGETS)))
enforce_rro_enabled := true
endif
# TODO(b/150820813) Some modules depend on static overlay, remove this after eliminating the dependency.
ifneq (,$(filter $(LOCAL_PACKAGE_NAME), $(PRODUCT_ENFORCE_RRO_EXEMPTED_TARGETS)))
enforce_rro_enabled :=
endif
product_package_overlays := $(strip \
$(wildcard $(foreach dir, $(PRODUCT_PACKAGE_OVERLAYS), \
$(addprefix $(dir)/, $(LOCAL_RESOURCE_DIR)))))

View File

@ -193,6 +193,9 @@ _product_list_vars += PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS
# Package list to apply enforcing RRO.
_product_list_vars += PRODUCT_ENFORCE_RRO_TARGETS
# Packages to skip auto-generating RROs for when PRODUCT_ENFORCE_RRO_TARGETS is set to *.
_product_list_vars += PRODUCT_ENFORCE_RRO_EXEMPTED_TARGETS
_product_list_vars += PRODUCT_SDK_ATREE_FILES
_product_list_vars += PRODUCT_SDK_ADDON_NAME
_product_list_vars += PRODUCT_SDK_ADDON_COPY_FILES

View File

@ -80,6 +80,7 @@ $(call add_json_str, CrossHostSecondaryArch, $(HOST_CROSS_2ND_ARCH))
$(call add_json_list, DeviceResourceOverlays, $(DEVICE_PACKAGE_OVERLAYS))
$(call add_json_list, ProductResourceOverlays, $(PRODUCT_PACKAGE_OVERLAYS))
$(call add_json_list, EnforceRROTargets, $(PRODUCT_ENFORCE_RRO_TARGETS))
$(call add_json_list, EnforceRROExemptedTargets, $(PRODUCT_ENFORCE_RRO_EXEMPTED_TARGETS))
$(call add_json_list, EnforceRROExcludedOverlays, $(PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS))
$(call add_json_str, AAPTCharacteristics, $(TARGET_AAPT_CHARACTERISTICS))

View File

@ -120,6 +120,9 @@ PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true
PRODUCT_ENFORCE_RRO_TARGETS := *
# TODO(b/150820813) Settings depends on static overlay, remove this after eliminating the dependency.
PRODUCT_ENFORCE_RRO_EXEMPTED_TARGETS := Settings
PRODUCT_NAME := mainline_system
PRODUCT_BRAND := generic