blob: c9c8be96e4d3802c3ed7c88d5cad5a94c22c49b0 [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: [
Chalard Jean48c6c7d2020-06-25 23:39:15 +090061 "//frameworks/base/packages/Tethering",
Baligh Uddinf8c12822021-05-21 04:26:52 +000062 "//packages/modules/Connectivity:__subpackages__",
63 "//packages/modules/Connectivity/framework:__subpackages__",
Chalard Jean48c6c7d2020-06-25 23:39:15 +090064 "//frameworks/opt/net/ike",
65 "//frameworks/opt/net/wifi/service",
Baligh Uddinfcbda3a2020-12-24 06:12:25 +000066 "//packages/modules/Wifi/service",
Chalard Jean48c6c7d2020-06-25 23:39:15 +090067 "//frameworks/opt/net/telephony",
Xiao Ma6f95cef2020-09-08 19:16:15 +090068 "//packages/modules/NetworkStack:__subpackages__",
Chalard Jean48c6c7d2020-06-25 23:39:15 +090069 "//packages/modules/CaptivePortalLogin",
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000070 ],
71 static_libs: [
Patrick Rohraa06b2b2024-06-17 14:18:36 -070072 "modules-utils-statemachine",
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000073 "net-utils-framework-common",
74 ],
75 libs: [
76 "androidx.annotation_annotation",
77 "framework-annotations-lib",
78 "framework-configinfrastructure",
79 "framework-connectivity.stubs.module_lib",
80 ],
81 lint: {
82 strict_updatability_linting: true,
83 error_checks: ["NewApi"],
84 },
Chalard Jean48c6c7d2020-06-25 23:39:15 +090085}
86
Chalard Jean48c6c7d2020-06-25 23:39:15 +090087java_defaults {
88 name: "lib_mockito_extended",
89 static_libs: [
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000090 "mockito-target-extended-minus-junit4",
Chalard Jean48c6c7d2020-06-25 23:39:15 +090091 ],
92 jni_libs: [
93 "libdexmakerjvmtiagent",
94 "libstaticjvmtiagent",
95 ],
96}
97
Aswin Sankar601d6f92021-10-11 13:12:16 -070098java_library {
99 name: "net-utils-dnspacket-common",
100 srcs: [
Aditya Choudhary01b5ede2024-01-31 11:08:57 +0000101 "framework/**/DnsPacket.java",
102 "framework/**/DnsPacketUtils.java",
103 "framework/**/DnsSvcbPacket.java",
104 "framework/**/DnsSvcbRecord.java",
105 "framework/**/HexDump.java",
106 "framework/**/NetworkStackConstants.java",
Aswin Sankar601d6f92021-10-11 13:12:16 -0700107 ],
108 sdk_version: "module_current",
109 visibility: [
110 "//packages/services/Iwlan:__subpackages__",
111 ],
Junyu Lai85e24e82022-09-15 07:34:51 +0000112 libs: [
Mike Yu9b96c832023-09-18 08:26:08 +0000113 "androidx.annotation_annotation",
Junyu Lai85e24e82022-09-15 07:34:51 +0000114 "framework-annotations-lib",
115 "framework-connectivity.stubs.module_lib",
116 ],
Aswin Sankar601d6f92021-10-11 13:12:16 -0700117}
118
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800119filegroup {
120 name: "net-utils-framework-common-srcs",
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900121 srcs: ["framework/**/*.java"],
122 path: "framework",
Remi NGUYEN VAN651faf72021-03-24 22:40:37 +0900123 visibility: [
124 "//frameworks/base",
Baligh Uddin27e5fcd2021-05-22 13:16:30 +0000125 "//packages/modules/Connectivity:__subpackages__",
Remi NGUYEN VAN651faf72021-03-24 22:40:37 +0900126 ],
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800127}
128
Yang Sun3aa62e62024-03-12 21:23:19 +0800129// The net-utils-device-common-bpf library requires the callers to contain
130// net-utils-device-common-struct-base.
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800131java_library {
markchienf3448f92021-11-10 01:06:51 +0800132 name: "net-utils-device-common-bpf",
Xiao Ma57b34422021-07-01 13:57:02 +0000133 srcs: [
Tyler Wear92f3c242022-02-15 15:21:43 -0800134 "device/com/android/net/module/util/BpfBitmap.java",
Hungming Chenb3e71a22022-06-23 21:34:54 +0800135 "device/com/android/net/module/util/BpfDump.java",
Tyler Wearaafd9c12021-10-19 11:01:46 -0700136 "device/com/android/net/module/util/BpfMap.java",
Tyler Weare48ee4a2022-02-15 15:30:50 -0800137 "device/com/android/net/module/util/BpfUtils.java",
markchien2e5fece2022-01-21 10:16:54 +0800138 "device/com/android/net/module/util/IBpfMap.java",
markchienf3448f92021-11-10 01:06:51 +0800139 "device/com/android/net/module/util/JniUtil.java",
Lorenzo Colitti05be2f52024-06-02 13:24:21 +0900140 "device/com/android/net/module/util/SingleWriterBpfMap.java",
Patrick Rohr29b0d952022-01-12 21:42:24 +0100141 "device/com/android/net/module/util/TcUtils.java",
markchienf3448f92021-11-10 01:06:51 +0800142 ],
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900143 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000144 min_sdk_version: "30",
markchienf3448f92021-11-10 01:06:51 +0800145 visibility: [
markchienf3448f92021-11-10 01:06:51 +0800146 "//packages/modules/Connectivity:__subpackages__",
147 "//packages/modules/NetworkStack:__subpackages__",
148 ],
markchienf3448f92021-11-10 01:06:51 +0800149 libs: [
150 "androidx.annotation_annotation",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900151 "framework-connectivity.stubs.module_lib",
Yang Sun3aa62e62024-03-12 21:23:19 +0800152 "net-utils-device-common-struct-base",
markchienf3448f92021-11-10 01:06:51 +0800153 ],
154 apex_available: [
155 "com.android.tethering",
156 "//apex_available:platform",
157 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900158 lint: {
159 strict_updatability_linting: true,
160 error_checks: ["NewApi"],
161 },
markchienf3448f92021-11-10 01:06:51 +0800162}
163
164java_library {
Yang Sun3aa62e62024-03-12 21:23:19 +0800165 name: "net-utils-device-common-struct-base",
markchienf3448f92021-11-10 01:06:51 +0800166 srcs: [
Xiao Ma57b34422021-07-01 13:57:02 +0000167 "device/com/android/net/module/util/Struct.java",
Xiao Ma57b34422021-07-01 13:57:02 +0000168 ],
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900169 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000170 min_sdk_version: "30",
Xiao Ma57b34422021-07-01 13:57:02 +0000171 visibility: [
Xiao Ma57b34422021-07-01 13:57:02 +0000172 "//packages/modules/Connectivity:__subpackages__",
173 "//packages/modules/NetworkStack:__subpackages__",
174 ],
175 static_libs: [
176 "net-utils-framework-common",
177 ],
178 libs: [
179 "androidx.annotation_annotation",
Yang Sun3aa62e62024-03-12 21:23:19 +0800180 "framework-annotations-lib", // Required by InetAddressUtils.java
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900181 "framework-connectivity.stubs.module_lib",
Xiao Ma57b34422021-07-01 13:57:02 +0000182 ],
183 apex_available: [
184 "com.android.tethering",
185 "//apex_available:platform",
186 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900187 lint: {
188 strict_updatability_linting: true,
189 error_checks: ["NewApi"],
190 },
Xiao Ma57b34422021-07-01 13:57:02 +0000191}
192
Yang Sun3aa62e62024-03-12 21:23:19 +0800193// The net-utils-device-common-struct library requires the callers to contain
194// net-utils-device-common-struct-base.
Yang Sun1c9fb592024-02-19 10:37:26 +0800195java_library {
Yang Sun3aa62e62024-03-12 21:23:19 +0800196 name: "net-utils-device-common-struct",
Yang Sun1c9fb592024-02-19 10:37:26 +0800197 srcs: [
Yang Sun3aa62e62024-03-12 21:23:19 +0800198 "device/com/android/net/module/util/Ipv6Utils.java",
199 "device/com/android/net/module/util/PacketBuilder.java",
200 "device/com/android/net/module/util/structs/*.java",
Yang Sun1c9fb592024-02-19 10:37:26 +0800201 ],
202 sdk_version: "module_current",
203 min_sdk_version: "30",
204 visibility: [
205 "//packages/modules/Connectivity:__subpackages__",
Yang Sun3aa62e62024-03-12 21:23:19 +0800206 "//packages/modules/NetworkStack:__subpackages__",
Yang Sun1c9fb592024-02-19 10:37:26 +0800207 ],
208 libs: [
Yang Sun3aa62e62024-03-12 21:23:19 +0800209 "androidx.annotation_annotation",
210 "framework-annotations-lib", // Required by IpUtils.java
211 "framework-connectivity.stubs.module_lib",
212 "net-utils-device-common-struct-base",
Yang Sun1c9fb592024-02-19 10:37:26 +0800213 ],
214 apex_available: [
215 "com.android.tethering",
Yang Sun3aa62e62024-03-12 21:23:19 +0800216 "//apex_available:platform",
Yang Sun1c9fb592024-02-19 10:37:26 +0800217 ],
218 lint: {
219 strict_updatability_linting: true,
220 error_checks: ["NewApi"],
221 },
222}
223
Junyu Lai626045a2023-08-28 18:49:44 +0800224// The net-utils-device-common-netlink library requires the callers to contain
Yang Sun3aa62e62024-03-12 21:23:19 +0800225// net-utils-device-common-struct and net-utils-device-common-struct-base.
Xiao Ma57b34422021-07-01 13:57:02 +0000226java_library {
markchienf3448f92021-11-10 01:06:51 +0800227 name: "net-utils-device-common-netlink",
228 srcs: [
Yan Yanf085fad2023-11-20 18:51:30 +0000229 "device/com/android/net/module/util/netlink/**/*.java",
markchienf3448f92021-11-10 01:06:51 +0800230 ],
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900231 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000232 min_sdk_version: "30",
markchienf3448f92021-11-10 01:06:51 +0800233 visibility: [
markchienf3448f92021-11-10 01:06:51 +0800234 "//packages/modules/Connectivity:__subpackages__",
235 "//packages/modules/NetworkStack:__subpackages__",
236 ],
markchienf3448f92021-11-10 01:06:51 +0800237 libs: [
238 "androidx.annotation_annotation",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900239 "framework-connectivity.stubs.module_lib",
Junyu Lai626045a2023-08-28 18:49:44 +0800240 // For libraries which are statically linked in framework-connectivity, do not
241 // statically link here because callers of this library might already have a static
242 // version linked.
243 "net-utils-device-common-struct",
Yang Sun3aa62e62024-03-12 21:23:19 +0800244 "net-utils-device-common-struct-base",
markchienf3448f92021-11-10 01:06:51 +0800245 ],
246 apex_available: [
247 "com.android.tethering",
248 "//apex_available:platform",
249 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900250 lint: {
251 strict_updatability_linting: true,
252 error_checks: ["NewApi"],
253 },
markchienf3448f92021-11-10 01:06:51 +0800254}
255
Junyu Lai626045a2023-08-28 18:49:44 +0800256// The net-utils-device-common-ip library requires the callers to contain
Yang Sun3aa62e62024-03-12 21:23:19 +0800257// net-utils-device-common-struct and net-utils-device-common-struct-base.
markchienf3448f92021-11-10 01:06:51 +0800258java_library {
Chalard Jeanb61091b2021-10-07 15:29:13 +0900259 // TODO : this target should probably be folded into net-utils-device-common
260 name: "net-utils-device-common-ip",
261 srcs: [
262 "device/com/android/net/module/util/ip/*.java",
263 ],
264 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000265 min_sdk_version: "30",
Chalard Jeanb61091b2021-10-07 15:29:13 +0900266 visibility: [
Chalard Jeanb61091b2021-10-07 15:29:13 +0900267 "//packages/modules/Connectivity:__subpackages__",
268 "//packages/modules/NetworkStack:__subpackages__",
269 ],
270 libs: [
271 "framework-annotations-lib",
272 "framework-connectivity",
273 ],
274 static_libs: [
275 "net-utils-device-common",
276 "net-utils-device-common-netlink",
277 "net-utils-framework-common",
278 "netd-client",
279 ],
280 apex_available: [
281 "com.android.tethering",
282 "//apex_available:platform",
283 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900284 lint: {
Motomu Utsumia1a00342024-06-13 09:29:47 +0000285 strict_updatability_linting: true,
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900286 error_checks: ["NewApi"],
287 },
Chalard Jeanb61091b2021-10-07 15:29:13 +0900288}
289
290java_library {
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800291 name: "net-utils-framework-common",
Remi NGUYEN VANce241a32020-01-14 21:42:09 +0900292 srcs: [
293 ":net-utils-framework-common-srcs",
Remi NGUYEN VANce241a32020-01-14 21:42:09 +0900294 ],
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900295 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000296 min_sdk_version: "30",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900297 libs: [
Jooyung Hanb3b67982022-06-24 14:56:24 +0900298 "androidx.annotation_annotation",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900299 "framework-annotations-lib",
300 "framework-connectivity.stubs.module_lib",
paulhucdb069e2022-02-14 15:28:50 +0800301 "framework-connectivity-t.stubs.module_lib",
Mark White66d39cd2023-08-07 15:20:07 +0000302 "framework-location.stubs.module_lib",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900303 ],
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800304 jarjar_rules: "jarjar-rules-shared.txt",
305 visibility: [
Luke Huangfd5479e2020-06-20 11:38:17 +0800306 "//cts/tests/tests/net",
Chalard Jeanceaf7d02020-06-26 18:34:52 +0900307 "//cts/tests/tests/wifi",
Baligh Uddine685c812020-10-31 04:28:58 +0000308 "//packages/modules/Connectivity/tests/cts/net",
Baligh Uddinae4770d2020-10-29 02:12:06 +0000309 "//packages/modules/Connectivity/Tethering",
Chalard Jeana9f49912020-10-15 18:06:30 +0900310 "//frameworks/base/tests:__subpackages__",
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800311 "//frameworks/opt/net/ike",
312 "//frameworks/opt/telephony",
Chalard Jean19789192020-10-01 12:45:31 +0900313 "//frameworks/base/wifi:__subpackages__",
Remi NGUYEN VAN38afb0c2020-11-10 18:04:27 +0900314 "//packages/modules/Connectivity:__subpackages__",
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900315 "//packages/modules/NetworkStack:__subpackages__",
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800316 "//packages/modules/CaptivePortalLogin",
Baligh Uddinfcbda3a2020-12-24 06:12:25 +0000317 "//packages/modules/Wifi/framework/tests:__subpackages__",
Junyu Laib24df142022-01-10 10:31:11 +0000318 "//packages/apps/Settings",
Chalard Jean7592a342021-04-19 18:04:34 +0900319 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900320 lint: {
321 strict_updatability_linting: true,
322 error_checks: ["NewApi"],
323 },
Paul Hu8d47d842023-03-31 14:59:49 +0800324 errorprone: {
325 enabled: true,
326 // Error-prone checking only warns of problems when building. To make the build fail with
327 // these errors, list the specific error-prone problems below.
328 javacflags: [
329 "-Xep:NullablePrimitive:ERROR",
330 ],
331 },
Spandan Das2b83e772023-12-21 20:46:31 +0000332 apex_available: [
333 "//apex_available:platform",
334 "com.android.tethering",
335 ],
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800336}
Anton Hansson0ceeb7c2022-05-30 12:01:49 +0000337
338java_library {
339 name: "net-utils-services-common",
David Su2dbab642020-10-26 14:51:01 -0700340 srcs: [
341 "device/android/net/NetworkFactory.java",
Chalard Jean7592a342021-04-19 18:04:34 +0900342 "device/android/net/NetworkFactoryImpl.java",
343 "device/android/net/NetworkFactoryLegacyImpl.java",
344 "device/android/net/NetworkFactoryShim.java",
David Su2dbab642020-10-26 14:51:01 -0700345 ],
Chalard Jeand5802422021-10-27 19:02:14 +0900346 sdk_version: "module_current",
David Sudc0a5682021-01-29 04:42:27 +0000347 min_sdk_version: "30",
Chalard Jeand5802422021-10-27 19:02:14 +0900348 libs: [
349 "framework-annotations-lib",
350 "framework-connectivity",
William Escande51c0be52024-07-10 14:26:50 -0700351 "modules-utils-build_system",
Chalard Jeand5802422021-10-27 19:02:14 +0900352 ],
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 Huangd851a042024-07-16 18:48:43 +0900446 "framework/com/android/net/module/util/DnsUtils.java",
Yuyang Huange4eb87a2023-05-02 18:44:51 +0900447 "framework/com/android/net/module/util/HexDump.java",
Yuyang Huangf67388b2023-03-29 16:51:09 +0900448 "framework/com/android/net/module/util/LinkPropertiesUtils.java",
449 ],
450 libs: [
451 "framework-annotations-lib",
452 "android_system_stubs_current",
453 "androidx.annotation_annotation",
454 ],
455 visibility: ["//packages/modules/Connectivity/service-t"],
456}
457
Handa Wang9b0df362024-07-02 13:17:43 +0000458java_library {
459 name: "net-utils-framework-connectivity",
460 srcs: [
461 ":net-utils-framework-connectivity-srcs",
462 ],
463 sdk_version: "module_current",
464 min_sdk_version: "30",
465 apex_available: [
466 "com.android.tethering",
467 "//apex_available:platform",
468 ],
469 visibility: [
470 "//packages/modules/Connectivity:__subpackages__",
471 "//packages/modules/NetworkStack:__subpackages__",
472 ],
473 libs: [
474 "androidx.annotation_annotation",
475 "framework-annotations-lib",
476 "framework-configinfrastructure",
477 "framework-connectivity.stubs.module_lib",
478 ],
479 lint: {
480 strict_updatability_linting: true,
481 error_checks: ["NewApi"],
482 },
483}
484
485java_defaults {
486 name: "net-utils-non-bootclasspath-defaults",
487 sdk_version: "module_current",
488 min_sdk_version: "30",
489 jarjar_rules: "jarjar-rules-shared.txt",
490 libs: [
491 "androidx.annotation_annotation",
492 "framework-annotations-lib",
493 "framework-configinfrastructure",
494 "framework-connectivity",
495 "framework-connectivity.stubs.module_lib",
496 "framework-connectivity-t.stubs.module_lib",
497 "framework-location.stubs.module_lib",
498 "framework-tethering",
499 "unsupportedappusage",
500 ],
501 static_libs: [
502 "modules-utils-build_system",
503 "modules-utils-statemachine",
504 "net-utils-non-bootclasspath-aidl-java",
505 "netd-client",
506 ],
507 apex_available: [
508 "com.android.tethering",
509 "//apex_available:platform",
510 ],
511 visibility: [
512 "//packages/modules/Connectivity:__subpackages__",
513 ],
514 defaults_visibility: [
515 "//visibility:private",
516 ],
517 lint: {
518 strict_updatability_linting: true,
519 error_checks: ["NewApi"],
520 },
521}
522
523java_library {
524 name: "net-utils-service-connectivity",
525 srcs: [
526 ":net-utils-all-srcs",
527 ],
528 exclude_srcs: [
529 ":net-utils-framework-connectivity-srcs",
530 ],
531 libs: [
532 "net-utils-framework-connectivity",
533 ],
534 defaults: ["net-utils-non-bootclasspath-defaults"],
535}
536
537java_library {
538 name: "net-utils-tethering",
539 srcs: [
540 ":net-utils-all-srcs",
541 ":framework-connectivity-shared-srcs",
542 ],
543 defaults: ["net-utils-non-bootclasspath-defaults"],
544}
545
546aidl_interface {
547 name: "net-utils-non-bootclasspath-aidl",
548 srcs: [
549 ":net-utils-aidl-srcs",
550 ],
551 unstable: true,
552 backend: {
553 java: {
554 enabled: true,
555 min_sdk_version: "30",
556 apex_available: [
557 "com.android.tethering",
558 ],
559 },
560 cpp: {
561 enabled: false,
562 },
563 ndk: {
564 enabled: false,
565 },
566 rust: {
567 enabled: false,
568 },
569 },
570 include_dirs: [
571 "packages/modules/Connectivity/framework/aidl-export",
572 ],
573 visibility: [
574 "//system/tools/aidl/build",
575 ],
576}
577
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900578// Use a filegroup and not a library for telephony sources, as framework-annotations cannot be
579// included either (some annotations would be duplicated on the bootclasspath).
580filegroup {
581 name: "net-utils-telephony-common-srcs",
582 srcs: [
583 // Any class here *must* have a corresponding jarjar rule in the telephony build rules.
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900584 "device/android/net/NetworkFactory.java",
Chalard Jean7592a342021-04-19 18:04:34 +0900585 "device/android/net/NetworkFactoryImpl.java",
586 "device/android/net/NetworkFactoryLegacyImpl.java",
587 "device/android/net/NetworkFactoryShim.java",
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900588 ],
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900589 path: "device",
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900590 visibility: [
591 "//frameworks/opt/telephony",
592 ],
593}
Roshan Pius864bdec2020-01-16 09:19:11 -0800594
595// Use a filegroup and not a library for wifi sources, as this needs corresponding jar-jar
596// rules on the wifi side.
597// Any class here *must* have a corresponding jarjar rule in the wifi build rules.
598filegroup {
599 name: "net-utils-framework-wifi-common-srcs",
600 srcs: [
Chalard Jeanb61091b2021-10-07 15:29:13 +0900601 "framework/com/android/net/module/util/DnsSdTxtRecord.java",
602 "framework/com/android/net/module/util/Inet4AddressUtils.java",
603 "framework/com/android/net/module/util/InetAddressUtils.java",
604 "framework/com/android/net/module/util/MacAddressUtils.java",
605 "framework/com/android/net/module/util/NetUtils.java",
Roshan Pius864bdec2020-01-16 09:19:11 -0800606 ],
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900607 path: "framework",
Roshan Pius864bdec2020-01-16 09:19:11 -0800608 visibility: [
609 "//frameworks/base",
610 ],
611}
612
613// Use a filegroup and not a library for wifi sources, as this needs corresponding jar-jar
614// rules on the wifi side.
615// Any class here *must* have a corresponding jarjar rule in the wifi build rules.
616filegroup {
617 name: "net-utils-wifi-service-common-srcs",
618 srcs: [
Aditya Choudhary01b5ede2024-01-31 11:08:57 +0000619 "device/android/net/NetworkFactory.java",
620 "device/android/net/NetworkFactoryImpl.java",
621 "device/android/net/NetworkFactoryLegacyImpl.java",
622 "device/android/net/NetworkFactoryShim.java",
Roshan Pius864bdec2020-01-16 09:19:11 -0800623 ],
624 visibility: [
625 "//frameworks/opt/net/wifi/service",
Baligh Uddinfcbda3a2020-12-24 06:12:25 +0000626 "//packages/modules/Wifi/service",
Roshan Pius864bdec2020-01-16 09:19:11 -0800627 ],
628}
Handa Wang9b0df362024-07-02 13:17:43 +0000629
630// Use a file group containing classes necessary for framework-connectivity. The file group should
631// be as small as possible because because the classes end up in the bootclasspath and R8 is not
632// used to remove unused classes.
633filegroup {
634 name: "net-utils-framework-connectivity-srcs",
635 srcs: [
636 "device/com/android/net/module/util/BpfBitmap.java",
637 "device/com/android/net/module/util/BpfDump.java",
638 "device/com/android/net/module/util/BpfMap.java",
639 "device/com/android/net/module/util/BpfUtils.java",
640 "device/com/android/net/module/util/IBpfMap.java",
641 "device/com/android/net/module/util/JniUtil.java",
642 "device/com/android/net/module/util/SingleWriterBpfMap.java",
643 "device/com/android/net/module/util/Struct.java",
644 "device/com/android/net/module/util/TcUtils.java",
645 "framework/com/android/net/module/util/HexDump.java",
646 ],
647 visibility: ["//visibility:private"],
648}
649
650filegroup {
651 name: "net-utils-all-srcs",
652 srcs: [
653 "device/**/*.java",
654 ":net-utils-framework-common-srcs",
655 ],
656 visibility: ["//visibility:private"],
657}
658
659filegroup {
660 name: "net-utils-aidl-srcs",
661 srcs: [
662 "device/**/*.aidl",
663 ],
664 path: "device",
665 visibility: ["//visibility:private"],
666}