blob: 84bbc0dfe261154d77fa15b0b43df801441c80ed [file] [log] [blame]
Steve Paikdd4857b2018-03-13 19:16:55 -07001// Copyright (C) 2018 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
Bob Badour4da7d222021-02-22 16:14:07 -080015package {
16 default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
Dan Willemsendbd4eea2019-06-06 13:38:12 -070019filegroup {
20 name: "libcarpowermanager_aidl",
21 srcs: [
22 "src/android/car/ICar.aidl",
Eric Jeong58762682020-11-30 21:51:32 -080023 "src/android/car/hardware/power/CarPowerPolicy.aidl",
24 "src/android/car/hardware/power/CarPowerPolicyFilter.aidl",
Dan Willemsendbd4eea2019-06-06 13:38:12 -070025 "src/android/car/hardware/power/ICarPower.aidl",
Eric Jeongd48f7072021-02-25 18:21:06 -080026 "src/android/car/hardware/power/ICarPowerPolicyListener.aidl",
Dan Willemsendbd4eea2019-06-06 13:38:12 -070027 "src/android/car/hardware/power/ICarPowerStateListener.aidl",
28 ],
29 path: "src",
30}
31
Steve Paikdd4857b2018-03-13 19:16:55 -070032cc_library {
33 name: "libcarpowermanager",
Hyejin Kim085ab652019-08-09 18:13:33 +090034 vendor_available: true,
Steve Paikdd4857b2018-03-13 19:16:55 -070035
36 aidl: {
37 export_aidl_headers: true,
38 local_include_dirs: [
39 "src",
40 ],
41 },
42
43 cflags: [
44 "-Wall",
45 "-Werror",
46 "-Wextra",
47 "-Wno-unused-parameter",
48 ],
49
50 include_dirs: [
51 "packages/services/Car/car-lib/native/include",
52 ],
53
54 shared_libs: [
55 "libbinder",
56 "liblog",
57 "libutils",
58 ],
59
60 srcs: [
Dan Willemsendbd4eea2019-06-06 13:38:12 -070061 ":libcarpowermanager_aidl",
Steve Paikdd4857b2018-03-13 19:16:55 -070062 "native/CarPowerManager/CarPowerManager.cpp",
Eric Jeong58762682020-11-30 21:51:32 -080063 "native/CarPowerManager/CarPowerPolicy.cpp",
64 "native/CarPowerManager/CarPowerPolicyFilter.cpp",
Steve Paikdd4857b2018-03-13 19:16:55 -070065 ],
66}
67
Nan Zhangf1544c22018-07-19 17:04:18 -070068java_library {
Peter Libba87152019-05-31 18:57:00 -070069 name: "android.car.cluster.navigation",
70 proto: {
71 type: "lite",
72 },
73 static_libs: ["libprotobuf-java-lite"],
74 srcs: ["src/android/car/navigation/navigation_state.proto"]
75}
76
Mayank Garg8f932822020-09-17 16:09:12 -070077// library to access settings from CarSettings
Mayank Garg0c3e62c2020-01-28 15:00:53 -080078java_library {
79 name: "android.car.settings",
80 srcs: ["src/android/car/settings/CarSettings.java"]
81}
82
Mayank Garg8f932822020-09-17 16:09:12 -070083// library to access common constants between carlibrary and system server.
84java_library {
Mayank Garg801ea6a2020-09-29 15:43:49 -070085 name: "com.android.car.internal.common",
86 srcs: [
87 "src/com/android/car/internal/common/**/*.java",
88 "src/com/android/car/internal/common/EventLogTags.logtags",
Felipe Leme576720c2021-06-15 15:12:13 -070089 "src/com/android/car/internal/ExcludeFromCodeCoverageGeneratedReport.java",
90 ],
Mayank Garg8f932822020-09-17 16:09:12 -070091}
92
Peter Libba87152019-05-31 18:57:00 -070093java_library {
Nan Zhangf1544c22018-07-19 17:04:18 -070094 name: "android.car",
95 srcs: [
96 "src/**/*.java",
Yuncheol Heo7ac86e82020-12-02 09:12:35 -080097 "src/**/*.aidl",
Mayank Garg801ea6a2020-09-29 15:43:49 -070098 "src/com/android/car/internal/common/EventLogTags.logtags",
Nan Zhangf1544c22018-07-19 17:04:18 -070099 ],
100 aidl: {
101 include_dirs: [
102 "system/bt/binder",
103 ],
104 },
105 exclude_srcs: [
106 "src/android/car/storagemonitoring/IoStats.aidl",
107 "src/android/car/storagemonitoring/IoStatsEntry.aidl",
108 ],
109 product_variables: {
110 pdk: {
111 enabled: false,
112 },
113 },
114 installable: true,
115}
Nan Zhang110f6152018-08-15 12:05:04 -0700116
Tor Norbyef4c428a2019-01-04 21:03:51 -0800117stubs_defaults {
Nan Zhang110f6152018-08-15 12:05:04 -0700118 name: "android.car-docs-default",
119 srcs: [
120 "src/**/*.java",
Nan Zhang110f6152018-08-15 12:05:04 -0700121 ],
122 libs: [
123 "android.car",
124 ],
Nan Zhang110f6152018-08-15 12:05:04 -0700125 product_variables: {
126 pdk: {
127 enabled: false,
128 },
129 },
130}
131
132genrule {
133 name: "android-car-last-released-api",
134 srcs: [
135 "api/released/*.txt",
136 ],
137 cmd: "cp -f $$(echo $(in) | tr \" \" \"\\n\" | sort -n | tail -1) $(genDir)/last-released-api.txt",
138 out: [
139 "last-released-api.txt",
140 ],
141}
142
143genrule {
144 name: "android-car-last-released-system-api",
145 srcs: [
146 "api/system-released/*.txt",
147 ],
148 cmd: "cp -f $$(echo $(in) | tr \" \" \"\\n\" | sort -n | tail -1) $(genDir)/last-released-system-api.txt",
149 out: [
150 "last-released-system-api.txt",
151 ],
152}
153
Tor Norbyef4c428a2019-01-04 21:03:51 -0800154droidstubs {
Nan Zhang110f6152018-08-15 12:05:04 -0700155 name: "android.car-stubs-docs",
156 defaults: ["android.car-docs-default"],
Lakshman Annadorai563d5732021-01-29 09:59:18 -0800157 args: "--hide UnavailableSymbol --no-docs --stub-packages android.car* " +
158 "--hide-package com.android.internal ",
Nan Zhang110f6152018-08-15 12:05:04 -0700159 installable: false,
160 check_api: {
161 last_released: {
162 api_file: ":android-car-last-released-api",
163 removed_api_file: "api/removed.txt",
164 args: " -hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 -hide 26 -hide 27 " +
Paul Duffin7d030292019-05-30 15:42:41 +0100165 " -warning 7 -warning 8 -warning 9 -warning 10 -warning 11 -warning 12 " +
166 " -warning 13 -warning 14 -warning 15 -warning 16 -warning 17 -warning 18 -hide 113 ",
Nan Zhang110f6152018-08-15 12:05:04 -0700167 },
168 current: {
169 api_file: "api/current.txt",
170 removed_api_file: "api/removed.txt",
171 args: " -error 2 -error 3 -error 4 -error 5 -error 6 -error 7 -error 8 -error 9 -error 10 -error 11 " +
Paul Duffin7d030292019-05-30 15:42:41 +0100172 " -error 12 -error 13 -error 14 -error 15 -error 16 -error 17 -error 18 -error 19 -error 20 " +
173 " -error 21 -error 23 -error 24 -error 25 -hide 113 ",
Nan Zhang110f6152018-08-15 12:05:04 -0700174 },
Enrico Granata003c3692020-01-14 15:43:34 -0800175 api_lint: {
176 enabled: true,
177 baseline_file: "api/lint-baseline.txt",
178 }
Nan Zhang110f6152018-08-15 12:05:04 -0700179 },
180}
181
Tor Norbyef4c428a2019-01-04 21:03:51 -0800182droidstubs {
Nan Zhang110f6152018-08-15 12:05:04 -0700183 name: "android.car-system-stubs-docs",
184 defaults: ["android.car-docs-default"],
Antonio Kantek73e7fcd2020-12-08 13:27:23 -0800185 // TODO(b/174572385): Remove CallbackInterface once this b/174572385 is fixed
186 args: "--hide CallbackInterface --hide UnavailableSymbol --hide HiddenSuperclass " +
187 "--no-docs --stub-packages android.car* " +
Lakshman Annadorai563d5732021-01-29 09:59:18 -0800188 "--show-annotation android.annotation.SystemApi --hide-package com.android.internal ",
Nan Zhang110f6152018-08-15 12:05:04 -0700189 installable: false,
190 check_api: {
191 last_released: {
192 api_file: ":android-car-last-released-system-api",
193 removed_api_file: "api/system-removed.txt",
194 args: " -hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 -hide 26 -hide 27 " +
Paul Duffin7d030292019-05-30 15:42:41 +0100195 " -warning 7 -warning 8 -warning 9 -warning 10 -warning 11 -warning 12 " +
196 " -warning 13 -warning 14 -warning 15 -warning 16 -warning 17 -warning 18 -hide 113 ",
Nan Zhang110f6152018-08-15 12:05:04 -0700197 },
198 current: {
199 api_file: "api/system-current.txt",
200 removed_api_file: "api/system-removed.txt",
201 args: " -error 2 -error 3 -error 4 -error 5 -error 6 -error 7 -error 8 -error 9 -error 10 -error 11 " +
Paul Duffin7d030292019-05-30 15:42:41 +0100202 " -error 12 -error 13 -error 14 -error 15 -error 16 -error 17 -error 18 -error 19 -error 20 " +
203 " -error 21 -error 23 -error 24 -error 25 -hide 113 ",
Nan Zhang110f6152018-08-15 12:05:04 -0700204 },
Enrico Granata003c3692020-01-14 15:43:34 -0800205 api_lint: {
206 enabled: true,
207 baseline_file: "api/system-lint-baseline.txt",
208 }
Nan Zhang110f6152018-08-15 12:05:04 -0700209 },
210}
211
Tor Norbyef4c428a2019-01-04 21:03:51 -0800212droidstubs {
Selim Gurune4029922018-12-12 17:18:43 -0800213 name: "android.car-test-stubs-docs",
214 defaults: ["android.car-docs-default"],
Antonio Kantekc73da622020-06-04 22:14:39 -0700215 args: "--hide HiddenSuperclass --hide UnavailableSymbol --no-docs --stub-packages android.car* " +
Tor Norbyef4c428a2019-01-04 21:03:51 -0800216 "--show-annotation android.annotation.TestApi ",
Selim Gurune4029922018-12-12 17:18:43 -0800217 installable: false,
218 check_api: {
219 current: {
220 api_file: "api/test-current.txt",
221 removed_api_file: "api/test-removed.txt",
222 args: " -error 2 -error 3 -error 4 -error 5 -error 6 -error 7 -error 8 -error 9 -error 10 -error 11 " +
223 " -error 12 -error 13 -error 14 -error 15 -error 16 -error 17 -error 18 -error 19 -error 20 " +
224 " -error 21 -error 23 -error 24 -error 25 -hide 113 ",
225 },
226 },
227}
228
Tor Norbyef4c428a2019-01-04 21:03:51 -0800229droidstubs {
Nan Zhang110f6152018-08-15 12:05:04 -0700230 name: "android.car-stub-docs",
231 srcs: [
232 "src/**/*.java",
233 ],
234 libs: [
235 "android.car",
236 ],
Nan Zhang110f6152018-08-15 12:05:04 -0700237 api_filename: "api.txt",
Antonio Kantekc73da622020-06-04 22:14:39 -0700238 args: "--hide HiddenSuperclass --hide UnavailableSymbol --no-docs --stub-packages android.car* ",
Nan Zhang110f6152018-08-15 12:05:04 -0700239 installable: false,
240 product_variables: {
241 pdk: {
242 enabled: false,
243 },
244 },
245}
246
Zhomart Mukhamejanovf50d4f72021-02-24 18:56:37 -0800247// Generates stubs for API documentation.
248droidstubs {
249 name: "car-doc-stubs",
250 srcs: [
251 "src/**/*.java",
252 ],
253 create_doc_stubs: true,
254 annotations_enabled: true,
255 api_levels_annotations_enabled: true,
256 api_levels_jar_filename: "android.car.jar",
257 api_levels_annotations_dirs: [
258 "sdk-dir",
259 "api-versions-jars-dir",
260 ],
261 previous_api: ":android-car-last-released-api",
262 merge_annotations_dirs: [
263 "metalava-manual",
264 ],
265 arg_files: [
266 "AndroidManifest.xml",
267 ],
268 // Add --verbose to print metalava details.
269 args: "--manifest $(location AndroidManifest.xml) " +
270 "--error UnhiddenSystemApi " +
271 "--hide RequiresPermission " +
272 "--hide CallbackInterface " +
273 "--hide MissingPermission " +
274 "--hide HiddenSuperclass --hide DeprecationMismatch --hide UnavailableSymbol " +
275 "--hide SdkConstant --hide HiddenTypeParameter --hide Todo --hide Typo " +
276 "--hide Todo --hide Typo ",
277 write_sdk_values: true,
278}
279
280// Generates API docs for go/devsite.
281//
282// How API docs are generated:
283// source files -> (droidstubs/metalava) -> stub source files -> (droiddoc/doclava) -> docs
284//
285// The metalava conversion is done by droidstub module "car-doc-stubs".
286//
287// TODO(b/162958231): Remove "ds-car-docs" from build/soong/java/legacy_core_platform_api_usage.go.
288droiddoc {
289 name: "ds-car-docs",
290 srcs: [
291 ":car-doc-stubs",
292 ],
293 libs: [
294 "stub-annotations",
295 "unsupportedappusage",
296 ],
297 custom_template: "droiddoc-templates-sdk",
298 // These variables that are used in doclava templates.
299 hdf: [
300 "dac true",
301 "sdk.preview 0", // Not a preview version.
302 "sdk.version 31",
303 "android.whichdoc online",
304 "android.hasSamples false",
305 ],
306 arg_files: [
307 "AndroidManifest.xml",
308 ],
309 proofread_file: "ds-sdk-docs-proofrerad.txt",
310 // See doclava docs in https://github.com/tinks/doclava.
311 // See error numbers in external/doclava/src/com/google/doclava/Errors.java.
312 // TODO(b/163831343): Add -werror -lerror to catch bad javadocs
313 args: "-android -manifest $(location AndroidManifest.xml) -toroot / -devsite -yamlV2 -metalavaApiSince " +
314 "-hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 " +
315 "-stubpackages android.car -dac_libraryroot android/car ",
316}
317
Dean Harding877990f2019-04-02 13:57:49 -0700318java_library {
Nan Zhang110f6152018-08-15 12:05:04 -0700319 name: "android.car-stubs",
320 srcs: [
321 ":android.car-stub-docs",
322 ],
Keun young Park528ed5d2019-12-20 10:12:05 -0800323 sdk_version: "current",
Nan Zhang110f6152018-08-15 12:05:04 -0700324 product_variables: {
325 pdk: {
326 enabled: false,
327 },
328 },
Dean Harding877990f2019-04-02 13:57:49 -0700329 installable: false,
Dean Harding42b446e2019-04-01 13:50:39 -0700330 dist: {
331 targets: ["dist_files"],
332 }
David Brazdil43231d92018-08-24 14:36:57 +0100333}
334
Dean Harding877990f2019-04-02 13:57:49 -0700335java_library {
336 name: "android.car-stubs-dex",
337 static_libs: ["android.car-stubs"],
Keun young Park528ed5d2019-12-20 10:12:05 -0800338 sdk_version: "current",
Dean Harding877990f2019-04-02 13:57:49 -0700339 product_variables: {
340 pdk: {
341 enabled: false,
342 },
343 },
344 compile_dex: true,
345}
346
347java_library {
David Brazdil43231d92018-08-24 14:36:57 +0100348 name: "android.car-system-stubs",
349 srcs: [
350 ":android.car-system-stubs-docs",
351 ],
Keun young Park528ed5d2019-12-20 10:12:05 -0800352 sdk_version: "system_current",
David Brazdil43231d92018-08-24 14:36:57 +0100353 product_variables: {
354 pdk: {
355 enabled: false,
356 },
357 },
Dean Harding877990f2019-04-02 13:57:49 -0700358 installable: false,
Dean Harding42b446e2019-04-01 13:50:39 -0700359 dist: {
360 targets: ["dist_files"],
361 }
Nan Zhang110f6152018-08-15 12:05:04 -0700362}
Selim Gurune4029922018-12-12 17:18:43 -0800363
Dean Harding877990f2019-04-02 13:57:49 -0700364java_library {
365 name: "android.car-system-stubs-dex",
366 static_libs: ["android.car-system-stubs"],
Keun young Park528ed5d2019-12-20 10:12:05 -0800367 sdk_version: "system_current",
Dean Harding877990f2019-04-02 13:57:49 -0700368 product_variables: {
369 pdk: {
370 enabled: false,
371 },
372 },
373 compile_dex: true,
374}
375
Keun young Park528ed5d2019-12-20 10:12:05 -0800376java_library {
Selim Gurune4029922018-12-12 17:18:43 -0800377 name: "android.car-test-stubs",
378 srcs: [
379 ":android.car-test-stubs-docs",
380 ],
Keun young Park528ed5d2019-12-20 10:12:05 -0800381 sdk_version: "test_current",
Selim Gurune4029922018-12-12 17:18:43 -0800382 product_variables: {
383 pdk: {
384 enabled: false,
385 },
386 },
Dean Harding877990f2019-04-02 13:57:49 -0700387 installable: false,
388}
389
390java_library {
391 name: "android.car-test-stubs-dex",
392 static_libs: ["android.car-test-stubs"],
Keun young Park528ed5d2019-12-20 10:12:05 -0800393 sdk_version: "test_current",
Dean Harding877990f2019-04-02 13:57:49 -0700394 product_variables: {
395 pdk: {
396 enabled: false,
397 },
398 },
Selim Gurune4029922018-12-12 17:18:43 -0800399 compile_dex: true,
Keun young Parkc0d19dc2020-01-23 11:33:51 -0800400 dist: {
401 targets: ["dist_files"],
402 }
Selim Gurune4029922018-12-12 17:18:43 -0800403}
Paul Duffin7d030292019-05-30 15:42:41 +0100404
405// Export the api/system-current.txt file.
406filegroup {
407 name: "car-api-system-current.txt",
408 visibility: [
409 "//cts/tests/signature/api",
410 ],
411 srcs: [
412 "api/system-current.txt",
413 ],
414}
415
416// Export the api/system-removed.txt file.
417filegroup {
418 name: "car-api-system-removed.txt",
419 visibility: [
420 "//cts/tests/signature/api",
421 ],
422 srcs: [
423 "api/system-removed.txt",
424 ],
425}