From 038177ba555070a5468fbd59a5d341ee0f5f5977 Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Tue, 29 Jan 2019 15:01:06 +0000 Subject: [PATCH] Exempt some RROs from building against SDK If an RRO is depending on the source module to import its resources, this trips up the link check because the source module may not be building against the SDK. Exempt these RROs from the rule. Bug: 123510624 Test: m Change-Id: Ie0e05ce6d31dd3a0eafb14ace426da2bc15fb740 --- core/generate_enforce_rro.mk | 10 +++++++--- core/local_systemsdk.mk | 5 ++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/core/generate_enforce_rro.mk b/core/generate_enforce_rro.mk index c88c779313..1bec6c3e84 100644 --- a/core/generate_enforce_rro.mk +++ b/core/generate_enforce_rro.mk @@ -27,10 +27,14 @@ LOCAL_CERTIFICATE := platform LOCAL_AAPT_FLAGS += --auto-add-overlay LOCAL_RESOURCE_DIR := $(enforce_rro_source_overlays) -ifeq (framework-res__auto_generated_rro,$(enforce_rro_module)) -LOCAL_PRIVATE_PLATFORM_APIS := true +ifneq (,$(LOCAL_RES_LIBRARIES)) + # Technically we are linking against the app (if only to grab its resources), + # and because it's potentially not building against the SDK, we can't either. + LOCAL_PRIVATE_PLATFORM_APIS := true +else ifeq (framework-res__auto_generated_rro,$(enforce_rro_module)) + LOCAL_PRIVATE_PLATFORM_APIS := true else -LOCAL_SDK_VERSION := current + LOCAL_SDK_VERSION := current endif include $(BUILD_RRO_PACKAGE) diff --git a/core/local_systemsdk.mk b/core/local_systemsdk.mk index 7acb57afb6..0f1271f831 100644 --- a/core/local_systemsdk.mk +++ b/core/local_systemsdk.mk @@ -25,9 +25,8 @@ ifdef BOARD_SYSTEMSDK_VERSIONS ifneq (,$(filter JAVA_LIBRARIES APPS,$(LOCAL_MODULE_CLASS))) ifndef LOCAL_SDK_VERSION ifeq ($(_is_vendor_app),true) - ifeq (,$(filter framework-res__auto_generated_rro,$(LOCAL_MODULE))) - # Runtime resource overlay for framework-res is exempted from building - # against System SDK. + ifeq (,$(filter %__auto_generated_rro,$(LOCAL_MODULE))) + # Runtime resource overlays are exempted from building against System SDK. # TODO(b/35859726): remove this exception LOCAL_SDK_VERSION := system_current endif