blob: abfc4473d48d7fdc478ceeac97b7ef89bf698c10 [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
Paul Hu8c8d2b12024-10-15 15:59:31 +000035// This library shouldn't be used anymore (no class should be added), and per-user libraries like
36// net-utils-service-connectivity or net-utils-framework-wifi should be used instead.
Chalard Jean48c6c7d2020-06-25 23:39:15 +090037java_library {
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000038 name: "net-utils-device-common",
39 srcs: [
40 "device/com/android/net/module/util/arp/ArpPacket.java",
41 "device/com/android/net/module/util/DeviceConfigUtils.java",
42 "device/com/android/net/module/util/DomainUtils.java",
43 "device/com/android/net/module/util/FdEventsReader.java",
Patrick Rohraa06b2b2024-06-17 14:18:36 -070044 "device/com/android/net/module/util/FeatureVersions.java",
45 "device/com/android/net/module/util/HandlerUtils.java",
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000046 "device/com/android/net/module/util/NetworkMonitorUtils.java",
47 "device/com/android/net/module/util/PacketReader.java",
48 "device/com/android/net/module/util/SharedLog.java",
49 "device/com/android/net/module/util/SocketUtils.java",
Patrick Rohraa06b2b2024-06-17 14:18:36 -070050 "device/com/android/net/module/util/SyncStateMachine.java",
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000051 // This library is used by system modules, for which the system health impact of Kotlin
52 // has not yet been evaluated. Annotations may need jarjar'ing.
53 // "src_devicecommon/**/*.kt",
54 ],
55 sdk_version: "module_current",
56 min_sdk_version: "30",
57 target_sdk_version: "30",
58 apex_available: [
59 "//apex_available:anyapex",
60 "//apex_available:platform",
61 ],
62 visibility: [
Baligh Uddinf8c12822021-05-21 04:26:52 +000063 "//packages/modules/Connectivity:__subpackages__",
64 "//packages/modules/Connectivity/framework:__subpackages__",
Xiao Ma6f95cef2020-09-08 19:16:15 +090065 "//packages/modules/NetworkStack:__subpackages__",
Chalard Jean48c6c7d2020-06-25 23:39:15 +090066 "//packages/modules/CaptivePortalLogin",
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000067 ],
68 static_libs: [
Patrick Rohraa06b2b2024-06-17 14:18:36 -070069 "modules-utils-statemachine",
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000070 "net-utils-framework-common",
71 ],
72 libs: [
73 "androidx.annotation_annotation",
74 "framework-annotations-lib",
Jihoon Kang8401b6a2024-08-30 00:29:58 +000075 "framework-configinfrastructure.stubs.module_lib",
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000076 "framework-connectivity.stubs.module_lib",
77 ],
78 lint: {
79 strict_updatability_linting: true,
80 error_checks: ["NewApi"],
81 },
Chalard Jean48c6c7d2020-06-25 23:39:15 +090082}
83
Aswin Sankar601d6f92021-10-11 13:12:16 -070084java_library {
85 name: "net-utils-dnspacket-common",
86 srcs: [
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000087 "framework/**/DnsPacket.java",
88 "framework/**/DnsPacketUtils.java",
89 "framework/**/DnsSvcbPacket.java",
90 "framework/**/DnsSvcbRecord.java",
91 "framework/**/HexDump.java",
92 "framework/**/NetworkStackConstants.java",
Aswin Sankar601d6f92021-10-11 13:12:16 -070093 ],
94 sdk_version: "module_current",
95 visibility: [
96 "//packages/services/Iwlan:__subpackages__",
97 ],
Junyu Lai85e24e82022-09-15 07:34:51 +000098 libs: [
Mike Yu9b96c832023-09-18 08:26:08 +000099 "androidx.annotation_annotation",
Junyu Lai85e24e82022-09-15 07:34:51 +0000100 "framework-annotations-lib",
101 "framework-connectivity.stubs.module_lib",
102 ],
Aswin Sankar601d6f92021-10-11 13:12:16 -0700103}
104
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800105filegroup {
106 name: "net-utils-framework-common-srcs",
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900107 srcs: ["framework/**/*.java"],
108 path: "framework",
Remi NGUYEN VAN651faf72021-03-24 22:40:37 +0900109 visibility: [
110 "//frameworks/base",
Baligh Uddin27e5fcd2021-05-22 13:16:30 +0000111 "//packages/modules/Connectivity:__subpackages__",
Remi NGUYEN VAN651faf72021-03-24 22:40:37 +0900112 ],
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800113}
114
Yang Sun3aa62e62024-03-12 21:23:19 +0800115// The net-utils-device-common-bpf library requires the callers to contain
116// net-utils-device-common-struct-base.
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800117java_library {
markchienf3448f92021-11-10 01:06:51 +0800118 name: "net-utils-device-common-bpf",
Xiao Ma57b34422021-07-01 13:57:02 +0000119 srcs: [
Tyler Wear92f3c242022-02-15 15:21:43 -0800120 "device/com/android/net/module/util/BpfBitmap.java",
Hungming Chenb3e71a22022-06-23 21:34:54 +0800121 "device/com/android/net/module/util/BpfDump.java",
Tyler Wearaafd9c12021-10-19 11:01:46 -0700122 "device/com/android/net/module/util/BpfMap.java",
Tyler Weare48ee4a2022-02-15 15:30:50 -0800123 "device/com/android/net/module/util/BpfUtils.java",
markchien2e5fece2022-01-21 10:16:54 +0800124 "device/com/android/net/module/util/IBpfMap.java",
markchienf3448f92021-11-10 01:06:51 +0800125 "device/com/android/net/module/util/JniUtil.java",
Lorenzo Colitti05be2f52024-06-02 13:24:21 +0900126 "device/com/android/net/module/util/SingleWriterBpfMap.java",
Patrick Rohr29b0d952022-01-12 21:42:24 +0100127 "device/com/android/net/module/util/TcUtils.java",
markchienf3448f92021-11-10 01:06:51 +0800128 ],
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900129 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000130 min_sdk_version: "30",
markchienf3448f92021-11-10 01:06:51 +0800131 visibility: [
markchienf3448f92021-11-10 01:06:51 +0800132 "//packages/modules/Connectivity:__subpackages__",
133 "//packages/modules/NetworkStack:__subpackages__",
134 ],
markchienf3448f92021-11-10 01:06:51 +0800135 libs: [
136 "androidx.annotation_annotation",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900137 "framework-connectivity.stubs.module_lib",
Yang Sun3aa62e62024-03-12 21:23:19 +0800138 "net-utils-device-common-struct-base",
markchienf3448f92021-11-10 01:06:51 +0800139 ],
140 apex_available: [
141 "com.android.tethering",
142 "//apex_available:platform",
143 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900144 lint: {
145 strict_updatability_linting: true,
146 error_checks: ["NewApi"],
147 },
markchienf3448f92021-11-10 01:06:51 +0800148}
149
150java_library {
Yang Sun3aa62e62024-03-12 21:23:19 +0800151 name: "net-utils-device-common-struct-base",
markchienf3448f92021-11-10 01:06:51 +0800152 srcs: [
Xiao Ma57b34422021-07-01 13:57:02 +0000153 "device/com/android/net/module/util/Struct.java",
Xiao Ma57b34422021-07-01 13:57:02 +0000154 ],
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900155 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000156 min_sdk_version: "30",
Xiao Ma57b34422021-07-01 13:57:02 +0000157 visibility: [
Xiao Ma57b34422021-07-01 13:57:02 +0000158 "//packages/modules/Connectivity:__subpackages__",
159 "//packages/modules/NetworkStack:__subpackages__",
160 ],
161 static_libs: [
162 "net-utils-framework-common",
163 ],
164 libs: [
165 "androidx.annotation_annotation",
Yang Sun3aa62e62024-03-12 21:23:19 +0800166 "framework-annotations-lib", // Required by InetAddressUtils.java
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900167 "framework-connectivity.stubs.module_lib",
Xiao Ma57b34422021-07-01 13:57:02 +0000168 ],
169 apex_available: [
170 "com.android.tethering",
171 "//apex_available:platform",
172 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900173 lint: {
174 strict_updatability_linting: true,
175 error_checks: ["NewApi"],
176 },
Xiao Ma57b34422021-07-01 13:57:02 +0000177}
178
Yang Sun3aa62e62024-03-12 21:23:19 +0800179// The net-utils-device-common-struct library requires the callers to contain
180// net-utils-device-common-struct-base.
Yang Sun1c9fb592024-02-19 10:37:26 +0800181java_library {
Yang Sun3aa62e62024-03-12 21:23:19 +0800182 name: "net-utils-device-common-struct",
Yang Sun1c9fb592024-02-19 10:37:26 +0800183 srcs: [
Yang Sun3aa62e62024-03-12 21:23:19 +0800184 "device/com/android/net/module/util/Ipv6Utils.java",
185 "device/com/android/net/module/util/PacketBuilder.java",
186 "device/com/android/net/module/util/structs/*.java",
Yang Sun1c9fb592024-02-19 10:37:26 +0800187 ],
188 sdk_version: "module_current",
189 min_sdk_version: "30",
190 visibility: [
191 "//packages/modules/Connectivity:__subpackages__",
Yang Sun3aa62e62024-03-12 21:23:19 +0800192 "//packages/modules/NetworkStack:__subpackages__",
Yang Sun1c9fb592024-02-19 10:37:26 +0800193 ],
194 libs: [
Yang Sun3aa62e62024-03-12 21:23:19 +0800195 "androidx.annotation_annotation",
196 "framework-annotations-lib", // Required by IpUtils.java
197 "framework-connectivity.stubs.module_lib",
198 "net-utils-device-common-struct-base",
Yang Sun1c9fb592024-02-19 10:37:26 +0800199 ],
200 apex_available: [
201 "com.android.tethering",
Yang Sun3aa62e62024-03-12 21:23:19 +0800202 "//apex_available:platform",
Yang Sun1c9fb592024-02-19 10:37:26 +0800203 ],
204 lint: {
205 strict_updatability_linting: true,
206 error_checks: ["NewApi"],
207 },
208}
209
Junyu Lai626045a2023-08-28 18:49:44 +0800210// The net-utils-device-common-netlink library requires the callers to contain
Yang Sun3aa62e62024-03-12 21:23:19 +0800211// net-utils-device-common-struct and net-utils-device-common-struct-base.
Xiao Ma57b34422021-07-01 13:57:02 +0000212java_library {
markchienf3448f92021-11-10 01:06:51 +0800213 name: "net-utils-device-common-netlink",
214 srcs: [
Yan Yanf085fad2023-11-20 18:51:30 +0000215 "device/com/android/net/module/util/netlink/**/*.java",
markchienf3448f92021-11-10 01:06:51 +0800216 ],
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900217 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000218 min_sdk_version: "30",
markchienf3448f92021-11-10 01:06:51 +0800219 visibility: [
markchienf3448f92021-11-10 01:06:51 +0800220 "//packages/modules/Connectivity:__subpackages__",
221 "//packages/modules/NetworkStack:__subpackages__",
222 ],
markchienf3448f92021-11-10 01:06:51 +0800223 libs: [
224 "androidx.annotation_annotation",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900225 "framework-connectivity.stubs.module_lib",
Junyu Lai626045a2023-08-28 18:49:44 +0800226 // For libraries which are statically linked in framework-connectivity, do not
227 // statically link here because callers of this library might already have a static
228 // version linked.
229 "net-utils-device-common-struct",
Yang Sun3aa62e62024-03-12 21:23:19 +0800230 "net-utils-device-common-struct-base",
markchienf3448f92021-11-10 01:06:51 +0800231 ],
232 apex_available: [
233 "com.android.tethering",
234 "//apex_available:platform",
235 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900236 lint: {
237 strict_updatability_linting: true,
238 error_checks: ["NewApi"],
239 },
markchienf3448f92021-11-10 01:06:51 +0800240}
241
Junyu Lai626045a2023-08-28 18:49:44 +0800242// The net-utils-device-common-ip library requires the callers to contain
Yang Sun3aa62e62024-03-12 21:23:19 +0800243// net-utils-device-common-struct and net-utils-device-common-struct-base.
markchienf3448f92021-11-10 01:06:51 +0800244java_library {
Chalard Jeanb61091b2021-10-07 15:29:13 +0900245 // TODO : this target should probably be folded into net-utils-device-common
246 name: "net-utils-device-common-ip",
247 srcs: [
248 "device/com/android/net/module/util/ip/*.java",
249 ],
250 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000251 min_sdk_version: "30",
Chalard Jeanb61091b2021-10-07 15:29:13 +0900252 visibility: [
Chalard Jeanb61091b2021-10-07 15:29:13 +0900253 "//packages/modules/Connectivity:__subpackages__",
254 "//packages/modules/NetworkStack:__subpackages__",
255 ],
256 libs: [
257 "framework-annotations-lib",
Jihoon Kang8401b6a2024-08-30 00:29:58 +0000258 "framework-connectivity.stubs.module_lib",
Chalard Jeanb61091b2021-10-07 15:29:13 +0900259 ],
260 static_libs: [
261 "net-utils-device-common",
262 "net-utils-device-common-netlink",
263 "net-utils-framework-common",
264 "netd-client",
265 ],
266 apex_available: [
267 "com.android.tethering",
268 "//apex_available:platform",
269 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900270 lint: {
Motomu Utsumia1a00342024-06-13 09:29:47 +0000271 strict_updatability_linting: true,
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900272 error_checks: ["NewApi"],
273 },
Chalard Jeanb61091b2021-10-07 15:29:13 +0900274}
275
276java_library {
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800277 name: "net-utils-framework-common",
Remi NGUYEN VANce241a32020-01-14 21:42:09 +0900278 srcs: [
279 ":net-utils-framework-common-srcs",
Remi NGUYEN VANce241a32020-01-14 21:42:09 +0900280 ],
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900281 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000282 min_sdk_version: "30",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900283 libs: [
Jooyung Hanb3b67982022-06-24 14:56:24 +0900284 "androidx.annotation_annotation",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900285 "framework-annotations-lib",
286 "framework-connectivity.stubs.module_lib",
paulhucdb069e2022-02-14 15:28:50 +0800287 "framework-connectivity-t.stubs.module_lib",
Mark White66d39cd2023-08-07 15:20:07 +0000288 "framework-location.stubs.module_lib",
Remi NGUYEN VAN7f0d0e32022-01-25 19:08:12 +0900289 ],
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800290 jarjar_rules: "jarjar-rules-shared.txt",
291 visibility: [
Luke Huangfd5479e2020-06-20 11:38:17 +0800292 "//cts/tests/tests/net",
Chalard Jeanceaf7d02020-06-26 18:34:52 +0900293 "//cts/tests/tests/wifi",
Baligh Uddine685c812020-10-31 04:28:58 +0000294 "//packages/modules/Connectivity/tests/cts/net",
Baligh Uddinae4770d2020-10-29 02:12:06 +0000295 "//packages/modules/Connectivity/Tethering",
Chalard Jeana9f49912020-10-15 18:06:30 +0900296 "//frameworks/base/tests:__subpackages__",
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800297 "//frameworks/opt/net/ike",
298 "//frameworks/opt/telephony",
Chalard Jean19789192020-10-01 12:45:31 +0900299 "//frameworks/base/wifi:__subpackages__",
Remi NGUYEN VAN38afb0c2020-11-10 18:04:27 +0900300 "//packages/modules/Connectivity:__subpackages__",
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900301 "//packages/modules/NetworkStack:__subpackages__",
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800302 "//packages/modules/CaptivePortalLogin",
Baligh Uddinfcbda3a2020-12-24 06:12:25 +0000303 "//packages/modules/Wifi/framework/tests:__subpackages__",
Junyu Laib24df142022-01-10 10:31:11 +0000304 "//packages/apps/Settings",
Chalard Jean7592a342021-04-19 18:04:34 +0900305 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900306 lint: {
307 strict_updatability_linting: true,
308 error_checks: ["NewApi"],
309 },
Paul Hu8d47d842023-03-31 14:59:49 +0800310 errorprone: {
311 enabled: true,
312 // Error-prone checking only warns of problems when building. To make the build fail with
313 // these errors, list the specific error-prone problems below.
314 javacflags: [
315 "-Xep:NullablePrimitive:ERROR",
316 ],
317 },
Spandan Das2b83e772023-12-21 20:46:31 +0000318 apex_available: [
319 "//apex_available:platform",
320 "com.android.tethering",
321 ],
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800322}
Anton Hansson0ceeb7c2022-05-30 12:01:49 +0000323
324java_library {
325 name: "net-utils-services-common",
David Su2dbab642020-10-26 14:51:01 -0700326 srcs: [
327 "device/android/net/NetworkFactory.java",
Chalard Jean7592a342021-04-19 18:04:34 +0900328 "device/android/net/NetworkFactoryImpl.java",
329 "device/android/net/NetworkFactoryLegacyImpl.java",
330 "device/android/net/NetworkFactoryShim.java",
David Su2dbab642020-10-26 14:51:01 -0700331 ],
Chalard Jeand5802422021-10-27 19:02:14 +0900332 sdk_version: "module_current",
David Sudc0a5682021-01-29 04:42:27 +0000333 min_sdk_version: "30",
Chalard Jeand5802422021-10-27 19:02:14 +0900334 libs: [
335 "framework-annotations-lib",
Jihoon Kang8401b6a2024-08-30 00:29:58 +0000336 "framework-connectivity.stubs.module_lib",
William Escande51c0be52024-07-10 14:26:50 -0700337 "modules-utils-build_system",
Chalard Jeand5802422021-10-27 19:02:14 +0900338 ],
Xiao Ma2bbc2f72022-01-24 07:58:12 +0000339 // TODO: remove "apex_available:platform".
340 apex_available: [
341 "//apex_available:platform",
William Escandeb82afa32025-01-09 12:25:16 -0800342 "com.android.bt",
Xiao Ma2bbc2f72022-01-24 07:58:12 +0000343 "com.android.tethering",
Anton Hansson0ceeb7c2022-05-30 12:01:49 +0000344 "com.android.wifi",
Xiao Ma2bbc2f72022-01-24 07:58:12 +0000345 ],
Aaron Huang57a94962020-01-03 20:35:55 +0800346 visibility: [
markchien32a6e9c2022-01-20 14:34:15 +0800347 // TODO: remove after NetworkStatsService moves to the module.
Remi NGUYEN VAN376f8d42020-01-15 18:26:29 +0900348 "//frameworks/base/services/net",
Xiao Ma2bbc2f72022-01-24 07:58:12 +0000349 "//packages/modules/Connectivity/service",
Remi NGUYEN VAN0cf724a2021-11-19 18:33:12 +0900350 "//packages/modules/Connectivity/tests:__subpackages__",
Roopa Sattiraju98fa3bf2022-02-03 18:53:23 -0800351 "//packages/modules/Bluetooth/android/app",
Nate(Qiang) Jiangce723aa2022-06-01 21:28:32 +0000352 "//packages/modules/Wifi/service:__subpackages__",
Aaron Huang57a94962020-01-03 20:35:55 +0800353 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900354 lint: {
355 strict_updatability_linting: true,
356 error_checks: ["NewApi"],
357 },
Aaron Huang57a94962020-01-03 20:35:55 +0800358}
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900359
Igor Chernysheva25f1092022-12-20 00:07:38 -0800360java_library {
361 name: "net-utils-device-common-async",
362 srcs: [
363 "device/com/android/net/module/util/async/*.java",
364 ],
365 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000366 min_sdk_version: "30",
Igor Chernysheva25f1092022-12-20 00:07:38 -0800367 visibility: [
Igor Chernysheva25f1092022-12-20 00:07:38 -0800368 "//packages/modules/Connectivity:__subpackages__",
369 ],
370 libs: [
371 "framework-annotations-lib",
372 ],
373 static_libs: [
374 ],
375 apex_available: [
376 "com.android.tethering",
377 "//apex_available:platform",
378 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900379 lint: {
380 strict_updatability_linting: true,
381 error_checks: ["NewApi"],
382 },
Igor Chernysheva25f1092022-12-20 00:07:38 -0800383}
384
Igor Chernyshev810be2b2023-04-06 15:52:26 -0700385java_library {
386 name: "net-utils-device-common-wear",
387 srcs: [
388 "device/com/android/net/module/util/wear/*.java",
389 ],
390 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000391 min_sdk_version: "30",
Igor Chernyshev810be2b2023-04-06 15:52:26 -0700392 visibility: [
Igor Chernyshev810be2b2023-04-06 15:52:26 -0700393 "//packages/modules/Connectivity:__subpackages__",
394 ],
395 libs: [
396 "framework-annotations-lib",
397 ],
398 static_libs: [
399 "net-utils-device-common-async",
400 ],
401 apex_available: [
402 "com.android.tethering",
403 "//apex_available:platform",
404 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900405 lint: {
406 strict_updatability_linting: true,
407 error_checks: ["NewApi"],
408 },
Igor Chernyshev810be2b2023-04-06 15:52:26 -0700409}
410
Yuyang Huangf67388b2023-03-29 16:51:09 +0900411// Limited set of utilities for use by service-connectivity-mdns-standalone-build-test, to make sure
412// the mDNS code can build with only system APIs.
413// The mDNS code is platform code so it should use framework-annotations-lib, contrary to apps that
414// should use sdk_version: "system_current" and only androidx.annotation_annotation. But this build
415// rule verifies that the mDNS code can be built into apps, if code transformations are applied to
416// the annotations.
417// When using "system_current", framework annotations are not available; they would appear as
418// package-private as they are marked as such in the system_current stubs. So build against
419// core_platform and add the stubs manually in "libs". See http://b/147773144#comment7.
420java_library {
421 name: "net-utils-device-common-mdns-standalone-build-test",
422 // Build against core_platform and add the stub libraries manually in "libs", as annotations
423 // are already included in android_system_stubs_current but package-private, so
424 // "framework-annotations-lib" needs to be manually included before
425 // "android_system_stubs_current" (b/272392042)
426 sdk_version: "core_platform",
427 srcs: [
428 "device/com/android/net/module/util/FdEventsReader.java",
Paul Hu78713202024-08-01 15:12:10 +0000429 "device/com/android/net/module/util/HandlerUtils.java",
Yuyang Huangf67388b2023-03-29 16:51:09 +0900430 "device/com/android/net/module/util/SharedLog.java",
431 "framework/com/android/net/module/util/ByteUtils.java",
432 "framework/com/android/net/module/util/CollectionUtils.java",
Yuyang Huangd851a042024-07-16 18:48:43 +0900433 "framework/com/android/net/module/util/DnsUtils.java",
Yuyang Huange4eb87a2023-05-02 18:44:51 +0900434 "framework/com/android/net/module/util/HexDump.java",
Yuyang Huangf67388b2023-03-29 16:51:09 +0900435 "framework/com/android/net/module/util/LinkPropertiesUtils.java",
436 ],
437 libs: [
438 "framework-annotations-lib",
439 "android_system_stubs_current",
440 "androidx.annotation_annotation",
441 ],
442 visibility: ["//packages/modules/Connectivity/service-t"],
443}
444
Handa Wang8be10bf2024-08-08 15:36:48 +0000445// net-utils-framework-connectivity is only for framework-connectivity.
Handa Wang9b0df362024-07-02 13:17:43 +0000446java_library {
447 name: "net-utils-framework-connectivity",
448 srcs: [
449 ":net-utils-framework-connectivity-srcs",
450 ],
451 sdk_version: "module_current",
452 min_sdk_version: "30",
453 apex_available: [
454 "com.android.tethering",
455 "//apex_available:platform",
456 ],
457 visibility: [
Handa Wang8be10bf2024-08-08 15:36:48 +0000458 "//packages/modules/Connectivity/framework",
Handa Wang9b0df362024-07-02 13:17:43 +0000459 ],
460 libs: [
461 "androidx.annotation_annotation",
462 "framework-annotations-lib",
Jihoon Kang8401b6a2024-08-30 00:29:58 +0000463 "framework-configinfrastructure.stubs.module_lib",
Handa Wang9b0df362024-07-02 13:17:43 +0000464 "framework-connectivity.stubs.module_lib",
465 ],
466 lint: {
467 strict_updatability_linting: true,
468 error_checks: ["NewApi"],
469 },
470}
471
472java_defaults {
473 name: "net-utils-non-bootclasspath-defaults",
474 sdk_version: "module_current",
475 min_sdk_version: "30",
Handa Wang9b0df362024-07-02 13:17:43 +0000476 libs: [
477 "androidx.annotation_annotation",
478 "framework-annotations-lib",
Jihoon Kang8401b6a2024-08-30 00:29:58 +0000479 "framework-configinfrastructure.stubs.module_lib",
Handa Wang9b0df362024-07-02 13:17:43 +0000480 "framework-connectivity.stubs.module_lib",
481 "framework-connectivity-t.stubs.module_lib",
482 "framework-location.stubs.module_lib",
Jihoon Kang8401b6a2024-08-30 00:29:58 +0000483 "framework-tethering.stubs.module_lib",
Handa Wang9b0df362024-07-02 13:17:43 +0000484 "unsupportedappusage",
485 ],
486 static_libs: [
487 "modules-utils-build_system",
488 "modules-utils-statemachine",
489 "net-utils-non-bootclasspath-aidl-java",
490 "netd-client",
491 ],
492 apex_available: [
493 "com.android.tethering",
494 "//apex_available:platform",
495 ],
Handa Wang9b0df362024-07-02 13:17:43 +0000496 defaults_visibility: [
497 "//visibility:private",
498 ],
499 lint: {
500 strict_updatability_linting: true,
501 error_checks: ["NewApi"],
502 },
503}
504
Handa Wang8be10bf2024-08-08 15:36:48 +0000505// net-utils-service-connectivity is only for service-connectivity.
Handa Wang9b0df362024-07-02 13:17:43 +0000506java_library {
507 name: "net-utils-service-connectivity",
508 srcs: [
509 ":net-utils-all-srcs",
510 ],
511 exclude_srcs: [
512 ":net-utils-framework-connectivity-srcs",
513 ],
514 libs: [
515 "net-utils-framework-connectivity",
Jihoon Kang8401b6a2024-08-30 00:29:58 +0000516 "framework-connectivity.impl",
517 "framework-tethering.impl",
Handa Wang9b0df362024-07-02 13:17:43 +0000518 ],
519 defaults: ["net-utils-non-bootclasspath-defaults"],
Nate Jiang5f0471c2024-07-12 16:49:52 +0000520 jarjar_rules: "jarjar-rules-shared.txt",
Handa Wang8be10bf2024-08-08 15:36:48 +0000521 visibility: [
522 "//packages/modules/Connectivity/service",
523 "//packages/modules/Connectivity/staticlibs/tests/unit",
524 ],
Handa Wang9b0df362024-07-02 13:17:43 +0000525}
526
Remi NGUYEN VAN514f40b2024-08-15 08:07:02 +0000527// net-utils-connectivity-apks is only for NetworkStack, CaptivePortalLogin and
528// Tethering.apk
529// It includes all the static libraries in this directory, which is safe because
530// these APKs use R8 to strip out unused code, and they do not depend on
531// bootclasspath jars that may have duplicate copies of the included classes
532// with the same jarjaring.
533// Tethering.apk does depend on a bootclasspath jar (framework-tethering.jar),
534// however it does not use any of the static libraries. If it did, Tethering.apk
535// would need to use another variant that excludes classes that are already
536// included in framework-tethering.jar (similarly to how framework-connectivity
537// and service-connectivity do it). Otherwise, static libs included in
538// framework-tethering and Tethering.apk and jarjared the same way would
539// conflict.
Handa Wang9b0df362024-07-02 13:17:43 +0000540java_library {
Xiao Ma6793fd02024-07-26 13:07:50 +0900541 name: "net-utils-connectivity-apks",
Handa Wang9b0df362024-07-02 13:17:43 +0000542 srcs: [
543 ":net-utils-all-srcs",
544 ":framework-connectivity-shared-srcs",
545 ],
546 defaults: ["net-utils-non-bootclasspath-defaults"],
Nate Jiang5f0471c2024-07-12 16:49:52 +0000547 jarjar_rules: "jarjar-rules-shared.txt",
Handa Wang8be10bf2024-08-08 15:36:48 +0000548 visibility: [
549 "//packages/modules/CaptivePortalLogin:__subpackages__",
550 "//packages/modules/Connectivity/Tethering",
551 ],
Handa Wang9b0df362024-07-02 13:17:43 +0000552}
553
554aidl_interface {
555 name: "net-utils-non-bootclasspath-aidl",
556 srcs: [
557 ":net-utils-aidl-srcs",
558 ],
559 unstable: true,
560 backend: {
561 java: {
562 enabled: true,
563 min_sdk_version: "30",
564 apex_available: [
565 "com.android.tethering",
Nate Jiang5f0471c2024-07-12 16:49:52 +0000566 "com.android.wifi",
Xiao Mab28199a2024-08-05 14:24:26 +0900567 "//apex_available:platform",
Handa Wang9b0df362024-07-02 13:17:43 +0000568 ],
569 },
570 cpp: {
571 enabled: false,
572 },
573 ndk: {
574 enabled: false,
575 },
576 rust: {
577 enabled: false,
578 },
579 },
580 include_dirs: [
581 "packages/modules/Connectivity/framework/aidl-export",
582 ],
583 visibility: [
584 "//system/tools/aidl/build",
585 ],
586}
587
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900588// Use a filegroup and not a library for telephony sources, as framework-annotations cannot be
589// included either (some annotations would be duplicated on the bootclasspath).
590filegroup {
591 name: "net-utils-telephony-common-srcs",
592 srcs: [
593 // Any class here *must* have a corresponding jarjar rule in the telephony build rules.
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900594 "device/android/net/NetworkFactory.java",
Chalard Jean7592a342021-04-19 18:04:34 +0900595 "device/android/net/NetworkFactoryImpl.java",
596 "device/android/net/NetworkFactoryLegacyImpl.java",
597 "device/android/net/NetworkFactoryShim.java",
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900598 ],
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900599 path: "device",
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900600 visibility: [
601 "//frameworks/opt/telephony",
602 ],
603}
Roshan Pius864bdec2020-01-16 09:19:11 -0800604
Nate Jiang5f0471c2024-07-12 16:49:52 +0000605// Filegroup to build lib used by Wifi framework
Roshan Pius864bdec2020-01-16 09:19:11 -0800606// Any class here *must* have a corresponding jarjar rule in the wifi build rules.
607filegroup {
608 name: "net-utils-framework-wifi-common-srcs",
609 srcs: [
Chalard Jeanb61091b2021-10-07 15:29:13 +0900610 "framework/com/android/net/module/util/DnsSdTxtRecord.java",
611 "framework/com/android/net/module/util/Inet4AddressUtils.java",
612 "framework/com/android/net/module/util/InetAddressUtils.java",
613 "framework/com/android/net/module/util/MacAddressUtils.java",
614 "framework/com/android/net/module/util/NetUtils.java",
Roshan Pius864bdec2020-01-16 09:19:11 -0800615 ],
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900616 path: "framework",
Nate Jiang5f0471c2024-07-12 16:49:52 +0000617 visibility: ["//visibility:private"],
Roshan Pius864bdec2020-01-16 09:19:11 -0800618}
Handa Wang9b0df362024-07-02 13:17:43 +0000619
Yan Yan61f779c2024-10-01 15:07:51 -0700620// Filegroup to build lib used by IPsec/IKE framework
621// Any class here *must* have a corresponding jarjar rule in the IPsec build rules.
622filegroup {
623 name: "net-utils-framework-ipsec-common-srcs",
624 srcs: [
625 "framework/com/android/net/module/util/HexDump.java",
626 ],
627 path: "framework",
628 visibility: ["//visibility:private"],
629}
630
631java_library {
632 name: "net-utils-framework-ipsec",
633 sdk_version: "module_current",
634 min_sdk_version: "30",
635 srcs: [":net-utils-framework-ipsec-common-srcs"],
636 libs: [
637 "androidx.annotation_annotation",
638 ],
639 visibility: [
640 "//packages/modules/IPsec",
641 ],
642 apex_available: ["com.android.ipsec"],
643}
644
Handa Wang9b0df362024-07-02 13:17:43 +0000645// Use a file group containing classes necessary for framework-connectivity. The file group should
646// be as small as possible because because the classes end up in the bootclasspath and R8 is not
647// used to remove unused classes.
648filegroup {
649 name: "net-utils-framework-connectivity-srcs",
650 srcs: [
651 "device/com/android/net/module/util/BpfBitmap.java",
652 "device/com/android/net/module/util/BpfDump.java",
653 "device/com/android/net/module/util/BpfMap.java",
654 "device/com/android/net/module/util/BpfUtils.java",
655 "device/com/android/net/module/util/IBpfMap.java",
656 "device/com/android/net/module/util/JniUtil.java",
657 "device/com/android/net/module/util/SingleWriterBpfMap.java",
658 "device/com/android/net/module/util/Struct.java",
659 "device/com/android/net/module/util/TcUtils.java",
660 "framework/com/android/net/module/util/HexDump.java",
661 ],
662 visibility: ["//visibility:private"],
663}
664
Handa Wange12dfea2024-11-01 09:25:28 +0000665// Sources outside of com.android.net.module.util should not be added because many modules depend on
666// them and need jarjar rules
Handa Wang9b0df362024-07-02 13:17:43 +0000667filegroup {
668 name: "net-utils-all-srcs",
669 srcs: [
670 "device/**/*.java",
671 ":net-utils-framework-common-srcs",
672 ],
673 visibility: ["//visibility:private"],
674}
675
676filegroup {
677 name: "net-utils-aidl-srcs",
678 srcs: [
679 "device/**/*.aidl",
680 ],
681 path: "device",
682 visibility: ["//visibility:private"],
683}
Nate Jiang5f0471c2024-07-12 16:49:52 +0000684
685java_library {
686 name: "net-utils-service-wifi",
687 srcs: [
688 ":net-utils-all-srcs",
689 ],
690 exclude_srcs: [":net-utils-framework-wifi-common-srcs"],
691 libs: [
692 "net-utils-framework-wifi",
693 ],
694 defaults: ["net-utils-non-bootclasspath-defaults"],
695
696 visibility: [
697 "//packages/modules/Wifi/service",
698 ],
699 apex_available: [
700 "com.android.wifi",
701 ],
702}
703
704java_library {
705 name: "net-utils-framework-wifi",
706 sdk_version: "module_current",
707 min_sdk_version: "30",
708 srcs: [":net-utils-framework-wifi-common-srcs"],
709 libs: [
710 "framework-annotations-lib",
711 "framework-connectivity.stubs.module_lib",
712 "unsupportedappusage",
713 ],
714 visibility: [
715 "//packages/modules/Wifi/framework",
716 ],
717 apex_available: ["com.android.wifi"],
718}
Yuyang Huang1cc77692024-11-08 11:51:07 +0900719
720genrule {
721 name: "statslog-framework-connectivity-java-gen",
722 tools: ["stats-log-api-gen"],
723 cmd: "$(location stats-log-api-gen) --java $(out) --module connectivity --javaPackage com.android.net.module.util --javaClass FrameworkConnectivityStatsLog",
724 out: ["com/android/net/module/util/FrameworkConnectivityStatsLog.java"],
725}
Yan Yan587f9962024-10-02 22:38:10 +0000726
727java_library {
728 name: "net-utils-service-vcn",
729 sdk_version: "module_current",
730 min_sdk_version: "30",
731 srcs: [
732 "device/com/android/net/module/util/HandlerUtils.java",
733 ],
734 libs: [
735 "framework-annotations-lib",
736 ],
737 visibility: [
738 // TODO: b/374174952 Remove it when VCN modularization is released
739 "//frameworks/base/packages/Vcn/service-b",
740
741 "//packages/modules/Connectivity/service-b",
742 ],
743 apex_available: [
744 // TODO: b/374174952 Remove it when VCN modularization is released
745 "//apex_available:platform",
746
747 "com.android.tethering",
748 ],
749}