From 96e973b304e6909fd474e807acd46be051a4acb7 Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Fri, 14 Dec 2018 16:10:09 +0000 Subject: [PATCH] hiddenapi: Process core.platform.api.stubs Pass @CorePlatformApi stubs to the `hiddenapi` singleton rule which generate a CSV of all public or domain API flags. Bug: 119068555 Test: m appcompat Test: dexlayout | grep CORE-PLATFORM-API Change-Id: I597ee330835e564d61cfac44497e762b552b901c --- core/dex_preopt.mk | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk index 19cffda9a..ab06375a2 100644 --- a/core/dex_preopt.mk +++ b/core/dex_preopt.mk @@ -47,6 +47,10 @@ HIDDENAPI_STUBS_SYSTEM := \ HIDDENAPI_STUBS_TEST := \ $(call hiddenapi_stubs_jar,android_test_stubs_current) +# Core Platform API stubs +HIDDENAPI_STUBS_CORE_PLATFORM := \ + $(call hiddenapi_stubs_jar,core.platform.api.stubs) + # Allow products to define their own stubs for custom product jars that apps can use. ifdef PRODUCT_HIDDENAPI_STUBS HIDDENAPI_STUBS += $(foreach stub,$(PRODUCT_HIDDENAPI_STUBS), $(call hiddenapi_stubs_jar,$(stub))) @@ -68,14 +72,17 @@ $(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS): PRIVATE_DEX_INPUTS := $(SOONG_HIDDENA $(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS): PRIVATE_HIDDENAPI_STUBS := $(HIDDENAPI_STUBS) $(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS): PRIVATE_HIDDENAPI_STUBS_SYSTEM := $(HIDDENAPI_STUBS_SYSTEM) $(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS): PRIVATE_HIDDENAPI_STUBS_TEST := $(HIDDENAPI_STUBS_TEST) +$(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS): PRIVATE_HIDDENAPI_STUBS_CORE_PLATFORM := $(HIDDENAPI_STUBS_CORE_PLATFORM) $(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS): $(HIDDENAPI) $(HIDDENAPI_STUBS) \ - $(HIDDENAPI_STUBS_SYSTEM) $(HIDDENAPI_STUBS_TEST) + $(HIDDENAPI_STUBS_SYSTEM) $(HIDDENAPI_STUBS_TEST) \ + $(HIDDENAPI_STUBS_CORE_PLATFORM) for INPUT_DEX in $(PRIVATE_DEX_INPUTS); do \ find `dirname $${INPUT_DEX}` -maxdepth 1 -name "classes*.dex"; \ done | sort | sed 's/^/--boot-dex=/' | xargs $(HIDDENAPI) list \ --public-stub-classpath=$(call normalize-path-list, $(PRIVATE_HIDDENAPI_STUBS)) \ --public-stub-classpath=$(call normalize-path-list, $(PRIVATE_HIDDENAPI_STUBS_SYSTEM)) \ --public-stub-classpath=$(call normalize-path-list, $(PRIVATE_HIDDENAPI_STUBS_TEST)) \ + --core-platform-stub-classpath=$(call normalize-path-list, $(PRIVATE_HIDDENAPI_STUBS_CORE_PLATFORM)) \ --out-api-flags=$(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS).tmp $(call commit-change-for-toc,$(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS))