blob: decfff8b01353e051c0912b9b2418edec0eb9992 [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",
42 "device/com/android/net/module/util/NetworkMonitorUtils.java",
43 "device/com/android/net/module/util/PacketReader.java",
44 "device/com/android/net/module/util/SharedLog.java",
45 "device/com/android/net/module/util/SocketUtils.java",
46 "device/com/android/net/module/util/FeatureVersions.java",
47 "device/com/android/net/module/util/HandlerUtils.java",
48 // This library is used by system modules, for which the system health impact of Kotlin
49 // has not yet been evaluated. Annotations may need jarjar'ing.
50 // "src_devicecommon/**/*.kt",
51 ],
52 sdk_version: "module_current",
53 min_sdk_version: "30",
54 target_sdk_version: "30",
55 apex_available: [
56 "//apex_available:anyapex",
57 "//apex_available:platform",
58 ],
59 visibility: [
Chalard Jean48c6c7d2020-06-25 23:39:15 +090060 "//frameworks/base/packages/Tethering",
Baligh Uddinf8c12822021-05-21 04:26:52 +000061 "//packages/modules/Connectivity:__subpackages__",
62 "//packages/modules/Connectivity/framework:__subpackages__",
Chalard Jean48c6c7d2020-06-25 23:39:15 +090063 "//frameworks/opt/net/ike",
64 "//frameworks/opt/net/wifi/service",
Baligh Uddinfcbda3a2020-12-24 06:12:25 +000065 "//packages/modules/Wifi/service",
Chalard Jean48c6c7d2020-06-25 23:39:15 +090066 "//frameworks/opt/net/telephony",
Xiao Ma6f95cef2020-09-08 19:16:15 +090067 "//packages/modules/NetworkStack:__subpackages__",
Chalard Jean48c6c7d2020-06-25 23:39:15 +090068 "//packages/modules/CaptivePortalLogin",
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000069 ],
70 static_libs: [
71 "net-utils-framework-common",
72 ],
73 libs: [
74 "androidx.annotation_annotation",
75 "framework-annotations-lib",
76 "framework-configinfrastructure",
77 "framework-connectivity.stubs.module_lib",
78 ],
79 lint: {
80 strict_updatability_linting: true,
81 error_checks: ["NewApi"],
82 },
Chalard Jean48c6c7d2020-06-25 23:39:15 +090083}
84
Chalard Jean48c6c7d2020-06-25 23:39:15 +090085java_defaults {
86 name: "lib_mockito_extended",
87 static_libs: [
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000088 "mockito-target-extended-minus-junit4",
Chalard Jean48c6c7d2020-06-25 23:39:15 +090089 ],
90 jni_libs: [
91 "libdexmakerjvmtiagent",
92 "libstaticjvmtiagent",
93 ],
94}
95
Aswin Sankar601d6f92021-10-11 13:12:16 -070096java_library {
97 name: "net-utils-dnspacket-common",
98 srcs: [
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000099 "framework/**/DnsPacket.java",
100 "framework/**/DnsPacketUtils.java",
101 "framework/**/DnsSvcbPacket.java",
102 "framework/**/DnsSvcbRecord.java",
103 "framework/**/HexDump.java",
104 "framework/**/NetworkStackConstants.java",
Aswin Sankar601d6f92021-10-11 13:12:16 -0700105 ],
106 sdk_version: "module_current",
107 visibility: [
108 "//packages/services/Iwlan:__subpackages__",
109 ],
Junyu Lai85e24e82022-09-15 07:34:51 +0000110 libs: [
Mike Yu9b96c832023-09-18 08:26:08 +0000111 "androidx.annotation_annotation",
Junyu Lai85e24e82022-09-15 07:34:51 +0000112 "framework-annotations-lib",
113 "framework-connectivity.stubs.module_lib",
114 ],
Aswin Sankar601d6f92021-10-11 13:12:16 -0700115}
116
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800117filegroup {
118 name: "net-utils-framework-common-srcs",
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900119 srcs: ["framework/**/*.java"],
120 path: "framework",
Remi NGUYEN VAN651faf72021-03-24 22:40:37 +0900121 visibility: [
122 "//frameworks/base",
Baligh Uddin27e5fcd2021-05-22 13:16:30 +0000123 "//packages/modules/Connectivity:__subpackages__",
Remi NGUYEN VAN651faf72021-03-24 22:40:37 +0900124 ],
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800125}
126
Yang Sun3aa62e62024-03-12 21:23:19 +0800127// The net-utils-device-common-bpf library requires the callers to contain
128// net-utils-device-common-struct-base.
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800129java_library {
markchienf3448f92021-11-10 01:06:51 +0800130 name: "net-utils-device-common-bpf",
Xiao Ma57b34422021-07-01 13:57:02 +0000131 srcs: [
Tyler Wear92f3c242022-02-15 15:21:43 -0800132 "device/com/android/net/module/util/BpfBitmap.java",
Hungming Chenb3e71a22022-06-23 21:34:54 +0800133 "device/com/android/net/module/util/BpfDump.java",
Tyler Wearaafd9c12021-10-19 11:01:46 -0700134 "device/com/android/net/module/util/BpfMap.java",
Tyler Weare48ee4a2022-02-15 15:30:50 -0800135 "device/com/android/net/module/util/BpfUtils.java",
markchien2e5fece2022-01-21 10:16:54 +0800136 "device/com/android/net/module/util/IBpfMap.java",
markchienf3448f92021-11-10 01:06:51 +0800137 "device/com/android/net/module/util/JniUtil.java",
Lorenzo Colitti05be2f52024-06-02 13:24:21 +0900138 "device/com/android/net/module/util/SingleWriterBpfMap.java",
Patrick Rohr29b0d952022-01-12 21:42:24 +0100139 "device/com/android/net/module/util/TcUtils.java",
markchienf3448f92021-11-10 01:06:51 +0800140 ],
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900141 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000142 min_sdk_version: "30",
markchienf3448f92021-11-10 01:06:51 +0800143 visibility: [
markchienf3448f92021-11-10 01:06:51 +0800144 "//packages/modules/Connectivity:__subpackages__",
145 "//packages/modules/NetworkStack:__subpackages__",
146 ],
markchienf3448f92021-11-10 01:06:51 +0800147 libs: [
148 "androidx.annotation_annotation",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900149 "framework-connectivity.stubs.module_lib",
Yang Sun3aa62e62024-03-12 21:23:19 +0800150 "net-utils-device-common-struct-base",
markchienf3448f92021-11-10 01:06:51 +0800151 ],
152 apex_available: [
153 "com.android.tethering",
154 "//apex_available:platform",
155 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900156 lint: {
157 strict_updatability_linting: true,
158 error_checks: ["NewApi"],
159 },
markchienf3448f92021-11-10 01:06:51 +0800160}
161
162java_library {
Yang Sun3aa62e62024-03-12 21:23:19 +0800163 name: "net-utils-device-common-struct-base",
markchienf3448f92021-11-10 01:06:51 +0800164 srcs: [
Xiao Ma57b34422021-07-01 13:57:02 +0000165 "device/com/android/net/module/util/Struct.java",
Xiao Ma57b34422021-07-01 13:57:02 +0000166 ],
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900167 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000168 min_sdk_version: "30",
Xiao Ma57b34422021-07-01 13:57:02 +0000169 visibility: [
Xiao Ma57b34422021-07-01 13:57:02 +0000170 "//packages/modules/Connectivity:__subpackages__",
171 "//packages/modules/NetworkStack:__subpackages__",
172 ],
173 static_libs: [
174 "net-utils-framework-common",
175 ],
176 libs: [
177 "androidx.annotation_annotation",
Yang Sun3aa62e62024-03-12 21:23:19 +0800178 "framework-annotations-lib", // Required by InetAddressUtils.java
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900179 "framework-connectivity.stubs.module_lib",
Xiao Ma57b34422021-07-01 13:57:02 +0000180 ],
181 apex_available: [
182 "com.android.tethering",
183 "//apex_available:platform",
184 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900185 lint: {
186 strict_updatability_linting: true,
187 error_checks: ["NewApi"],
188 },
Xiao Ma57b34422021-07-01 13:57:02 +0000189}
190
Yang Sun3aa62e62024-03-12 21:23:19 +0800191// The net-utils-device-common-struct library requires the callers to contain
192// net-utils-device-common-struct-base.
Yang Sun1c9fb592024-02-19 10:37:26 +0800193java_library {
Yang Sun3aa62e62024-03-12 21:23:19 +0800194 name: "net-utils-device-common-struct",
Yang Sun1c9fb592024-02-19 10:37:26 +0800195 srcs: [
Yang Sun3aa62e62024-03-12 21:23:19 +0800196 "device/com/android/net/module/util/Ipv6Utils.java",
197 "device/com/android/net/module/util/PacketBuilder.java",
198 "device/com/android/net/module/util/structs/*.java",
Yang Sun1c9fb592024-02-19 10:37:26 +0800199 ],
200 sdk_version: "module_current",
201 min_sdk_version: "30",
202 visibility: [
203 "//packages/modules/Connectivity:__subpackages__",
Yang Sun3aa62e62024-03-12 21:23:19 +0800204 "//packages/modules/NetworkStack:__subpackages__",
Yang Sun1c9fb592024-02-19 10:37:26 +0800205 ],
206 libs: [
Yang Sun3aa62e62024-03-12 21:23:19 +0800207 "androidx.annotation_annotation",
208 "framework-annotations-lib", // Required by IpUtils.java
209 "framework-connectivity.stubs.module_lib",
210 "net-utils-device-common-struct-base",
Yang Sun1c9fb592024-02-19 10:37:26 +0800211 ],
212 apex_available: [
213 "com.android.tethering",
Yang Sun3aa62e62024-03-12 21:23:19 +0800214 "//apex_available:platform",
Yang Sun1c9fb592024-02-19 10:37:26 +0800215 ],
216 lint: {
217 strict_updatability_linting: true,
218 error_checks: ["NewApi"],
219 },
220}
221
Junyu Lai626045a2023-08-28 18:49:44 +0800222// The net-utils-device-common-netlink library requires the callers to contain
Yang Sun3aa62e62024-03-12 21:23:19 +0800223// net-utils-device-common-struct and net-utils-device-common-struct-base.
Xiao Ma57b34422021-07-01 13:57:02 +0000224java_library {
markchienf3448f92021-11-10 01:06:51 +0800225 name: "net-utils-device-common-netlink",
226 srcs: [
Yan Yanf085fad2023-11-20 18:51:30 +0000227 "device/com/android/net/module/util/netlink/**/*.java",
markchienf3448f92021-11-10 01:06:51 +0800228 ],
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900229 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000230 min_sdk_version: "30",
markchienf3448f92021-11-10 01:06:51 +0800231 visibility: [
markchienf3448f92021-11-10 01:06:51 +0800232 "//packages/modules/Connectivity:__subpackages__",
233 "//packages/modules/NetworkStack:__subpackages__",
234 ],
markchienf3448f92021-11-10 01:06:51 +0800235 libs: [
236 "androidx.annotation_annotation",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900237 "framework-connectivity.stubs.module_lib",
Junyu Lai626045a2023-08-28 18:49:44 +0800238 // For libraries which are statically linked in framework-connectivity, do not
239 // statically link here because callers of this library might already have a static
240 // version linked.
241 "net-utils-device-common-struct",
Yang Sun3aa62e62024-03-12 21:23:19 +0800242 "net-utils-device-common-struct-base",
markchienf3448f92021-11-10 01:06:51 +0800243 ],
244 apex_available: [
245 "com.android.tethering",
246 "//apex_available:platform",
247 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900248 lint: {
249 strict_updatability_linting: true,
250 error_checks: ["NewApi"],
251 },
markchienf3448f92021-11-10 01:06:51 +0800252}
253
Junyu Lai626045a2023-08-28 18:49:44 +0800254// The net-utils-device-common-ip library requires the callers to contain
Yang Sun3aa62e62024-03-12 21:23:19 +0800255// net-utils-device-common-struct and net-utils-device-common-struct-base.
markchienf3448f92021-11-10 01:06:51 +0800256java_library {
Chalard Jeanb61091b2021-10-07 15:29:13 +0900257 // TODO : this target should probably be folded into net-utils-device-common
258 name: "net-utils-device-common-ip",
259 srcs: [
260 "device/com/android/net/module/util/ip/*.java",
261 ],
262 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000263 min_sdk_version: "30",
Chalard Jeanb61091b2021-10-07 15:29:13 +0900264 visibility: [
Chalard Jeanb61091b2021-10-07 15:29:13 +0900265 "//packages/modules/Connectivity:__subpackages__",
266 "//packages/modules/NetworkStack:__subpackages__",
267 ],
268 libs: [
269 "framework-annotations-lib",
270 "framework-connectivity",
271 ],
272 static_libs: [
273 "net-utils-device-common",
274 "net-utils-device-common-netlink",
275 "net-utils-framework-common",
276 "netd-client",
277 ],
278 apex_available: [
279 "com.android.tethering",
280 "//apex_available:platform",
281 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900282 lint: {
Motomu Utsumia1a00342024-06-13 09:29:47 +0000283 strict_updatability_linting: true,
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900284 error_checks: ["NewApi"],
285 },
Chalard Jeanb61091b2021-10-07 15:29:13 +0900286}
287
288java_library {
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800289 name: "net-utils-framework-common",
Remi NGUYEN VANce241a32020-01-14 21:42:09 +0900290 srcs: [
291 ":net-utils-framework-common-srcs",
Remi NGUYEN VANce241a32020-01-14 21:42:09 +0900292 ],
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900293 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000294 min_sdk_version: "30",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900295 libs: [
Jooyung Hanb3b67982022-06-24 14:56:24 +0900296 "androidx.annotation_annotation",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900297 "framework-annotations-lib",
298 "framework-connectivity.stubs.module_lib",
paulhucdb069e2022-02-14 15:28:50 +0800299 "framework-connectivity-t.stubs.module_lib",
Mark White66d39cd2023-08-07 15:20:07 +0000300 "framework-location.stubs.module_lib",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900301 ],
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 Jean7592a342021-04-19 18:04:34 +0900346 static_libs: [
347 "modules-utils-build_system",
348 ],
Chalard Jeand5802422021-10-27 19:02:14 +0900349 libs: [
350 "framework-annotations-lib",
351 "framework-connectivity",
352 ],
Xiao Ma2bbc2f72022-01-24 07:58:12 +0000353 // TODO: remove "apex_available:platform".
354 apex_available: [
355 "//apex_available:platform",
William Escandefbe576b2022-08-22 11:28:00 -0700356 "com.android.btservices",
Xiao Ma2bbc2f72022-01-24 07:58:12 +0000357 "com.android.tethering",
Anton Hansson0ceeb7c2022-05-30 12:01:49 +0000358 "com.android.wifi",
Xiao Ma2bbc2f72022-01-24 07:58:12 +0000359 ],
Aaron Huang57a94962020-01-03 20:35:55 +0800360 visibility: [
markchien32a6e9c2022-01-20 14:34:15 +0800361 // TODO: remove after NetworkStatsService moves to the module.
Remi NGUYEN VAN376f8d42020-01-15 18:26:29 +0900362 "//frameworks/base/services/net",
Xiao Ma2bbc2f72022-01-24 07:58:12 +0000363 "//packages/modules/Connectivity/service",
Remi NGUYEN VAN0cf724a2021-11-19 18:33:12 +0900364 "//packages/modules/Connectivity/tests:__subpackages__",
Roopa Sattiraju98fa3bf2022-02-03 18:53:23 -0800365 "//packages/modules/Bluetooth/android/app",
Nate(Qiang) Jiangce723aa2022-06-01 21:28:32 +0000366 "//packages/modules/Wifi/service:__subpackages__",
Aaron Huang57a94962020-01-03 20:35:55 +0800367 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900368 lint: {
369 strict_updatability_linting: true,
370 error_checks: ["NewApi"],
371 },
Aaron Huang57a94962020-01-03 20:35:55 +0800372}
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900373
Igor Chernysheva25f1092022-12-20 00:07:38 -0800374java_library {
375 name: "net-utils-device-common-async",
376 srcs: [
377 "device/com/android/net/module/util/async/*.java",
378 ],
379 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000380 min_sdk_version: "30",
Igor Chernysheva25f1092022-12-20 00:07:38 -0800381 visibility: [
Igor Chernysheva25f1092022-12-20 00:07:38 -0800382 "//packages/modules/Connectivity:__subpackages__",
383 ],
384 libs: [
385 "framework-annotations-lib",
386 ],
387 static_libs: [
388 ],
389 apex_available: [
390 "com.android.tethering",
391 "//apex_available:platform",
392 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900393 lint: {
394 strict_updatability_linting: true,
395 error_checks: ["NewApi"],
396 },
Igor Chernysheva25f1092022-12-20 00:07:38 -0800397}
398
Igor Chernyshev810be2b2023-04-06 15:52:26 -0700399java_library {
400 name: "net-utils-device-common-wear",
401 srcs: [
402 "device/com/android/net/module/util/wear/*.java",
403 ],
404 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000405 min_sdk_version: "30",
Igor Chernyshev810be2b2023-04-06 15:52:26 -0700406 visibility: [
Igor Chernyshev810be2b2023-04-06 15:52:26 -0700407 "//packages/modules/Connectivity:__subpackages__",
408 ],
409 libs: [
410 "framework-annotations-lib",
411 ],
412 static_libs: [
413 "net-utils-device-common-async",
414 ],
415 apex_available: [
416 "com.android.tethering",
417 "//apex_available:platform",
418 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900419 lint: {
420 strict_updatability_linting: true,
421 error_checks: ["NewApi"],
422 },
Igor Chernyshev810be2b2023-04-06 15:52:26 -0700423}
424
Yuyang Huangf67388b2023-03-29 16:51:09 +0900425// Limited set of utilities for use by service-connectivity-mdns-standalone-build-test, to make sure
426// the mDNS code can build with only system APIs.
427// The mDNS code is platform code so it should use framework-annotations-lib, contrary to apps that
428// should use sdk_version: "system_current" and only androidx.annotation_annotation. But this build
429// rule verifies that the mDNS code can be built into apps, if code transformations are applied to
430// the annotations.
431// When using "system_current", framework annotations are not available; they would appear as
432// package-private as they are marked as such in the system_current stubs. So build against
433// core_platform and add the stubs manually in "libs". See http://b/147773144#comment7.
434java_library {
435 name: "net-utils-device-common-mdns-standalone-build-test",
436 // Build against core_platform and add the stub libraries manually in "libs", as annotations
437 // are already included in android_system_stubs_current but package-private, so
438 // "framework-annotations-lib" needs to be manually included before
439 // "android_system_stubs_current" (b/272392042)
440 sdk_version: "core_platform",
441 srcs: [
442 "device/com/android/net/module/util/FdEventsReader.java",
Yuyang Huangf67388b2023-03-29 16:51:09 +0900443 "device/com/android/net/module/util/SharedLog.java",
444 "framework/com/android/net/module/util/ByteUtils.java",
445 "framework/com/android/net/module/util/CollectionUtils.java",
Yuyang Huange4eb87a2023-05-02 18:44:51 +0900446 "framework/com/android/net/module/util/HexDump.java",
Yuyang Huangf67388b2023-03-29 16:51:09 +0900447 "framework/com/android/net/module/util/LinkPropertiesUtils.java",
448 ],
449 libs: [
450 "framework-annotations-lib",
451 "android_system_stubs_current",
452 "androidx.annotation_annotation",
453 ],
454 visibility: ["//packages/modules/Connectivity/service-t"],
455}
456
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900457// Use a filegroup and not a library for telephony sources, as framework-annotations cannot be
458// included either (some annotations would be duplicated on the bootclasspath).
459filegroup {
460 name: "net-utils-telephony-common-srcs",
461 srcs: [
462 // Any class here *must* have a corresponding jarjar rule in the telephony build rules.
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900463 "device/android/net/NetworkFactory.java",
Chalard Jean7592a342021-04-19 18:04:34 +0900464 "device/android/net/NetworkFactoryImpl.java",
465 "device/android/net/NetworkFactoryLegacyImpl.java",
466 "device/android/net/NetworkFactoryShim.java",
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900467 ],
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900468 path: "device",
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900469 visibility: [
470 "//frameworks/opt/telephony",
471 ],
472}
Roshan Pius864bdec2020-01-16 09:19:11 -0800473
474// Use a filegroup and not a library for wifi sources, as this needs corresponding jar-jar
475// rules on the wifi side.
476// Any class here *must* have a corresponding jarjar rule in the wifi build rules.
477filegroup {
478 name: "net-utils-framework-wifi-common-srcs",
479 srcs: [
Chalard Jeanb61091b2021-10-07 15:29:13 +0900480 "framework/com/android/net/module/util/DnsSdTxtRecord.java",
481 "framework/com/android/net/module/util/Inet4AddressUtils.java",
482 "framework/com/android/net/module/util/InetAddressUtils.java",
483 "framework/com/android/net/module/util/MacAddressUtils.java",
484 "framework/com/android/net/module/util/NetUtils.java",
Roshan Pius864bdec2020-01-16 09:19:11 -0800485 ],
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900486 path: "framework",
Roshan Pius864bdec2020-01-16 09:19:11 -0800487 visibility: [
488 "//frameworks/base",
489 ],
490}
491
492// Use a filegroup and not a library for wifi sources, as this needs corresponding jar-jar
493// rules on the wifi side.
494// Any class here *must* have a corresponding jarjar rule in the wifi build rules.
495filegroup {
496 name: "net-utils-wifi-service-common-srcs",
497 srcs: [
Aditya Choudhary01b5ede2024-01-31 11:08:57 +0000498 "device/android/net/NetworkFactory.java",
499 "device/android/net/NetworkFactoryImpl.java",
500 "device/android/net/NetworkFactoryLegacyImpl.java",
501 "device/android/net/NetworkFactoryShim.java",
Roshan Pius864bdec2020-01-16 09:19:11 -0800502 ],
503 visibility: [
504 "//frameworks/opt/net/wifi/service",
Baligh Uddinfcbda3a2020-12-24 06:12:25 +0000505 "//packages/modules/Wifi/service",
Roshan Pius864bdec2020-01-16 09:19:11 -0800506 ],
507}