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
This commit is contained in:
David Brazdil 2018-08-28 12:28:38 +01:00
parent 7c76579e7a
commit b1082818b3
1 changed files with 6 additions and 2 deletions

View File

@ -58,10 +58,14 @@ my_exported_sdk_libs_file := $(call local-intermediates-dir,COMMON)/exported-sdk
$(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: $@"