Anton Hansson | fcb91d4 | 2020-09-21 16:32:14 +0100 | [diff] [blame] | 1 | // Copyright (C) 2020 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 | |
| 15 | package { |
| 16 | default_visibility: ["//visibility:private"], |
Bob Badour | 8a6a2bc | 2021-02-12 17:07:05 -0800 | [diff] [blame] | 17 | // See: http://go/android-license-faq |
| 18 | // A large-scale-change added 'default_applicable_licenses' to import |
| 19 | // all of the 'license_kinds' from "frameworks_base_license" |
| 20 | // to get the below license kinds: |
| 21 | // SPDX-license-identifier-Apache-2.0 |
| 22 | // SPDX-license-identifier-MIT |
| 23 | // SPDX-license-identifier-Unicode-DFS |
| 24 | default_applicable_licenses: ["frameworks_base_license"], |
Anton Hansson | fcb91d4 | 2020-09-21 16:32:14 +0100 | [diff] [blame] | 25 | } |
| 26 | |
Anton Hansson | 0860aaf | 2021-10-08 16:48:03 +0100 | [diff] [blame] | 27 | bootstrap_go_package { |
| 28 | name: "soong-api", |
| 29 | pkgPath: "android/soong/api", |
| 30 | deps: [ |
| 31 | "blueprint", |
| 32 | "soong", |
| 33 | "soong-android", |
| 34 | "soong-genrule", |
Anton Hansson | 47ff71a | 2022-01-13 09:45:12 +0000 | [diff] [blame] | 35 | "soong-java", |
Anton Hansson | 0860aaf | 2021-10-08 16:48:03 +0100 | [diff] [blame] | 36 | ], |
| 37 | srcs: ["api.go"], |
| 38 | pluginFor: ["soong_build"], |
| 39 | } |
| 40 | |
Anton Hansson | e673784 | 2021-09-27 12:18:20 +0100 | [diff] [blame] | 41 | python_binary_host { |
Anton Hansson | e673784 | 2021-09-27 12:18:20 +0100 | [diff] [blame] | 42 | name: "merge_annotation_zips", |
| 43 | srcs: ["merge_annotation_zips.py"], |
Anton Hansson | e673784 | 2021-09-27 12:18:20 +0100 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | python_test_host { |
| 47 | name: "merge_annotation_zips_test", |
| 48 | main: "merge_annotation_zips_test.py", |
| 49 | srcs: [ |
| 50 | "merge_annotation_zips.py", |
| 51 | "merge_annotation_zips_test.py", |
| 52 | ], |
Anton Hansson | e673784 | 2021-09-27 12:18:20 +0100 | [diff] [blame] | 53 | test_options: { |
| 54 | unit_test: true, |
Pedro Loureiro | b91f45d | 2021-05-26 15:50:07 +0000 | [diff] [blame] | 55 | }, |
| 56 | } |
| 57 | |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 58 | metalava_cmd = "$(location metalava)" |
| 59 | // Silence reflection warnings. See b/168689341 |
| 60 | metalava_cmd += " -J--add-opens=java.base/java.util=ALL-UNNAMED " |
Paul Duffin | aab881d | 2023-07-11 23:22:52 +0100 | [diff] [blame] | 61 | metalava_cmd += " --quiet " |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 62 | |
Harshit Mahajan | 919593c | 2024-01-17 15:52:22 +0000 | [diff] [blame] | 63 | soong_config_module_type { |
| 64 | name: "enable_crashrecovery_module", |
| 65 | module_type: "combined_apis_defaults", |
| 66 | config_namespace: "ANDROID", |
| 67 | bool_variables: ["release_crashrecovery_module"], |
| 68 | properties: [ |
| 69 | "bootclasspath", |
| 70 | "system_server_classpath", |
| 71 | ], |
| 72 | } |
| 73 | |
| 74 | soong_config_bool_variable { |
| 75 | name: "release_crashrecovery_module", |
| 76 | } |
| 77 | |
| 78 | enable_crashrecovery_module { |
| 79 | name: "crashrecovery_module_defaults", |
| 80 | soong_config_variables: { |
| 81 | release_crashrecovery_module: { |
| 82 | bootclasspath: [ |
| 83 | "framework-crashrecovery", |
| 84 | ], |
| 85 | system_server_classpath: [ |
| 86 | "service-crashrecovery", |
| 87 | ], |
| 88 | }, |
| 89 | }, |
| 90 | } |
| 91 | |
Anton Hansson | 648e609 | 2022-01-11 16:37:05 +0000 | [diff] [blame] | 92 | combined_apis { |
| 93 | name: "frameworks-base-api", |
Harshit Mahajan | 919593c | 2024-01-17 15:52:22 +0000 | [diff] [blame] | 94 | defaults: [ |
| 95 | "crashrecovery_module_defaults", |
| 96 | ], |
Anton Hansson | 648e609 | 2022-01-11 16:37:05 +0000 | [diff] [blame] | 97 | bootclasspath: [ |
| 98 | "android.net.ipsec.ike", |
| 99 | "art.module.public.api", |
| 100 | "conscrypt.module.public.api", |
Neha Pattan | fa46dd2 | 2022-02-18 19:46:09 +0000 | [diff] [blame] | 101 | "framework-adservices", |
Anton Hansson | 648e609 | 2022-01-11 16:37:05 +0000 | [diff] [blame] | 102 | "framework-appsearch", |
Roopa Sattiraju | 8e30577 | 2022-01-20 10:05:19 -0800 | [diff] [blame] | 103 | "framework-bluetooth", |
Hassan Ali | 482f91c | 2022-10-05 13:16:23 +0000 | [diff] [blame] | 104 | "framework-configinfrastructure", |
Anton Hansson | 648e609 | 2022-01-11 16:37:05 +0000 | [diff] [blame] | 105 | "framework-connectivity", |
paulhu | e074dd2e | 2022-02-08 21:23:06 +0800 | [diff] [blame] | 106 | "framework-connectivity-t", |
Amos Bianchi | 62e8cf3 | 2022-08-02 15:42:30 -0700 | [diff] [blame] | 107 | "framework-devicelock", |
Anton Hansson | 648e609 | 2022-01-11 16:37:05 +0000 | [diff] [blame] | 108 | "framework-graphics", |
ronish | fc97db5 | 2023-02-07 17:57:48 +0000 | [diff] [blame] | 109 | "framework-healthfitness", |
Mark White | 9ee1866 | 2023-08-07 11:18:09 +0000 | [diff] [blame] | 110 | "framework-location", |
Anton Hansson | 648e609 | 2022-01-11 16:37:05 +0000 | [diff] [blame] | 111 | "framework-media", |
| 112 | "framework-mediaprovider", |
Roshan Pius | 354b10b | 2023-11-14 14:30:26 -0800 | [diff] [blame] | 113 | "framework-nfc", |
Frank Wang | e97ff9e | 2022-02-13 07:06:31 +0000 | [diff] [blame] | 114 | "framework-ondevicepersonalization", |
Alyssa Ketpreechasawat | 468a6f7 | 2023-11-08 16:03:53 +0000 | [diff] [blame] | 115 | "framework-pdf", |
Nishant Panwar | 81c51cf | 2024-02-10 09:12:06 +0000 | [diff] [blame] | 116 | "framework-pdf-v", |
Anton Hansson | 648e609 | 2022-01-11 16:37:05 +0000 | [diff] [blame] | 117 | "framework-permission", |
| 118 | "framework-permission-s", |
Yisroel Forta | b0540e8 | 2024-01-30 16:22:06 +0000 | [diff] [blame] | 119 | "framework-profiling", |
Anton Hansson | 648e609 | 2022-01-11 16:37:05 +0000 | [diff] [blame] | 120 | "framework-scheduling", |
| 121 | "framework-sdkextensions", |
| 122 | "framework-statsd", |
Nikita Ioffe | 59029ad | 2022-02-24 01:56:44 +0000 | [diff] [blame] | 123 | "framework-sdksandbox", |
Anton Hansson | 648e609 | 2022-01-11 16:37:05 +0000 | [diff] [blame] | 124 | "framework-tethering", |
| 125 | "framework-uwb", |
Nikita Ioffe | d3f0a6f | 2022-11-15 11:26:53 +0000 | [diff] [blame] | 126 | "framework-virtualization", |
Anton Hansson | 648e609 | 2022-01-11 16:37:05 +0000 | [diff] [blame] | 127 | "framework-wifi", |
| 128 | "i18n.module.public.api", |
Anton Hansson | 85359f6 | 2020-09-21 17:02:25 +0100 | [diff] [blame] | 129 | ], |
Anton Hansson | 648e609 | 2022-01-11 16:37:05 +0000 | [diff] [blame] | 130 | system_server_classpath: [ |
Jiakai Zhang | 1489e0d | 2022-06-17 12:17:40 +0100 | [diff] [blame] | 131 | "service-art", |
Hassan Ali | f237063 | 2022-12-07 19:22:30 +0000 | [diff] [blame] | 132 | "service-configinfrastructure", |
ronish | fc97db5 | 2023-02-07 17:57:48 +0000 | [diff] [blame] | 133 | "service-healthfitness", |
Anton Hansson | 648e609 | 2022-01-11 16:37:05 +0000 | [diff] [blame] | 134 | "service-media-s", |
| 135 | "service-permission", |
Seth Moore | 0277b66 | 2022-10-20 14:14:39 -0700 | [diff] [blame] | 136 | "service-rkp", |
Nikita Ioffe | 59029ad | 2022-02-24 01:56:44 +0000 | [diff] [blame] | 137 | "service-sdksandbox", |
Anton Hansson | a9ced80 | 2020-10-20 19:26:18 +0100 | [diff] [blame] | 138 | ], |
Anton Hansson | 85359f6 | 2020-09-21 17:02:25 +0100 | [diff] [blame] | 139 | } |
| 140 | |
| 141 | genrule { |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 142 | name: "frameworks-base-api-current-compat", |
| 143 | srcs: [ |
| 144 | ":android.api.public.latest", |
| 145 | ":android-incompatibilities.api.public.latest", |
| 146 | ":frameworks-base-api-current.txt", |
| 147 | ], |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 148 | out: ["updated-baseline.txt"], |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 149 | tools: ["metalava"], |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 150 | cmd: metalava_cmd + |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 151 | "--check-compatibility:api:released $(location :android.api.public.latest) " + |
| 152 | "--baseline:compatibility:released $(location :android-incompatibilities.api.public.latest) " + |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 153 | "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " + |
| 154 | "$(location :frameworks-base-api-current.txt)", |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 155 | } |
| 156 | |
| 157 | genrule { |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 158 | name: "frameworks-base-api-system-current-compat", |
| 159 | srcs: [ |
| 160 | ":android.api.system.latest", |
| 161 | ":android-incompatibilities.api.system.latest", |
| 162 | ":frameworks-base-api-current.txt", |
| 163 | ":frameworks-base-api-system-current.txt", |
| 164 | ], |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 165 | out: ["updated-baseline.txt"], |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 166 | tools: ["metalava"], |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 167 | cmd: metalava_cmd + |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 168 | "--check-compatibility:api:released $(location :android.api.system.latest) " + |
| 169 | "--check-compatibility:base $(location :frameworks-base-api-current.txt) " + |
| 170 | "--baseline:compatibility:released $(location :android-incompatibilities.api.system.latest) " + |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 171 | "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " + |
| 172 | "$(location :frameworks-base-api-system-current.txt)", |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 173 | } |
| 174 | |
| 175 | genrule { |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 176 | name: "frameworks-base-api-module-lib-current-compat", |
| 177 | srcs: [ |
| 178 | ":android.api.module-lib.latest", |
| 179 | ":android-incompatibilities.api.module-lib.latest", |
| 180 | ":frameworks-base-api-current.txt", |
| 181 | ":frameworks-base-api-module-lib-current.txt", |
| 182 | ], |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 183 | out: ["updated-baseline.txt"], |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 184 | tools: ["metalava"], |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 185 | cmd: metalava_cmd + |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 186 | "--check-compatibility:api:released $(location :android.api.module-lib.latest) " + |
| 187 | // Note: having "public" be the base of module-lib is not perfect -- it should |
Anton Hansson | 9d34e31 | 2022-02-23 11:24:00 +0000 | [diff] [blame] | 188 | // ideally be a merged public+system (which metalava is not currently able to generate). |
| 189 | // This "base" will help when migrating from MODULE_LIBS -> public, but not when |
| 190 | // migrating from MODULE_LIBS -> system (where it needs to instead be listed as |
| 191 | // an incompatibility). |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 192 | "--check-compatibility:base $(location :frameworks-base-api-current.txt) " + |
| 193 | "--baseline:compatibility:released $(location :android-incompatibilities.api.module-lib.latest) " + |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 194 | "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " + |
| 195 | "$(location :frameworks-base-api-module-lib-current.txt)", |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 196 | } |
| 197 | |
Anton Hansson | a934428 | 2023-02-15 14:52:28 +0000 | [diff] [blame] | 198 | genrule { |
| 199 | name: "frameworks-base-api-current.srcjar", |
| 200 | tools: ["merge_zips"], |
| 201 | out: ["current.srcjar"], |
| 202 | cmd: "$(location merge_zips) $(out) $(in)", |
| 203 | srcs: [ |
Jihoon Kang | f1f72ca | 2024-02-06 00:09:38 +0000 | [diff] [blame] | 204 | ":api-stubs-docs-non-updatable{.exportable}", |
Anton Hansson | a934428 | 2023-02-15 14:52:28 +0000 | [diff] [blame] | 205 | ":all-modules-public-stubs-source", |
| 206 | ], |
| 207 | visibility: ["//visibility:private"], // Used by make module in //development, mind |
| 208 | } |
| 209 | |
Anton Hansson | 0c5d9ab | 2022-06-23 07:58:51 +0000 | [diff] [blame] | 210 | // This produces the same annotations.zip as framework-doc-stubs, but by using |
| 211 | // outputs from individual modules instead of all the source code. |
Anton Hansson | 74b1564 | 2022-06-23 08:27:23 +0000 | [diff] [blame] | 212 | genrule_defaults { |
| 213 | name: "sdk-annotations-defaults", |
Anton Hansson | 0c5d9ab | 2022-06-23 07:58:51 +0000 | [diff] [blame] | 214 | out: ["annotations.zip"], |
| 215 | tools: [ |
| 216 | "merge_annotation_zips", |
| 217 | "soong_zip", |
| 218 | ], |
| 219 | cmd: "$(location merge_annotation_zips) $(genDir)/out $(in) && " + |
| 220 | "$(location soong_zip) -o $(out) -C $(genDir)/out -D $(genDir)/out", |
| 221 | } |
| 222 | |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 223 | genrule { |
Anton Hansson | 74b1564 | 2022-06-23 08:27:23 +0000 | [diff] [blame] | 224 | name: "sdk-annotations.zip", |
| 225 | defaults: ["sdk-annotations-defaults"], |
| 226 | srcs: [ |
Jihoon Kang | 2a829bb | 2024-02-01 22:01:15 +0000 | [diff] [blame] | 227 | ":android-non-updatable-doc-stubs{.exportable.annotations.zip}", |
Anton Hansson | 74b1564 | 2022-06-23 08:27:23 +0000 | [diff] [blame] | 228 | ":all-modules-public-annotations", |
| 229 | ], |
| 230 | } |
| 231 | |
| 232 | genrule { |
| 233 | name: "sdk-annotations-system.zip", |
| 234 | defaults: ["sdk-annotations-defaults"], |
| 235 | srcs: [ |
Jihoon Kang | 2a829bb | 2024-02-01 22:01:15 +0000 | [diff] [blame] | 236 | ":android-non-updatable-doc-stubs-system{.exportable.annotations.zip}", |
Anton Hansson | 74b1564 | 2022-06-23 08:27:23 +0000 | [diff] [blame] | 237 | ":all-modules-system-annotations", |
| 238 | ], |
| 239 | } |
| 240 | |
| 241 | genrule { |
Cole Faust | dcda370 | 2022-10-04 14:46:35 -0700 | [diff] [blame] | 242 | name: "sdk-annotations-module-lib.zip", |
| 243 | defaults: ["sdk-annotations-defaults"], |
| 244 | srcs: [ |
Jihoon Kang | 2a829bb | 2024-02-01 22:01:15 +0000 | [diff] [blame] | 245 | ":android-non-updatable-doc-stubs-module-lib{.exportable.annotations.zip}", |
Cole Faust | dcda370 | 2022-10-04 14:46:35 -0700 | [diff] [blame] | 246 | ":all-modules-module-lib-annotations", |
| 247 | ], |
| 248 | } |
| 249 | |
| 250 | genrule { |
| 251 | name: "sdk-annotations-system-server.zip", |
| 252 | defaults: ["sdk-annotations-defaults"], |
| 253 | srcs: [ |
Jihoon Kang | 2a829bb | 2024-02-01 22:01:15 +0000 | [diff] [blame] | 254 | ":android-non-updatable-doc-stubs-system-server{.exportable.annotations.zip}", |
Cole Faust | dcda370 | 2022-10-04 14:46:35 -0700 | [diff] [blame] | 255 | ":all-modules-system-server-annotations", |
| 256 | ], |
| 257 | } |
| 258 | |
| 259 | genrule { |
Anton Hansson | a15427a | 2020-10-02 18:21:14 +0100 | [diff] [blame] | 260 | name: "combined-removed-dex", |
Paul Duffin | 81af1f5 | 2021-04-08 19:22:50 +0100 | [diff] [blame] | 261 | visibility: [ |
| 262 | "//frameworks/base/boot", |
| 263 | ], |
Anton Hansson | a15427a | 2020-10-02 18:21:14 +0100 | [diff] [blame] | 264 | srcs: [ |
Anton Hansson | 1c4fab4 | 2020-11-02 11:57:33 +0000 | [diff] [blame] | 265 | ":frameworks-base-api-removed.txt", |
| 266 | ":frameworks-base-api-system-removed.txt", |
Anton Hansson | a15427a | 2020-10-02 18:21:14 +0100 | [diff] [blame] | 267 | ":android.car-stubs-docs{.removed-api.txt}", |
| 268 | ":android.car-system-stubs-docs{.removed-api.txt}", |
| 269 | ], |
| 270 | tool_files: ["gen_combined_removed_dex.sh"], |
| 271 | tools: ["metalava"], |
| 272 | out: ["combined-removed-dex.txt"], |
| 273 | cmd: "$(location gen_combined_removed_dex.sh) $(location metalava) $(genDir) $(in) > $(out)", |
| 274 | } |
Zi Wang | 9a26363 | 2023-03-06 23:00:57 -0800 | [diff] [blame] | 275 | |
| 276 | java_genrule { |
| 277 | name: "api_fingerprint", |
| 278 | srcs: [ |
| 279 | ":frameworks-base-api-current.txt", |
| 280 | ":frameworks-base-api-system-current.txt", |
| 281 | ":frameworks-base-api-module-lib-current.txt", |
| 282 | ":frameworks-base-api-system-server-current.txt", |
| 283 | ], |
| 284 | out: ["api_fingerprint.txt"], |
| 285 | cmd: "cat $(in) | md5sum | cut -d' ' -f1 > $(out)", |
| 286 | } |
Anton Hansson | 19fcec6 | 2023-05-02 08:57:12 +0000 | [diff] [blame] | 287 | |
Anton Hansson | 33f7f26 | 2023-11-01 10:42:12 +0000 | [diff] [blame] | 288 | packages_to_document = [ |
| 289 | "android", |
| 290 | "dalvik", |
| 291 | "java", |
| 292 | "javax", |
| 293 | "junit", |
| 294 | "org.apache.http", |
| 295 | "org.json", |
| 296 | "org.w3c.dom", |
| 297 | "org.xml.sax", |
| 298 | "org.xmlpull", |
| 299 | ] |
| 300 | |
| 301 | // Defaults for all stubs that include the non-updatable framework. These defaults do not include |
| 302 | // module symbols, so will not compile correctly on their own. Users must add module APIs to the |
| 303 | // classpath (or sources) somehow. |
| 304 | stubs_defaults { |
| 305 | name: "android-non-updatable-stubs-defaults", |
Jihoon Kang | 25d562e | 2024-02-13 23:30:42 +0000 | [diff] [blame] | 306 | aconfig_declarations: ["framework-minus-apex-aconfig-declarations"], |
Anton Hansson | 33f7f26 | 2023-11-01 10:42:12 +0000 | [diff] [blame] | 307 | srcs: [":android-non-updatable-stub-sources"], |
| 308 | sdk_version: "none", |
| 309 | system_modules: "none", |
| 310 | java_version: "1.8", |
| 311 | arg_files: [":frameworks-base-core-AndroidManifest.xml"], |
| 312 | aidl: { |
| 313 | include_dirs: [ |
| 314 | "frameworks/av/aidl", |
| 315 | "frameworks/base/media/aidl", |
| 316 | "frameworks/base/telephony/java", |
| 317 | "frameworks/native/libs/permission/aidl", |
| 318 | "packages/modules/Bluetooth/framework/aidl-export", |
| 319 | "packages/modules/Connectivity/framework/aidl-export", |
| 320 | "packages/modules/Media/apex/aidl/stable", |
| 321 | "hardware/interfaces/biometrics/common/aidl", |
| 322 | "hardware/interfaces/biometrics/fingerprint/aidl", |
| 323 | "hardware/interfaces/graphics/common/aidl", |
| 324 | "hardware/interfaces/keymaster/aidl", |
| 325 | "system/hardware/interfaces/media/aidl", |
| 326 | ], |
| 327 | }, |
| 328 | // These are libs from framework-internal-utils that are required (i.e. being referenced) |
| 329 | // from framework-non-updatable-sources. Add more here when there's a need. |
| 330 | // DO NOT add the entire framework-internal-utils. It might cause unnecessary circular |
| 331 | // dependencies gets bigger. |
| 332 | libs: [ |
| 333 | "android.hardware.cas-V1.2-java", |
| 334 | "android.hardware.health-V1.0-java-constants", |
| 335 | "android.hardware.thermal-V1.0-java-constants", |
| 336 | "android.hardware.thermal-V2.0-java", |
| 337 | "android.hardware.tv.input-V1.0-java-constants", |
| 338 | "android.hardware.usb-V1.0-java-constants", |
| 339 | "android.hardware.usb-V1.1-java-constants", |
| 340 | "android.hardware.usb.gadget-V1.0-java", |
| 341 | "android.hardware.vibrator-V1.3-java", |
| 342 | "framework-protos", |
| 343 | ], |
| 344 | flags: [ |
Anton Hansson | 33f7f26 | 2023-11-01 10:42:12 +0000 | [diff] [blame] | 345 | "--error NoSettingsProvider", |
| 346 | "--error UnhiddenSystemApi", |
| 347 | "--error UnflaggedApi", |
| 348 | "--force-convert-to-warning-nullability-annotations +*:-android.*:+android.icu.*:-dalvik.*", |
Anton Hansson | 25c8ca6 | 2023-10-27 14:57:30 +0000 | [diff] [blame] | 349 | // Disable CallbackInterface, as Java 8 default interface methods avoid the extensibility |
| 350 | // issue interfaces had previously. |
Anton Hansson | 33f7f26 | 2023-11-01 10:42:12 +0000 | [diff] [blame] | 351 | "--hide CallbackInterface", |
Anton Hansson | 25c8ca6 | 2023-10-27 14:57:30 +0000 | [diff] [blame] | 352 | // Disable HiddenSuperclass, as Metalava handles this fine (it should be hidden by default) |
Anton Hansson | 33f7f26 | 2023-11-01 10:42:12 +0000 | [diff] [blame] | 353 | "--hide HiddenSuperclass", |
Anton Hansson | 33f7f26 | 2023-11-01 10:42:12 +0000 | [diff] [blame] | 354 | "--hide-package android.audio.policy.configuration.V7_0", |
| 355 | "--hide-package com.android.server", |
| 356 | "--manifest $(location :frameworks-base-core-AndroidManifest.xml)", |
| 357 | ], |
| 358 | filter_packages: packages_to_document, |
| 359 | high_mem: true, // Lots of sources => high memory use, see b/170701554 |
| 360 | installable: false, |
| 361 | annotations_enabled: true, |
| 362 | previous_api: ":android.api.public.latest", |
| 363 | merge_annotations_dirs: ["metalava-manual"], |
| 364 | defaults_visibility: ["//frameworks/base/api"], |
Jihoon Kang | 31cf274 | 2024-02-07 19:52:19 +0000 | [diff] [blame] | 365 | visibility: [ |
| 366 | "//frameworks/base/api", |
| 367 | "//frameworks/base/core/api", |
| 368 | ], |
Anton Hansson | 33f7f26 | 2023-11-01 10:42:12 +0000 | [diff] [blame] | 369 | } |
| 370 | |
Anton Hansson | 648b0db | 2023-11-06 19:24:42 +0000 | [diff] [blame] | 371 | // We resolve dependencies on APIs in modules by depending on a prebuilt of the whole |
| 372 | // platform (sdk_system_current_android). That prebuilt does not include module-lib APIs, |
| 373 | // so use the prebuilt module-lib stubs for modules that export module-lib stubs that the |
| 374 | // non-updatable part depends on. |
| 375 | non_updatable_api_deps_on_modules = [ |
| 376 | "sdk_module-lib_current_framework-tethering", |
| 377 | "sdk_module-lib_current_framework-connectivity-t", |
| 378 | "sdk_system_current_android", |
| 379 | ] |
| 380 | |
Anton Hansson | 33f7f26 | 2023-11-01 10:42:12 +0000 | [diff] [blame] | 381 | // Defaults with module APIs in the classpath (mostly from prebuilts). |
| 382 | // Suitable for compiling android-non-updatable. |
| 383 | stubs_defaults { |
| 384 | name: "module-classpath-stubs-defaults", |
| 385 | aidl: { |
| 386 | include_dirs: [ |
| 387 | "packages/modules/Bluetooth/framework/aidl-export", |
| 388 | "packages/modules/Connectivity/framework/aidl-export", |
| 389 | "packages/modules/Media/apex/aidl/stable", |
| 390 | ], |
| 391 | }, |
Anton Hansson | 648b0db | 2023-11-06 19:24:42 +0000 | [diff] [blame] | 392 | libs: non_updatable_api_deps_on_modules, |
Anton Hansson | 33f7f26 | 2023-11-01 10:42:12 +0000 | [diff] [blame] | 393 | } |
| 394 | |
| 395 | // Defaults for the java_sdk_libraries of unbundled jars from framework. |
| 396 | // java_sdk_libraries using these defaults should also add themselves to the |
| 397 | // non_updatable_modules list in frameworks/base/api/api.go |
| 398 | java_defaults { |
| 399 | name: "framework-non-updatable-unbundled-defaults", |
| 400 | defaults: [ |
| 401 | "framework-non-updatable-lint-defaults", |
| 402 | "non-updatable-framework-module-defaults", |
| 403 | ], |
| 404 | public: { |
| 405 | libs: ["android_module_lib_stubs_current"], |
| 406 | }, |
| 407 | system: { |
| 408 | libs: ["android_module_lib_stubs_current"], |
| 409 | }, |
| 410 | module_lib: { |
| 411 | libs: ["android_module_lib_stubs_current"], |
| 412 | }, |
| 413 | test: { |
| 414 | libs: ["android_test_frameworks_core_stubs_current"], |
| 415 | }, |
| 416 | sdk_version: "core_platform", |
| 417 | stub_only_libs: ["framework-protos"], |
| 418 | impl_only_libs: ["framework-minus-apex-headers"], // the framework, including hidden API |
| 419 | impl_library_visibility: ["//frameworks/base"], |
Roshan Pius | 354b10b | 2023-11-14 14:30:26 -0800 | [diff] [blame] | 420 | defaults_visibility: [ |
| 421 | "//frameworks/base/location", |
| 422 | "//frameworks/base/nfc", |
| 423 | ], |
Anton Hansson | 33f7f26 | 2023-11-01 10:42:12 +0000 | [diff] [blame] | 424 | plugins: ["error_prone_android_framework"], |
| 425 | errorprone: { |
| 426 | javacflags: [ |
| 427 | "-Xep:AndroidFrameworkCompatChange:ERROR", |
| 428 | "-Xep:AndroidFrameworkUid:ERROR", |
| 429 | ], |
| 430 | }, |
| 431 | // Include manual annotations in API txt files |
| 432 | merge_annotations_dirs: ["metalava-manual"], |
| 433 | } |
| 434 | |
Anton Hansson | 19fcec6 | 2023-05-02 08:57:12 +0000 | [diff] [blame] | 435 | build = [ |
| 436 | "ApiDocs.bp", |
| 437 | "StubLibraries.bp", |
| 438 | ] |
Yiming Pan | ea84fc8 | 2023-11-20 08:01:56 +0000 | [diff] [blame] | 439 | |
| 440 | genrule_defaults { |
| 441 | name: "flag-api-mapping-generation-defaults", |
| 442 | cmd: "$(location extract-flagged-apis) $(in) $(out)", |
| 443 | tools: ["extract-flagged-apis"], |
| 444 | } |
| 445 | |
| 446 | genrule { |
| 447 | name: "flag-api-mapping-PublicApi", |
| 448 | defaults: ["flag-api-mapping-generation-defaults"], |
| 449 | srcs: [":frameworks-base-api-current.txt"], |
| 450 | out: ["flag_api_map.textproto"], |
| 451 | dist: { |
| 452 | targets: ["droid"], |
| 453 | }, |
| 454 | } |
| 455 | |
| 456 | genrule { |
| 457 | name: "flag-api-mapping-SystemApi", |
| 458 | defaults: ["flag-api-mapping-generation-defaults"], |
| 459 | srcs: [":frameworks-base-api-system-current.txt"], |
| 460 | out: ["system_flag_api_map.textproto"], |
| 461 | dist: { |
| 462 | targets: ["droid"], |
| 463 | }, |
| 464 | } |
| 465 | |
| 466 | genrule { |
| 467 | name: "flag-api-mapping-ModuleLibApi", |
| 468 | defaults: ["flag-api-mapping-generation-defaults"], |
| 469 | srcs: [":frameworks-base-api-module-lib-current.txt"], |
| 470 | out: ["module_lib_flag_api_map.textproto"], |
| 471 | dist: { |
| 472 | targets: ["droid"], |
| 473 | }, |
| 474 | } |
| 475 | |
| 476 | genrule { |
| 477 | name: "flag-api-mapping-SystemServerApi", |
| 478 | defaults: ["flag-api-mapping-generation-defaults"], |
| 479 | srcs: [":frameworks-base-api-system-server-current.txt"], |
| 480 | out: ["system_server_flag_api_map.textproto"], |
| 481 | dist: { |
| 482 | targets: ["droid"], |
| 483 | }, |
| 484 | } |
Nelson Li | cb9a5dd | 2023-12-20 02:59:27 +0000 | [diff] [blame] | 485 | |
| 486 | phony_rule { |
| 487 | name: "checkapi", |
| 488 | phony_deps: [ |
| 489 | "frameworks-base-api-current-compat", |
| 490 | "frameworks-base-api-system-current-compat", |
| 491 | "frameworks-base-api-module-lib-current-compat", |
| 492 | ], |
| 493 | } |