blob: 94a24113a667e130060bb50b1428ca5cf460b9da [file] [log] [blame]
Aaron Huangf73ff8c2019-12-06 18:12:24 +08001// 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
Aaron Huang57a94962020-01-03 20:35:55 +080015// 1. The "net-utils-framework-common" library is also compiled into the framework and placed on the
16// boot classpath. It uses jarjar rules so that anything outside the framework can use this
17// library directly.
18// 2. The "net-utils-services-common" library is for use by modules and frameworks/base/services.
19// It does not need to be jarjared because it is not placed on the bootclasspath.
Lorenzo Colittie14bd342020-01-14 14:47:16 +090020// 3. The "net-utils-telephony-common-srcs" filegroup is for use specifically by telephony, which
21// places many of its classes, even non-API service classes, on the boot classpath. Any file that
22// is added to this filegroup *must* have a corresponding jarjar rule in the telephony jarjar
23// rules file. Otherwise, it will end up on the boot classpath and other modules will not be able
24// to provide their own copy.
Aaron Huangf73ff8c2019-12-06 18:12:24 +080025
Adrian Roos0607dd92020-03-27 00:30:41 +010026// Note: all filegroups here must have the right path attribute because otherwise, if they are
27// included in the bootclasspath, they could incorrectly be included in the SDK documentation even
28// though they are not in the current.txt files.
29
Bob Badour1b8c7442021-02-12 15:39:10 -080030package {
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000031 default_team: "trendy_team_fwk_core_networking",
Bob Badour1b8c7442021-02-12 15:39:10 -080032 default_applicable_licenses: ["Android-Apache-2.0"],
33}
34
Chalard Jean48c6c7d2020-06-25 23:39:15 +090035java_library {
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000036 name: "net-utils-device-common",
37 srcs: [
38 "device/com/android/net/module/util/arp/ArpPacket.java",
39 "device/com/android/net/module/util/DeviceConfigUtils.java",
40 "device/com/android/net/module/util/DomainUtils.java",
41 "device/com/android/net/module/util/FdEventsReader.java",
Patrick Rohraa06b2b2024-06-17 14:18:36 -070042 "device/com/android/net/module/util/FeatureVersions.java",
43 "device/com/android/net/module/util/HandlerUtils.java",
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000044 "device/com/android/net/module/util/NetworkMonitorUtils.java",
45 "device/com/android/net/module/util/PacketReader.java",
46 "device/com/android/net/module/util/SharedLog.java",
47 "device/com/android/net/module/util/SocketUtils.java",
Patrick Rohraa06b2b2024-06-17 14:18:36 -070048 "device/com/android/net/module/util/SyncStateMachine.java",
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000049 // This library is used by system modules, for which the system health impact of Kotlin
50 // has not yet been evaluated. Annotations may need jarjar'ing.
51 // "src_devicecommon/**/*.kt",
52 ],
53 sdk_version: "module_current",
54 min_sdk_version: "30",
55 target_sdk_version: "30",
56 apex_available: [
57 "//apex_available:anyapex",
58 "//apex_available:platform",
59 ],
60 visibility: [
Baligh Uddinf8c12822021-05-21 04:26:52 +000061 "//packages/modules/Connectivity:__subpackages__",
62 "//packages/modules/Connectivity/framework:__subpackages__",
Xiao Ma6f95cef2020-09-08 19:16:15 +090063 "//packages/modules/NetworkStack:__subpackages__",
Chalard Jean48c6c7d2020-06-25 23:39:15 +090064 "//packages/modules/CaptivePortalLogin",
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000065 ],
66 static_libs: [
Patrick Rohraa06b2b2024-06-17 14:18:36 -070067 "modules-utils-statemachine",
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000068 "net-utils-framework-common",
69 ],
70 libs: [
71 "androidx.annotation_annotation",
72 "framework-annotations-lib",
73 "framework-configinfrastructure",
74 "framework-connectivity.stubs.module_lib",
75 ],
76 lint: {
77 strict_updatability_linting: true,
78 error_checks: ["NewApi"],
79 },
Chalard Jean48c6c7d2020-06-25 23:39:15 +090080}
81
Chalard Jean48c6c7d2020-06-25 23:39:15 +090082java_defaults {
83 name: "lib_mockito_extended",
84 static_libs: [
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000085 "mockito-target-extended-minus-junit4",
Chalard Jean48c6c7d2020-06-25 23:39:15 +090086 ],
87 jni_libs: [
88 "libdexmakerjvmtiagent",
89 "libstaticjvmtiagent",
90 ],
91}
92
Aswin Sankar601d6f92021-10-11 13:12:16 -070093java_library {
94 name: "net-utils-dnspacket-common",
95 srcs: [
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000096 "framework/**/DnsPacket.java",
97 "framework/**/DnsPacketUtils.java",
98 "framework/**/DnsSvcbPacket.java",
99 "framework/**/DnsSvcbRecord.java",
100 "framework/**/HexDump.java",
101 "framework/**/NetworkStackConstants.java",
Aswin Sankar601d6f92021-10-11 13:12:16 -0700102 ],
103 sdk_version: "module_current",
104 visibility: [
105 "//packages/services/Iwlan:__subpackages__",
106 ],
Junyu Lai85e24e82022-09-15 07:34:51 +0000107 libs: [
Mike Yu9b96c832023-09-18 08:26:08 +0000108 "androidx.annotation_annotation",
Junyu Lai85e24e82022-09-15 07:34:51 +0000109 "framework-annotations-lib",
110 "framework-connectivity.stubs.module_lib",
111 ],
Aswin Sankar601d6f92021-10-11 13:12:16 -0700112}
113
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800114filegroup {
115 name: "net-utils-framework-common-srcs",
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900116 srcs: ["framework/**/*.java"],
117 path: "framework",
Remi NGUYEN VAN651faf72021-03-24 22:40:37 +0900118 visibility: [
119 "//frameworks/base",
Baligh Uddin27e5fcd2021-05-22 13:16:30 +0000120 "//packages/modules/Connectivity:__subpackages__",
Remi NGUYEN VAN651faf72021-03-24 22:40:37 +0900121 ],
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800122}
123
Yang Sun3aa62e62024-03-12 21:23:19 +0800124// The net-utils-device-common-bpf library requires the callers to contain
125// net-utils-device-common-struct-base.
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800126java_library {
markchienf3448f92021-11-10 01:06:51 +0800127 name: "net-utils-device-common-bpf",
Xiao Ma57b34422021-07-01 13:57:02 +0000128 srcs: [
Tyler Wear92f3c242022-02-15 15:21:43 -0800129 "device/com/android/net/module/util/BpfBitmap.java",
Hungming Chenb3e71a22022-06-23 21:34:54 +0800130 "device/com/android/net/module/util/BpfDump.java",
Tyler Wearaafd9c12021-10-19 11:01:46 -0700131 "device/com/android/net/module/util/BpfMap.java",
Tyler Weare48ee4a2022-02-15 15:30:50 -0800132 "device/com/android/net/module/util/BpfUtils.java",
markchien2e5fece2022-01-21 10:16:54 +0800133 "device/com/android/net/module/util/IBpfMap.java",
markchienf3448f92021-11-10 01:06:51 +0800134 "device/com/android/net/module/util/JniUtil.java",
Lorenzo Colitti05be2f52024-06-02 13:24:21 +0900135 "device/com/android/net/module/util/SingleWriterBpfMap.java",
Patrick Rohr29b0d952022-01-12 21:42:24 +0100136 "device/com/android/net/module/util/TcUtils.java",
markchienf3448f92021-11-10 01:06:51 +0800137 ],
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900138 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000139 min_sdk_version: "30",
markchienf3448f92021-11-10 01:06:51 +0800140 visibility: [
markchienf3448f92021-11-10 01:06:51 +0800141 "//packages/modules/Connectivity:__subpackages__",
142 "//packages/modules/NetworkStack:__subpackages__",
143 ],
markchienf3448f92021-11-10 01:06:51 +0800144 libs: [
145 "androidx.annotation_annotation",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900146 "framework-connectivity.stubs.module_lib",
Yang Sun3aa62e62024-03-12 21:23:19 +0800147 "net-utils-device-common-struct-base",
markchienf3448f92021-11-10 01:06:51 +0800148 ],
149 apex_available: [
150 "com.android.tethering",
151 "//apex_available:platform",
152 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900153 lint: {
154 strict_updatability_linting: true,
155 error_checks: ["NewApi"],
156 },
markchienf3448f92021-11-10 01:06:51 +0800157}
158
159java_library {
Yang Sun3aa62e62024-03-12 21:23:19 +0800160 name: "net-utils-device-common-struct-base",
markchienf3448f92021-11-10 01:06:51 +0800161 srcs: [
Xiao Ma57b34422021-07-01 13:57:02 +0000162 "device/com/android/net/module/util/Struct.java",
Xiao Ma57b34422021-07-01 13:57:02 +0000163 ],
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900164 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000165 min_sdk_version: "30",
Xiao Ma57b34422021-07-01 13:57:02 +0000166 visibility: [
Xiao Ma57b34422021-07-01 13:57:02 +0000167 "//packages/modules/Connectivity:__subpackages__",
168 "//packages/modules/NetworkStack:__subpackages__",
169 ],
170 static_libs: [
171 "net-utils-framework-common",
172 ],
173 libs: [
174 "androidx.annotation_annotation",
Yang Sun3aa62e62024-03-12 21:23:19 +0800175 "framework-annotations-lib", // Required by InetAddressUtils.java
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900176 "framework-connectivity.stubs.module_lib",
Xiao Ma57b34422021-07-01 13:57:02 +0000177 ],
178 apex_available: [
179 "com.android.tethering",
180 "//apex_available:platform",
181 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900182 lint: {
183 strict_updatability_linting: true,
184 error_checks: ["NewApi"],
185 },
Xiao Ma57b34422021-07-01 13:57:02 +0000186}
187
Yang Sun3aa62e62024-03-12 21:23:19 +0800188// The net-utils-device-common-struct library requires the callers to contain
189// net-utils-device-common-struct-base.
Yang Sun1c9fb592024-02-19 10:37:26 +0800190java_library {
Yang Sun3aa62e62024-03-12 21:23:19 +0800191 name: "net-utils-device-common-struct",
Yang Sun1c9fb592024-02-19 10:37:26 +0800192 srcs: [
Yang Sun3aa62e62024-03-12 21:23:19 +0800193 "device/com/android/net/module/util/Ipv6Utils.java",
194 "device/com/android/net/module/util/PacketBuilder.java",
195 "device/com/android/net/module/util/structs/*.java",
Yang Sun1c9fb592024-02-19 10:37:26 +0800196 ],
197 sdk_version: "module_current",
198 min_sdk_version: "30",
199 visibility: [
200 "//packages/modules/Connectivity:__subpackages__",
Yang Sun3aa62e62024-03-12 21:23:19 +0800201 "//packages/modules/NetworkStack:__subpackages__",
Yang Sun1c9fb592024-02-19 10:37:26 +0800202 ],
203 libs: [
Yang Sun3aa62e62024-03-12 21:23:19 +0800204 "androidx.annotation_annotation",
205 "framework-annotations-lib", // Required by IpUtils.java
206 "framework-connectivity.stubs.module_lib",
207 "net-utils-device-common-struct-base",
Yang Sun1c9fb592024-02-19 10:37:26 +0800208 ],
209 apex_available: [
210 "com.android.tethering",
Yang Sun3aa62e62024-03-12 21:23:19 +0800211 "//apex_available:platform",
Yang Sun1c9fb592024-02-19 10:37:26 +0800212 ],
213 lint: {
214 strict_updatability_linting: true,
215 error_checks: ["NewApi"],
216 },
217}
218
Junyu Lai626045a2023-08-28 18:49:44 +0800219// The net-utils-device-common-netlink library requires the callers to contain
Yang Sun3aa62e62024-03-12 21:23:19 +0800220// net-utils-device-common-struct and net-utils-device-common-struct-base.
Xiao Ma57b34422021-07-01 13:57:02 +0000221java_library {
markchienf3448f92021-11-10 01:06:51 +0800222 name: "net-utils-device-common-netlink",
223 srcs: [
Yan Yanf085fad2023-11-20 18:51:30 +0000224 "device/com/android/net/module/util/netlink/**/*.java",
markchienf3448f92021-11-10 01:06:51 +0800225 ],
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900226 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000227 min_sdk_version: "30",
markchienf3448f92021-11-10 01:06:51 +0800228 visibility: [
markchienf3448f92021-11-10 01:06:51 +0800229 "//packages/modules/Connectivity:__subpackages__",
230 "//packages/modules/NetworkStack:__subpackages__",
231 ],
markchienf3448f92021-11-10 01:06:51 +0800232 libs: [
233 "androidx.annotation_annotation",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900234 "framework-connectivity.stubs.module_lib",
Junyu Lai626045a2023-08-28 18:49:44 +0800235 // For libraries which are statically linked in framework-connectivity, do not
236 // statically link here because callers of this library might already have a static
237 // version linked.
238 "net-utils-device-common-struct",
Yang Sun3aa62e62024-03-12 21:23:19 +0800239 "net-utils-device-common-struct-base",
markchienf3448f92021-11-10 01:06:51 +0800240 ],
241 apex_available: [
242 "com.android.tethering",
243 "//apex_available:platform",
244 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900245 lint: {
246 strict_updatability_linting: true,
247 error_checks: ["NewApi"],
248 },
markchienf3448f92021-11-10 01:06:51 +0800249}
250
Junyu Lai626045a2023-08-28 18:49:44 +0800251// The net-utils-device-common-ip library requires the callers to contain
Yang Sun3aa62e62024-03-12 21:23:19 +0800252// net-utils-device-common-struct and net-utils-device-common-struct-base.
markchienf3448f92021-11-10 01:06:51 +0800253java_library {
Chalard Jeanb61091b2021-10-07 15:29:13 +0900254 // TODO : this target should probably be folded into net-utils-device-common
255 name: "net-utils-device-common-ip",
256 srcs: [
257 "device/com/android/net/module/util/ip/*.java",
258 ],
259 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000260 min_sdk_version: "30",
Chalard Jeanb61091b2021-10-07 15:29:13 +0900261 visibility: [
Chalard Jeanb61091b2021-10-07 15:29:13 +0900262 "//packages/modules/Connectivity:__subpackages__",
263 "//packages/modules/NetworkStack:__subpackages__",
264 ],
265 libs: [
266 "framework-annotations-lib",
267 "framework-connectivity",
268 ],
269 static_libs: [
270 "net-utils-device-common",
271 "net-utils-device-common-netlink",
272 "net-utils-framework-common",
273 "netd-client",
274 ],
275 apex_available: [
276 "com.android.tethering",
277 "//apex_available:platform",
278 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900279 lint: {
Motomu Utsumia1a00342024-06-13 09:29:47 +0000280 strict_updatability_linting: true,
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900281 error_checks: ["NewApi"],
282 },
Chalard Jeanb61091b2021-10-07 15:29:13 +0900283}
284
285java_library {
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800286 name: "net-utils-framework-common",
Remi NGUYEN VANce241a32020-01-14 21:42:09 +0900287 srcs: [
288 ":net-utils-framework-common-srcs",
Remi NGUYEN VANce241a32020-01-14 21:42:09 +0900289 ],
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900290 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000291 min_sdk_version: "30",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900292 libs: [
Jooyung Hanb3b67982022-06-24 14:56:24 +0900293 "androidx.annotation_annotation",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900294 "framework-annotations-lib",
295 "framework-connectivity.stubs.module_lib",
paulhucdb069e2022-02-14 15:28:50 +0800296 "framework-connectivity-t.stubs.module_lib",
Mark White66d39cd2023-08-07 15:20:07 +0000297 "framework-location.stubs.module_lib",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900298 ],
Junyu Lai668560d2024-08-09 18:09:38 +0800299 static_libs: [
300 "modules-utils-build",
301 ],
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800302 jarjar_rules: "jarjar-rules-shared.txt",
303 visibility: [
Luke Huangfd5479e2020-06-20 11:38:17 +0800304 "//cts/tests/tests/net",
Chalard Jeanceaf7d02020-06-26 18:34:52 +0900305 "//cts/tests/tests/wifi",
Baligh Uddine685c812020-10-31 04:28:58 +0000306 "//packages/modules/Connectivity/tests/cts/net",
Baligh Uddinae4770d2020-10-29 02:12:06 +0000307 "//packages/modules/Connectivity/Tethering",
Chalard Jeana9f49912020-10-15 18:06:30 +0900308 "//frameworks/base/tests:__subpackages__",
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800309 "//frameworks/opt/net/ike",
310 "//frameworks/opt/telephony",
Chalard Jean19789192020-10-01 12:45:31 +0900311 "//frameworks/base/wifi:__subpackages__",
Remi NGUYEN VAN38afb0c2020-11-10 18:04:27 +0900312 "//packages/modules/Connectivity:__subpackages__",
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900313 "//packages/modules/NetworkStack:__subpackages__",
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800314 "//packages/modules/CaptivePortalLogin",
Baligh Uddinfcbda3a2020-12-24 06:12:25 +0000315 "//packages/modules/Wifi/framework/tests:__subpackages__",
Junyu Laib24df142022-01-10 10:31:11 +0000316 "//packages/apps/Settings",
Chalard Jean7592a342021-04-19 18:04:34 +0900317 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900318 lint: {
319 strict_updatability_linting: true,
320 error_checks: ["NewApi"],
321 },
Paul Hu8d47d842023-03-31 14:59:49 +0800322 errorprone: {
323 enabled: true,
324 // Error-prone checking only warns of problems when building. To make the build fail with
325 // these errors, list the specific error-prone problems below.
326 javacflags: [
327 "-Xep:NullablePrimitive:ERROR",
328 ],
329 },
Spandan Das2b83e772023-12-21 20:46:31 +0000330 apex_available: [
331 "//apex_available:platform",
332 "com.android.tethering",
333 ],
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800334}
Anton Hansson0ceeb7c2022-05-30 12:01:49 +0000335
336java_library {
337 name: "net-utils-services-common",
David Su2dbab642020-10-26 14:51:01 -0700338 srcs: [
339 "device/android/net/NetworkFactory.java",
Chalard Jean7592a342021-04-19 18:04:34 +0900340 "device/android/net/NetworkFactoryImpl.java",
341 "device/android/net/NetworkFactoryLegacyImpl.java",
342 "device/android/net/NetworkFactoryShim.java",
David Su2dbab642020-10-26 14:51:01 -0700343 ],
Chalard Jeand5802422021-10-27 19:02:14 +0900344 sdk_version: "module_current",
David Sudc0a5682021-01-29 04:42:27 +0000345 min_sdk_version: "30",
Chalard Jeand5802422021-10-27 19:02:14 +0900346 libs: [
347 "framework-annotations-lib",
348 "framework-connectivity",
William Escande51c0be52024-07-10 14:26:50 -0700349 "modules-utils-build_system",
Chalard Jeand5802422021-10-27 19:02:14 +0900350 ],
Xiao Ma2bbc2f72022-01-24 07:58:12 +0000351 // TODO: remove "apex_available:platform".
352 apex_available: [
353 "//apex_available:platform",
William Escandefbe576b2022-08-22 11:28:00 -0700354 "com.android.btservices",
Xiao Ma2bbc2f72022-01-24 07:58:12 +0000355 "com.android.tethering",
Anton Hansson0ceeb7c2022-05-30 12:01:49 +0000356 "com.android.wifi",
Xiao Ma2bbc2f72022-01-24 07:58:12 +0000357 ],
Aaron Huang57a94962020-01-03 20:35:55 +0800358 visibility: [
markchien32a6e9c2022-01-20 14:34:15 +0800359 // TODO: remove after NetworkStatsService moves to the module.
Remi NGUYEN VAN376f8d42020-01-15 18:26:29 +0900360 "//frameworks/base/services/net",
Xiao Ma2bbc2f72022-01-24 07:58:12 +0000361 "//packages/modules/Connectivity/service",
Remi NGUYEN VAN0cf724a2021-11-19 18:33:12 +0900362 "//packages/modules/Connectivity/tests:__subpackages__",
Roopa Sattiraju98fa3bf2022-02-03 18:53:23 -0800363 "//packages/modules/Bluetooth/android/app",
Nate(Qiang) Jiangce723aa2022-06-01 21:28:32 +0000364 "//packages/modules/Wifi/service:__subpackages__",
Aaron Huang57a94962020-01-03 20:35:55 +0800365 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900366 lint: {
367 strict_updatability_linting: true,
368 error_checks: ["NewApi"],
369 },
Aaron Huang57a94962020-01-03 20:35:55 +0800370}
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900371
Igor Chernysheva25f1092022-12-20 00:07:38 -0800372java_library {
373 name: "net-utils-device-common-async",
374 srcs: [
375 "device/com/android/net/module/util/async/*.java",
376 ],
377 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000378 min_sdk_version: "30",
Igor Chernysheva25f1092022-12-20 00:07:38 -0800379 visibility: [
Igor Chernysheva25f1092022-12-20 00:07:38 -0800380 "//packages/modules/Connectivity:__subpackages__",
381 ],
382 libs: [
383 "framework-annotations-lib",
384 ],
385 static_libs: [
386 ],
387 apex_available: [
388 "com.android.tethering",
389 "//apex_available:platform",
390 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900391 lint: {
392 strict_updatability_linting: true,
393 error_checks: ["NewApi"],
394 },
Igor Chernysheva25f1092022-12-20 00:07:38 -0800395}
396
Igor Chernyshev810be2b2023-04-06 15:52:26 -0700397java_library {
398 name: "net-utils-device-common-wear",
399 srcs: [
400 "device/com/android/net/module/util/wear/*.java",
401 ],
402 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000403 min_sdk_version: "30",
Igor Chernyshev810be2b2023-04-06 15:52:26 -0700404 visibility: [
Igor Chernyshev810be2b2023-04-06 15:52:26 -0700405 "//packages/modules/Connectivity:__subpackages__",
406 ],
407 libs: [
408 "framework-annotations-lib",
409 ],
410 static_libs: [
411 "net-utils-device-common-async",
412 ],
413 apex_available: [
414 "com.android.tethering",
415 "//apex_available:platform",
416 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900417 lint: {
418 strict_updatability_linting: true,
419 error_checks: ["NewApi"],
420 },
Igor Chernyshev810be2b2023-04-06 15:52:26 -0700421}
422
Yuyang Huangf67388b2023-03-29 16:51:09 +0900423// Limited set of utilities for use by service-connectivity-mdns-standalone-build-test, to make sure
424// the mDNS code can build with only system APIs.
425// The mDNS code is platform code so it should use framework-annotations-lib, contrary to apps that
426// should use sdk_version: "system_current" and only androidx.annotation_annotation. But this build
427// rule verifies that the mDNS code can be built into apps, if code transformations are applied to
428// the annotations.
429// When using "system_current", framework annotations are not available; they would appear as
430// package-private as they are marked as such in the system_current stubs. So build against
431// core_platform and add the stubs manually in "libs". See http://b/147773144#comment7.
432java_library {
433 name: "net-utils-device-common-mdns-standalone-build-test",
434 // Build against core_platform and add the stub libraries manually in "libs", as annotations
435 // are already included in android_system_stubs_current but package-private, so
436 // "framework-annotations-lib" needs to be manually included before
437 // "android_system_stubs_current" (b/272392042)
438 sdk_version: "core_platform",
439 srcs: [
440 "device/com/android/net/module/util/FdEventsReader.java",
Yuyang Huangf67388b2023-03-29 16:51:09 +0900441 "device/com/android/net/module/util/SharedLog.java",
442 "framework/com/android/net/module/util/ByteUtils.java",
443 "framework/com/android/net/module/util/CollectionUtils.java",
Yuyang Huangd851a042024-07-16 18:48:43 +0900444 "framework/com/android/net/module/util/DnsUtils.java",
Yuyang Huange4eb87a2023-05-02 18:44:51 +0900445 "framework/com/android/net/module/util/HexDump.java",
Yuyang Huangf67388b2023-03-29 16:51:09 +0900446 "framework/com/android/net/module/util/LinkPropertiesUtils.java",
447 ],
448 libs: [
449 "framework-annotations-lib",
450 "android_system_stubs_current",
451 "androidx.annotation_annotation",
452 ],
453 visibility: ["//packages/modules/Connectivity/service-t"],
454}
455
Handa Wang8be10bf2024-08-08 15:36:48 +0000456// net-utils-framework-connectivity is only for framework-connectivity.
Handa Wang9b0df362024-07-02 13:17:43 +0000457java_library {
458 name: "net-utils-framework-connectivity",
459 srcs: [
460 ":net-utils-framework-connectivity-srcs",
461 ],
462 sdk_version: "module_current",
463 min_sdk_version: "30",
464 apex_available: [
465 "com.android.tethering",
466 "//apex_available:platform",
467 ],
468 visibility: [
Handa Wang8be10bf2024-08-08 15:36:48 +0000469 "//packages/modules/Connectivity/framework",
Handa Wang9b0df362024-07-02 13:17:43 +0000470 ],
471 libs: [
472 "androidx.annotation_annotation",
473 "framework-annotations-lib",
474 "framework-configinfrastructure",
475 "framework-connectivity.stubs.module_lib",
476 ],
477 lint: {
478 strict_updatability_linting: true,
479 error_checks: ["NewApi"],
480 },
481}
482
483java_defaults {
484 name: "net-utils-non-bootclasspath-defaults",
485 sdk_version: "module_current",
486 min_sdk_version: "30",
Handa Wang9b0df362024-07-02 13:17:43 +0000487 libs: [
488 "androidx.annotation_annotation",
489 "framework-annotations-lib",
490 "framework-configinfrastructure",
491 "framework-connectivity",
492 "framework-connectivity.stubs.module_lib",
493 "framework-connectivity-t.stubs.module_lib",
494 "framework-location.stubs.module_lib",
495 "framework-tethering",
496 "unsupportedappusage",
497 ],
498 static_libs: [
499 "modules-utils-build_system",
500 "modules-utils-statemachine",
501 "net-utils-non-bootclasspath-aidl-java",
502 "netd-client",
503 ],
504 apex_available: [
505 "com.android.tethering",
506 "//apex_available:platform",
507 ],
Handa Wang9b0df362024-07-02 13:17:43 +0000508 defaults_visibility: [
509 "//visibility:private",
510 ],
511 lint: {
512 strict_updatability_linting: true,
513 error_checks: ["NewApi"],
514 },
515}
516
Handa Wang8be10bf2024-08-08 15:36:48 +0000517// net-utils-service-connectivity is only for service-connectivity.
Handa Wang9b0df362024-07-02 13:17:43 +0000518java_library {
519 name: "net-utils-service-connectivity",
520 srcs: [
521 ":net-utils-all-srcs",
522 ],
523 exclude_srcs: [
524 ":net-utils-framework-connectivity-srcs",
525 ],
526 libs: [
527 "net-utils-framework-connectivity",
528 ],
529 defaults: ["net-utils-non-bootclasspath-defaults"],
Nate Jiang5f0471c2024-07-12 16:49:52 +0000530 jarjar_rules: "jarjar-rules-shared.txt",
Handa Wang8be10bf2024-08-08 15:36:48 +0000531 visibility: [
532 "//packages/modules/Connectivity/service",
533 "//packages/modules/Connectivity/staticlibs/tests/unit",
534 ],
Handa Wang9b0df362024-07-02 13:17:43 +0000535}
536
537java_library {
Xiao Ma6793fd02024-07-26 13:07:50 +0900538 name: "net-utils-connectivity-apks",
Handa Wang9b0df362024-07-02 13:17:43 +0000539 srcs: [
540 ":net-utils-all-srcs",
541 ":framework-connectivity-shared-srcs",
542 ],
543 defaults: ["net-utils-non-bootclasspath-defaults"],
Nate Jiang5f0471c2024-07-12 16:49:52 +0000544 jarjar_rules: "jarjar-rules-shared.txt",
Handa Wang8be10bf2024-08-08 15:36:48 +0000545 visibility: [
546 "//packages/modules/CaptivePortalLogin:__subpackages__",
547 "//packages/modules/Connectivity/Tethering",
548 ],
Handa Wang9b0df362024-07-02 13:17:43 +0000549}
550
551aidl_interface {
552 name: "net-utils-non-bootclasspath-aidl",
553 srcs: [
554 ":net-utils-aidl-srcs",
555 ],
556 unstable: true,
557 backend: {
558 java: {
559 enabled: true,
560 min_sdk_version: "30",
561 apex_available: [
562 "com.android.tethering",
Nate Jiang5f0471c2024-07-12 16:49:52 +0000563 "com.android.wifi",
Xiao Mab28199a2024-08-05 14:24:26 +0900564 "//apex_available:platform",
Handa Wang9b0df362024-07-02 13:17:43 +0000565 ],
566 },
567 cpp: {
568 enabled: false,
569 },
570 ndk: {
571 enabled: false,
572 },
573 rust: {
574 enabled: false,
575 },
576 },
577 include_dirs: [
578 "packages/modules/Connectivity/framework/aidl-export",
579 ],
580 visibility: [
581 "//system/tools/aidl/build",
582 ],
583}
584
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900585// Use a filegroup and not a library for telephony sources, as framework-annotations cannot be
586// included either (some annotations would be duplicated on the bootclasspath).
587filegroup {
588 name: "net-utils-telephony-common-srcs",
589 srcs: [
590 // Any class here *must* have a corresponding jarjar rule in the telephony build rules.
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900591 "device/android/net/NetworkFactory.java",
Chalard Jean7592a342021-04-19 18:04:34 +0900592 "device/android/net/NetworkFactoryImpl.java",
593 "device/android/net/NetworkFactoryLegacyImpl.java",
594 "device/android/net/NetworkFactoryShim.java",
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900595 ],
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900596 path: "device",
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900597 visibility: [
598 "//frameworks/opt/telephony",
599 ],
600}
Roshan Pius864bdec2020-01-16 09:19:11 -0800601
Nate Jiang5f0471c2024-07-12 16:49:52 +0000602// Filegroup to build lib used by Wifi framework
Roshan Pius864bdec2020-01-16 09:19:11 -0800603// Any class here *must* have a corresponding jarjar rule in the wifi build rules.
604filegroup {
605 name: "net-utils-framework-wifi-common-srcs",
606 srcs: [
Chalard Jeanb61091b2021-10-07 15:29:13 +0900607 "framework/com/android/net/module/util/DnsSdTxtRecord.java",
608 "framework/com/android/net/module/util/Inet4AddressUtils.java",
609 "framework/com/android/net/module/util/InetAddressUtils.java",
610 "framework/com/android/net/module/util/MacAddressUtils.java",
611 "framework/com/android/net/module/util/NetUtils.java",
Roshan Pius864bdec2020-01-16 09:19:11 -0800612 ],
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900613 path: "framework",
Nate Jiang5f0471c2024-07-12 16:49:52 +0000614 visibility: ["//visibility:private"],
Roshan Pius864bdec2020-01-16 09:19:11 -0800615}
Handa Wang9b0df362024-07-02 13:17:43 +0000616
617// Use a file group containing classes necessary for framework-connectivity. The file group should
618// be as small as possible because because the classes end up in the bootclasspath and R8 is not
619// used to remove unused classes.
620filegroup {
621 name: "net-utils-framework-connectivity-srcs",
622 srcs: [
623 "device/com/android/net/module/util/BpfBitmap.java",
624 "device/com/android/net/module/util/BpfDump.java",
625 "device/com/android/net/module/util/BpfMap.java",
626 "device/com/android/net/module/util/BpfUtils.java",
627 "device/com/android/net/module/util/IBpfMap.java",
628 "device/com/android/net/module/util/JniUtil.java",
629 "device/com/android/net/module/util/SingleWriterBpfMap.java",
630 "device/com/android/net/module/util/Struct.java",
631 "device/com/android/net/module/util/TcUtils.java",
632 "framework/com/android/net/module/util/HexDump.java",
633 ],
634 visibility: ["//visibility:private"],
635}
636
637filegroup {
638 name: "net-utils-all-srcs",
639 srcs: [
640 "device/**/*.java",
641 ":net-utils-framework-common-srcs",
642 ],
643 visibility: ["//visibility:private"],
644}
645
646filegroup {
647 name: "net-utils-aidl-srcs",
648 srcs: [
649 "device/**/*.aidl",
650 ],
651 path: "device",
652 visibility: ["//visibility:private"],
653}
Nate Jiang5f0471c2024-07-12 16:49:52 +0000654
655java_library {
656 name: "net-utils-service-wifi",
657 srcs: [
658 ":net-utils-all-srcs",
659 ],
660 exclude_srcs: [":net-utils-framework-wifi-common-srcs"],
661 libs: [
662 "net-utils-framework-wifi",
663 ],
664 defaults: ["net-utils-non-bootclasspath-defaults"],
665
666 visibility: [
667 "//packages/modules/Wifi/service",
668 ],
669 apex_available: [
670 "com.android.wifi",
671 ],
672}
673
674java_library {
675 name: "net-utils-framework-wifi",
676 sdk_version: "module_current",
677 min_sdk_version: "30",
678 srcs: [":net-utils-framework-wifi-common-srcs"],
679 libs: [
680 "framework-annotations-lib",
681 "framework-connectivity.stubs.module_lib",
682 "unsupportedappusage",
683 ],
684 visibility: [
685 "//packages/modules/Wifi/framework",
686 ],
687 apex_available: ["com.android.wifi"],
688}