diff --git a/core/clear_vars.mk b/core/clear_vars.mk index fc6b83c6d..1022693cc 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -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:= diff --git a/core/package_internal.mk b/core/package_internal.mk index 0938c991f..b731bfaa3 100644 --- a/core/package_internal.mk +++ b/core/package_internal.mk @@ -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 diff --git a/core/static_java_library.mk b/core/static_java_library.mk index 77bb498e9..d92d8c086 100644 --- a/core/static_java_library.mk +++ b/core/static_java_library.mk @@ -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 :=