Enable apps to build with resource namespaces

Setting LOCAL_AAPT_NAMESPACES := true enables
namespaces for an app and requires any library resources
to be fully qualified by their package.

Test: manual
Bug: 73885582
Change-Id: Ia6bfc82ee8b8d6335f8e7c2abe94ce36467a012d
Merged-In: Ia6bfc82ee8b8d6335f8e7c2abe94ce36467a012d
This commit is contained in:
Adam Lesinski 2017-08-16 15:52:53 -07:00 committed by Colin Cross
parent a0c1cc97bd
commit 960de8efcd
3 changed files with 11 additions and 2 deletions

View file

@ -7,6 +7,7 @@ LOCAL_32_BIT_ONLY:=
LOCAL_AAPT2_ONLY:=
LOCAL_AAPT_FLAGS:=
LOCAL_AAPT_INCLUDE_ALL_RESOURCES:=
LOCAL_AAPT_NAMESPACES:=
LOCAL_ADDITIONAL_CERTIFICATES:=
LOCAL_ADDITIONAL_DEPENDENCIES:=
LOCAL_ADDITIONAL_HTML_DIR:=

View file

@ -407,8 +407,13 @@ endif # renderscript_target_api < 21
endif # renderscript_target_api is set
my_asset_dirs := $(LOCAL_ASSET_DIR)
my_full_asset_paths := $(all_assets)
# Add AAPT2 link specific flags.
$(my_res_package): PRIVATE_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS) --no-static-lib-packages
$(my_res_package): PRIVATE_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS)
ifndef LOCAL_AAPT_NAMESPACES
$(my_res_package): PRIVATE_AAPT_FLAGS += --no-static-lib-packages
endif
include $(BUILD_SYSTEM)/aapt2.mk
else # LOCAL_USE_AAPT2

View file

@ -131,7 +131,10 @@ endif
# add --non-constant-id to prevent inlining constants.
# AAR needs text symbol file R.txt.
ifdef LOCAL_USE_AAPT2
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS) --static-lib --no-static-lib-packages
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS) --static-lib
ifndef LOCAL_AAPT_NAMESPACES
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_AAPT_FLAGS += --no-static-lib-packages
endif
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_PRODUCT_AAPT_CONFIG :=
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_PRODUCT_AAPT_PREF_CONFIG :=
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_AAPT_CHARACTERISTICS :=