blob: d31258f3d11e7784ba06aa168dbdba3d25d756e8 [file] [log] [blame]
Anton Hansson24c88f42019-12-13 16:17:27 +00001// Copyright (C) 2019 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15mainline_stubs_args =
16 "--error UnhiddenSystemApi " +
17 "--hide BroadcastBehavior " +
18 "--hide DeprecationMismatch " +
19 "--hide HiddenSuperclass " +
20 "--hide HiddenTypedefConstant " +
21 "--hide HiddenTypeParameter " +
22 "--hide MissingPermission " +
23 "--hide RequiresPermission " +
24 "--hide SdkConstant " +
25 "--hide Todo " +
26 "--hide Typo " +
27 "--hide UnavailableSymbol "
28
Anton Hansson26e1ed62020-03-23 13:30:01 +000029// TODO: remove the hiding when server classes are cleaned up.
30mainline_framework_stubs_args =
31 mainline_stubs_args +
32 "--hide-package com.android.server "
Anton Hansson5036ab62019-12-17 10:03:52 +000033
Anton Hanssona12addc2020-02-03 14:44:47 +000034priv_apps = " " +
35 "--show-annotation android.annotation.SystemApi\\(" +
Jiyong Park7f1e9b22020-02-25 17:12:30 +090036 "client=android.annotation.SystemApi.Client.PRIVILEGED_APPS" +
Anton Hanssona12addc2020-02-03 14:44:47 +000037 "\\) "
38
39module_libs = " " +
40 " --show-annotation android.annotation.SystemApi\\(" +
Jiyong Park7f1e9b22020-02-25 17:12:30 +090041 "client=android.annotation.SystemApi.Client.MODULE_LIBRARIES" +
Anton Hanssona12addc2020-02-03 14:44:47 +000042 "\\) "
43
Anton Hansson26e1ed62020-03-23 13:30:01 +000044mainline_service_stubs_args =
45 mainline_stubs_args +
46 "--show-annotation android.annotation.SystemApi\\(" +
47 "client=android.annotation.SystemApi.Client.SYSTEM_SERVER" +
48 "\\) " +
49 "--hide-annotation android.annotation.Hide " +
50 "--hide InternalClasses " // com.android.* classes are okay in this interface
51
Anton Hansson24c88f42019-12-13 16:17:27 +000052stubs_defaults {
53 name: "framework-module-stubs-defaults-publicapi",
Anton Hansson26e1ed62020-03-23 13:30:01 +000054 args: mainline_framework_stubs_args,
Anton Hansson24c88f42019-12-13 16:17:27 +000055 installable: false,
Anton Hansson4d90a282020-03-09 19:14:28 +000056 sdk_version: "current",
Anton Hansson5d708e52020-01-17 19:03:34 +000057 check_api: {
58 current: {
59 api_file: "api/current.txt",
60 removed_api_file: "api/removed.txt",
61 },
62 },
Anton Hansson24c88f42019-12-13 16:17:27 +000063}
64
65stubs_defaults {
66 name: "framework-module-stubs-defaults-systemapi",
Anton Hansson26e1ed62020-03-23 13:30:01 +000067 args: mainline_framework_stubs_args + priv_apps,
Anton Hansson397eb472020-03-13 16:28:21 +000068 libs: ["framework-annotations-lib"],
Jiyong Park7be934f2020-01-06 16:22:32 +090069 installable: false,
Anton Hansson4d90a282020-03-09 19:14:28 +000070 sdk_version: "system_current",
Anton Hansson5d708e52020-01-17 19:03:34 +000071 check_api: {
72 current: {
73 api_file: "api/system-current.txt",
74 removed_api_file: "api/system-removed.txt",
75 },
76 },
Jiyong Park7be934f2020-01-06 16:22:32 +090077}
78
Anton Hanssonc8cc1eb2020-03-24 17:03:15 +000079java_defaults {
80 name: "framework-module-stubs-lib-defaults-publicapi",
81 installable: false,
82 sdk_version: "module_current",
83}
84
85java_defaults {
86 name: "framework-module-stubs-lib-defaults-systemapi",
87 installable: false,
88 sdk_version: "module_current",
89}
90
91java_defaults {
92 name: "framework-module-stubs-lib-defaults-module_libs_api",
93 installable: false,
94 sdk_version: "module_current",
95}
96
Anton Hanssona12addc2020-02-03 14:44:47 +000097// The defaults for module_libs comes in two parts - defaults for API checks
98// and defaults for stub generation. This is because we want the API txt
99// files to *only* include the module_libs_api, but the stubs to include
100// module_libs_api as well as priv_apps.
101
Jiyong Park7be934f2020-01-06 16:22:32 +0900102stubs_defaults {
Anton Hanssona12addc2020-02-03 14:44:47 +0000103 name: "framework-module-api-defaults-module_libs_api",
Anton Hansson26e1ed62020-03-23 13:30:01 +0000104 args: mainline_framework_stubs_args + module_libs,
Anton Hansson397eb472020-03-13 16:28:21 +0000105 libs: ["framework-annotations-lib"],
Jiyong Park7be934f2020-01-06 16:22:32 +0900106 installable: false,
Anton Hansson4d90a282020-03-09 19:14:28 +0000107 sdk_version: "module_current",
Anton Hansson5d708e52020-01-17 19:03:34 +0000108 check_api: {
109 current: {
110 api_file: "api/module-lib-current.txt",
111 removed_api_file: "api/module-lib-removed.txt",
112 },
113 },
Jiyong Park7be934f2020-01-06 16:22:32 +0900114}
115
116stubs_defaults {
117 name: "framework-module-stubs-defaults-module_libs_api",
Anton Hansson26e1ed62020-03-23 13:30:01 +0000118 args: mainline_framework_stubs_args + module_libs + priv_apps,
Anton Hansson397eb472020-03-13 16:28:21 +0000119 libs: ["framework-annotations-lib"],
Anton Hansson24c88f42019-12-13 16:17:27 +0000120 installable: false,
Anton Hansson4d90a282020-03-09 19:14:28 +0000121 sdk_version: "module_current",
Anton Hansson24c88f42019-12-13 16:17:27 +0000122}
Anton Hansson26e1ed62020-03-23 13:30:01 +0000123
124stubs_defaults {
125 name: "service-module-stubs-srcs-defaults",
126 args: mainline_service_stubs_args,
127 installable: false,
128 check_api: {
129 current: {
130 api_file: "api/current.txt",
131 removed_api_file: "api/removed.txt",
132 },
133 },
134}
135
136// Empty for now, but a convenient place to add rules for all
137// module java_library system_server stub libs.
138java_defaults {
139 name: "service-module-stubs-defaults",
140}