Encode use of private API in manifest
If a package is declared to build directly against the platform,
this patch will invoke manifest_fixer.py to encode that information
in the manifest. This information is then used by the framework to
correctly configure the runtime process.
Bug: 113315999
Test: m StorageManager; aapt l -a StorageManager.apk|grep usesNonSdkApi
Change-Id: I53c9728d12380a01b35315fc9c58463e9f5a9f48
diff --git a/core/android_manifest.mk b/core/android_manifest.mk
index 13da10c..d1cfe15 100644
--- a/core/android_manifest.mk
+++ b/core/android_manifest.mk
@@ -58,10 +58,14 @@
$(fixed_android_manifest): PRIVATE_EXPORTED_SDK_LIBS_FILE := $(my_exported_sdk_libs_file)
$(fixed_android_manifest): $(my_exported_sdk_libs_file)
-$(fixed_android_manifest): PRIVATE_MANIFEST_FIXER_FLAGS :=
+my_manifest_fixer_flags :=
ifneq ($(LOCAL_MODULE_CLASS),APPS)
-$(fixed_android_manifest): PRIVATE_MANIFEST_FIXER_FLAGS := --library
+ my_manifest_fixer_flags += --library
endif
+ifeq ($(LOCAL_PRIVATE_PLATFORM_APIS),true)
+ my_manifest_fixer_flags += --uses-non-sdk-api
+endif
+$(fixed_android_manifest): PRIVATE_MANIFEST_FIXER_FLAGS := $(my_manifest_fixer_flags)
$(fixed_android_manifest): $(MANIFEST_FIXER)
$(fixed_android_manifest): $(main_android_manifest)
@echo "Fix manifest: $@"