From 0a6553cc6fa8b8ef433106fd1c3bfcbfbd6d02cd Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Tue, 2 Jun 2020 17:48:57 +0100 Subject: [PATCH] Switch service-permissions to java_sdk_library (partial cherry-pick) Previously, the droidstubs generated the system-server API into the current.txt and removed.txt files which are usually associated with the public API surface. This change moves that specification into the system-server....txt files and verifies that no public APIs are leaking into the stubs. Bug: 155164730 Test: m java Merged-In: I907533c36dcb6c0ef679b0098d497d88476d8b95 Change-Id: I907533c36dcb6c0ef679b0098d497d88476d8b95 --- apex/Android.bp | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/apex/Android.bp b/apex/Android.bp index 388b24a4d5f59..6eaf89c589654 100644 --- a/apex/Android.bp +++ b/apex/Android.bp @@ -66,9 +66,9 @@ mainline_service_stubs_args = "--hide-annotation android.annotation.Hide " + "--hide InternalClasses " // com.android.* classes are okay in this interface -// Defaults for mainline module provided java_sdk_library instances. +// Defaults common to all mainline module java_sdk_library instances. java_defaults { - name: "framework-module-defaults", + name: "framework-module-common-defaults", // Additional annotations used for compiling both the implementation and the // stubs libraries. @@ -95,14 +95,6 @@ java_defaults { enabled: true, sdk_version: "module_current", }, - system: { - enabled: true, - sdk_version: "module_current", - }, - module_lib: { - enabled: true, - sdk_version: "module_current", - }, // Configure framework module specific metalava options. droiddoc_options: [mainline_stubs_args], @@ -132,6 +124,32 @@ java_defaults { sdk_version: "module_current", } +// Defaults for mainline module provided java_sdk_library instances. +java_defaults { + name: "framework-module-defaults", + defaults: ["framework-module-common-defaults"], + + system: { + enabled: true, + sdk_version: "module_current", + }, + module_lib: { + enabled: true, + sdk_version: "module_current", + }, +} + +// Defaults for mainline module system server provided java_sdk_library instances. +java_defaults { + name: "framework-system-server-module-defaults", + defaults: ["framework-module-common-defaults"], + + system_server: { + enabled: true, + sdk_version: "module_current", + }, +} + stubs_defaults { name: "framework-module-stubs-defaults-publicapi", args: mainline_framework_stubs_args,