blob: 85258f8ff1024e3a9ac58ba20613bc37d579bd9d [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",
Jihoon Kang8401b6a2024-08-30 00:29:58 +000073 "framework-configinfrastructure.stubs.module_lib",
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000074 "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",
Jihoon Kang8401b6a2024-08-30 00:29:58 +0000267 "framework-connectivity.stubs.module_lib",
Chalard Jeanb61091b2021-10-07 15:29:13 +0900268 ],
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 ],
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800299 jarjar_rules: "jarjar-rules-shared.txt",
300 visibility: [
Luke Huangfd5479e2020-06-20 11:38:17 +0800301 "//cts/tests/tests/net",
Chalard Jeanceaf7d02020-06-26 18:34:52 +0900302 "//cts/tests/tests/wifi",
Baligh Uddine685c812020-10-31 04:28:58 +0000303 "//packages/modules/Connectivity/tests/cts/net",
Baligh Uddinae4770d2020-10-29 02:12:06 +0000304 "//packages/modules/Connectivity/Tethering",
Chalard Jeana9f49912020-10-15 18:06:30 +0900305 "//frameworks/base/tests:__subpackages__",
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800306 "//frameworks/opt/net/ike",
307 "//frameworks/opt/telephony",
Chalard Jean19789192020-10-01 12:45:31 +0900308 "//frameworks/base/wifi:__subpackages__",
Remi NGUYEN VAN38afb0c2020-11-10 18:04:27 +0900309 "//packages/modules/Connectivity:__subpackages__",
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900310 "//packages/modules/NetworkStack:__subpackages__",
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800311 "//packages/modules/CaptivePortalLogin",
Baligh Uddinfcbda3a2020-12-24 06:12:25 +0000312 "//packages/modules/Wifi/framework/tests:__subpackages__",
Junyu Laib24df142022-01-10 10:31:11 +0000313 "//packages/apps/Settings",
Chalard Jean7592a342021-04-19 18:04:34 +0900314 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900315 lint: {
316 strict_updatability_linting: true,
317 error_checks: ["NewApi"],
318 },
Paul Hu8d47d842023-03-31 14:59:49 +0800319 errorprone: {
320 enabled: true,
321 // Error-prone checking only warns of problems when building. To make the build fail with
322 // these errors, list the specific error-prone problems below.
323 javacflags: [
324 "-Xep:NullablePrimitive:ERROR",
325 ],
326 },
Spandan Das2b83e772023-12-21 20:46:31 +0000327 apex_available: [
328 "//apex_available:platform",
329 "com.android.tethering",
330 ],
Aaron Huangf73ff8c2019-12-06 18:12:24 +0800331}
Anton Hansson0ceeb7c2022-05-30 12:01:49 +0000332
333java_library {
334 name: "net-utils-services-common",
David Su2dbab642020-10-26 14:51:01 -0700335 srcs: [
336 "device/android/net/NetworkFactory.java",
Chalard Jean7592a342021-04-19 18:04:34 +0900337 "device/android/net/NetworkFactoryImpl.java",
338 "device/android/net/NetworkFactoryLegacyImpl.java",
339 "device/android/net/NetworkFactoryShim.java",
David Su2dbab642020-10-26 14:51:01 -0700340 ],
Chalard Jeand5802422021-10-27 19:02:14 +0900341 sdk_version: "module_current",
David Sudc0a5682021-01-29 04:42:27 +0000342 min_sdk_version: "30",
Chalard Jeand5802422021-10-27 19:02:14 +0900343 libs: [
344 "framework-annotations-lib",
Jihoon Kang8401b6a2024-08-30 00:29:58 +0000345 "framework-connectivity.stubs.module_lib",
William Escande51c0be52024-07-10 14:26:50 -0700346 "modules-utils-build_system",
Chalard Jeand5802422021-10-27 19:02:14 +0900347 ],
Xiao Ma2bbc2f72022-01-24 07:58:12 +0000348 // TODO: remove "apex_available:platform".
349 apex_available: [
350 "//apex_available:platform",
William Escandefbe576b2022-08-22 11:28:00 -0700351 "com.android.btservices",
Xiao Ma2bbc2f72022-01-24 07:58:12 +0000352 "com.android.tethering",
Anton Hansson0ceeb7c2022-05-30 12:01:49 +0000353 "com.android.wifi",
Xiao Ma2bbc2f72022-01-24 07:58:12 +0000354 ],
Aaron Huang57a94962020-01-03 20:35:55 +0800355 visibility: [
markchien32a6e9c2022-01-20 14:34:15 +0800356 // TODO: remove after NetworkStatsService moves to the module.
Remi NGUYEN VAN376f8d42020-01-15 18:26:29 +0900357 "//frameworks/base/services/net",
Xiao Ma2bbc2f72022-01-24 07:58:12 +0000358 "//packages/modules/Connectivity/service",
Remi NGUYEN VAN0cf724a2021-11-19 18:33:12 +0900359 "//packages/modules/Connectivity/tests:__subpackages__",
Roopa Sattiraju98fa3bf2022-02-03 18:53:23 -0800360 "//packages/modules/Bluetooth/android/app",
Nate(Qiang) Jiangce723aa2022-06-01 21:28:32 +0000361 "//packages/modules/Wifi/service:__subpackages__",
Aaron Huang57a94962020-01-03 20:35:55 +0800362 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900363 lint: {
364 strict_updatability_linting: true,
365 error_checks: ["NewApi"],
366 },
Aaron Huang57a94962020-01-03 20:35:55 +0800367}
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900368
Igor Chernysheva25f1092022-12-20 00:07:38 -0800369java_library {
370 name: "net-utils-device-common-async",
371 srcs: [
372 "device/com/android/net/module/util/async/*.java",
373 ],
374 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000375 min_sdk_version: "30",
Igor Chernysheva25f1092022-12-20 00:07:38 -0800376 visibility: [
Igor Chernysheva25f1092022-12-20 00:07:38 -0800377 "//packages/modules/Connectivity:__subpackages__",
378 ],
379 libs: [
380 "framework-annotations-lib",
381 ],
382 static_libs: [
383 ],
384 apex_available: [
385 "com.android.tethering",
386 "//apex_available:platform",
387 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900388 lint: {
389 strict_updatability_linting: true,
390 error_checks: ["NewApi"],
391 },
Igor Chernysheva25f1092022-12-20 00:07:38 -0800392}
393
Igor Chernyshev810be2b2023-04-06 15:52:26 -0700394java_library {
395 name: "net-utils-device-common-wear",
396 srcs: [
397 "device/com/android/net/module/util/wear/*.java",
398 ],
399 sdk_version: "module_current",
Maciej Żenczykowski127a1442023-09-19 23:17:10 +0000400 min_sdk_version: "30",
Igor Chernyshev810be2b2023-04-06 15:52:26 -0700401 visibility: [
Igor Chernyshev810be2b2023-04-06 15:52:26 -0700402 "//packages/modules/Connectivity:__subpackages__",
403 ],
404 libs: [
405 "framework-annotations-lib",
406 ],
407 static_libs: [
408 "net-utils-device-common-async",
409 ],
410 apex_available: [
411 "com.android.tethering",
412 "//apex_available:platform",
413 ],
Motomu Utsumi195a30f2023-09-27 16:03:30 +0900414 lint: {
415 strict_updatability_linting: true,
416 error_checks: ["NewApi"],
417 },
Igor Chernyshev810be2b2023-04-06 15:52:26 -0700418}
419
Yuyang Huangf67388b2023-03-29 16:51:09 +0900420// Limited set of utilities for use by service-connectivity-mdns-standalone-build-test, to make sure
421// the mDNS code can build with only system APIs.
422// The mDNS code is platform code so it should use framework-annotations-lib, contrary to apps that
423// should use sdk_version: "system_current" and only androidx.annotation_annotation. But this build
424// rule verifies that the mDNS code can be built into apps, if code transformations are applied to
425// the annotations.
426// When using "system_current", framework annotations are not available; they would appear as
427// package-private as they are marked as such in the system_current stubs. So build against
428// core_platform and add the stubs manually in "libs". See http://b/147773144#comment7.
429java_library {
430 name: "net-utils-device-common-mdns-standalone-build-test",
431 // Build against core_platform and add the stub libraries manually in "libs", as annotations
432 // are already included in android_system_stubs_current but package-private, so
433 // "framework-annotations-lib" needs to be manually included before
434 // "android_system_stubs_current" (b/272392042)
435 sdk_version: "core_platform",
436 srcs: [
437 "device/com/android/net/module/util/FdEventsReader.java",
Yuyang Huangf67388b2023-03-29 16:51:09 +0900438 "device/com/android/net/module/util/SharedLog.java",
439 "framework/com/android/net/module/util/ByteUtils.java",
440 "framework/com/android/net/module/util/CollectionUtils.java",
Yuyang Huangd851a042024-07-16 18:48:43 +0900441 "framework/com/android/net/module/util/DnsUtils.java",
Yuyang Huange4eb87a2023-05-02 18:44:51 +0900442 "framework/com/android/net/module/util/HexDump.java",
Yuyang Huangf67388b2023-03-29 16:51:09 +0900443 "framework/com/android/net/module/util/LinkPropertiesUtils.java",
444 ],
445 libs: [
446 "framework-annotations-lib",
447 "android_system_stubs_current",
448 "androidx.annotation_annotation",
449 ],
450 visibility: ["//packages/modules/Connectivity/service-t"],
451}
452
Handa Wang8be10bf2024-08-08 15:36:48 +0000453// net-utils-framework-connectivity is only for framework-connectivity.
Handa Wang9b0df362024-07-02 13:17:43 +0000454java_library {
455 name: "net-utils-framework-connectivity",
456 srcs: [
457 ":net-utils-framework-connectivity-srcs",
458 ],
459 sdk_version: "module_current",
460 min_sdk_version: "30",
461 apex_available: [
462 "com.android.tethering",
463 "//apex_available:platform",
464 ],
465 visibility: [
Handa Wang8be10bf2024-08-08 15:36:48 +0000466 "//packages/modules/Connectivity/framework",
Handa Wang9b0df362024-07-02 13:17:43 +0000467 ],
468 libs: [
469 "androidx.annotation_annotation",
470 "framework-annotations-lib",
Jihoon Kang8401b6a2024-08-30 00:29:58 +0000471 "framework-configinfrastructure.stubs.module_lib",
Handa Wang9b0df362024-07-02 13:17:43 +0000472 "framework-connectivity.stubs.module_lib",
473 ],
474 lint: {
475 strict_updatability_linting: true,
476 error_checks: ["NewApi"],
477 },
478}
479
480java_defaults {
481 name: "net-utils-non-bootclasspath-defaults",
482 sdk_version: "module_current",
483 min_sdk_version: "30",
Handa Wang9b0df362024-07-02 13:17:43 +0000484 libs: [
485 "androidx.annotation_annotation",
486 "framework-annotations-lib",
Jihoon Kang8401b6a2024-08-30 00:29:58 +0000487 "framework-configinfrastructure.stubs.module_lib",
Handa Wang9b0df362024-07-02 13:17:43 +0000488 "framework-connectivity.stubs.module_lib",
489 "framework-connectivity-t.stubs.module_lib",
490 "framework-location.stubs.module_lib",
Jihoon Kang8401b6a2024-08-30 00:29:58 +0000491 "framework-tethering.stubs.module_lib",
Handa Wang9b0df362024-07-02 13:17:43 +0000492 "unsupportedappusage",
493 ],
494 static_libs: [
495 "modules-utils-build_system",
496 "modules-utils-statemachine",
497 "net-utils-non-bootclasspath-aidl-java",
498 "netd-client",
499 ],
500 apex_available: [
501 "com.android.tethering",
502 "//apex_available:platform",
503 ],
Handa Wang9b0df362024-07-02 13:17:43 +0000504 defaults_visibility: [
505 "//visibility:private",
506 ],
507 lint: {
508 strict_updatability_linting: true,
509 error_checks: ["NewApi"],
510 },
511}
512
Handa Wang8be10bf2024-08-08 15:36:48 +0000513// net-utils-service-connectivity is only for service-connectivity.
Handa Wang9b0df362024-07-02 13:17:43 +0000514java_library {
515 name: "net-utils-service-connectivity",
516 srcs: [
517 ":net-utils-all-srcs",
518 ],
519 exclude_srcs: [
520 ":net-utils-framework-connectivity-srcs",
521 ],
522 libs: [
523 "net-utils-framework-connectivity",
Jihoon Kang8401b6a2024-08-30 00:29:58 +0000524 "framework-connectivity.impl",
525 "framework-tethering.impl",
Handa Wang9b0df362024-07-02 13:17:43 +0000526 ],
527 defaults: ["net-utils-non-bootclasspath-defaults"],
Nate Jiang5f0471c2024-07-12 16:49:52 +0000528 jarjar_rules: "jarjar-rules-shared.txt",
Handa Wang8be10bf2024-08-08 15:36:48 +0000529 visibility: [
530 "//packages/modules/Connectivity/service",
531 "//packages/modules/Connectivity/staticlibs/tests/unit",
532 ],
Handa Wang9b0df362024-07-02 13:17:43 +0000533}
534
Remi NGUYEN VAN514f40b2024-08-15 08:07:02 +0000535// net-utils-connectivity-apks is only for NetworkStack, CaptivePortalLogin and
536// Tethering.apk
537// It includes all the static libraries in this directory, which is safe because
538// these APKs use R8 to strip out unused code, and they do not depend on
539// bootclasspath jars that may have duplicate copies of the included classes
540// with the same jarjaring.
541// Tethering.apk does depend on a bootclasspath jar (framework-tethering.jar),
542// however it does not use any of the static libraries. If it did, Tethering.apk
543// would need to use another variant that excludes classes that are already
544// included in framework-tethering.jar (similarly to how framework-connectivity
545// and service-connectivity do it). Otherwise, static libs included in
546// framework-tethering and Tethering.apk and jarjared the same way would
547// conflict.
Handa Wang9b0df362024-07-02 13:17:43 +0000548java_library {
Xiao Ma6793fd02024-07-26 13:07:50 +0900549 name: "net-utils-connectivity-apks",
Handa Wang9b0df362024-07-02 13:17:43 +0000550 srcs: [
551 ":net-utils-all-srcs",
552 ":framework-connectivity-shared-srcs",
553 ],
554 defaults: ["net-utils-non-bootclasspath-defaults"],
Nate Jiang5f0471c2024-07-12 16:49:52 +0000555 jarjar_rules: "jarjar-rules-shared.txt",
Handa Wang8be10bf2024-08-08 15:36:48 +0000556 visibility: [
557 "//packages/modules/CaptivePortalLogin:__subpackages__",
558 "//packages/modules/Connectivity/Tethering",
559 ],
Handa Wang9b0df362024-07-02 13:17:43 +0000560}
561
562aidl_interface {
563 name: "net-utils-non-bootclasspath-aidl",
564 srcs: [
565 ":net-utils-aidl-srcs",
566 ],
567 unstable: true,
568 backend: {
569 java: {
570 enabled: true,
571 min_sdk_version: "30",
572 apex_available: [
573 "com.android.tethering",
Nate Jiang5f0471c2024-07-12 16:49:52 +0000574 "com.android.wifi",
Xiao Mab28199a2024-08-05 14:24:26 +0900575 "//apex_available:platform",
Handa Wang9b0df362024-07-02 13:17:43 +0000576 ],
577 },
578 cpp: {
579 enabled: false,
580 },
581 ndk: {
582 enabled: false,
583 },
584 rust: {
585 enabled: false,
586 },
587 },
588 include_dirs: [
589 "packages/modules/Connectivity/framework/aidl-export",
590 ],
591 visibility: [
592 "//system/tools/aidl/build",
593 ],
594}
595
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900596// Use a filegroup and not a library for telephony sources, as framework-annotations cannot be
597// included either (some annotations would be duplicated on the bootclasspath).
598filegroup {
599 name: "net-utils-telephony-common-srcs",
600 srcs: [
601 // Any class here *must* have a corresponding jarjar rule in the telephony build rules.
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900602 "device/android/net/NetworkFactory.java",
Chalard Jean7592a342021-04-19 18:04:34 +0900603 "device/android/net/NetworkFactoryImpl.java",
604 "device/android/net/NetworkFactoryLegacyImpl.java",
605 "device/android/net/NetworkFactoryShim.java",
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900606 ],
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900607 path: "device",
Lorenzo Colittie14bd342020-01-14 14:47:16 +0900608 visibility: [
609 "//frameworks/opt/telephony",
610 ],
611}
Roshan Pius864bdec2020-01-16 09:19:11 -0800612
Nate Jiang5f0471c2024-07-12 16:49:52 +0000613// Filegroup to build lib used by Wifi framework
Roshan Pius864bdec2020-01-16 09:19:11 -0800614// Any class here *must* have a corresponding jarjar rule in the wifi build rules.
615filegroup {
616 name: "net-utils-framework-wifi-common-srcs",
617 srcs: [
Chalard Jeanb61091b2021-10-07 15:29:13 +0900618 "framework/com/android/net/module/util/DnsSdTxtRecord.java",
619 "framework/com/android/net/module/util/Inet4AddressUtils.java",
620 "framework/com/android/net/module/util/InetAddressUtils.java",
621 "framework/com/android/net/module/util/MacAddressUtils.java",
622 "framework/com/android/net/module/util/NetUtils.java",
Roshan Pius864bdec2020-01-16 09:19:11 -0800623 ],
Chalard Jean48c6c7d2020-06-25 23:39:15 +0900624 path: "framework",
Nate Jiang5f0471c2024-07-12 16:49:52 +0000625 visibility: ["//visibility:private"],
Roshan Pius864bdec2020-01-16 09:19:11 -0800626}
Handa Wang9b0df362024-07-02 13:17:43 +0000627
628// Use a file group containing classes necessary for framework-connectivity. The file group should
629// be as small as possible because because the classes end up in the bootclasspath and R8 is not
630// used to remove unused classes.
631filegroup {
632 name: "net-utils-framework-connectivity-srcs",
633 srcs: [
634 "device/com/android/net/module/util/BpfBitmap.java",
635 "device/com/android/net/module/util/BpfDump.java",
636 "device/com/android/net/module/util/BpfMap.java",
637 "device/com/android/net/module/util/BpfUtils.java",
638 "device/com/android/net/module/util/IBpfMap.java",
639 "device/com/android/net/module/util/JniUtil.java",
640 "device/com/android/net/module/util/SingleWriterBpfMap.java",
641 "device/com/android/net/module/util/Struct.java",
642 "device/com/android/net/module/util/TcUtils.java",
643 "framework/com/android/net/module/util/HexDump.java",
644 ],
645 visibility: ["//visibility:private"],
646}
647
648filegroup {
649 name: "net-utils-all-srcs",
650 srcs: [
651 "device/**/*.java",
652 ":net-utils-framework-common-srcs",
653 ],
654 visibility: ["//visibility:private"],
655}
656
657filegroup {
658 name: "net-utils-aidl-srcs",
659 srcs: [
660 "device/**/*.aidl",
661 ],
662 path: "device",
663 visibility: ["//visibility:private"],
664}
Nate Jiang5f0471c2024-07-12 16:49:52 +0000665
666java_library {
667 name: "net-utils-service-wifi",
668 srcs: [
669 ":net-utils-all-srcs",
670 ],
671 exclude_srcs: [":net-utils-framework-wifi-common-srcs"],
672 libs: [
673 "net-utils-framework-wifi",
674 ],
675 defaults: ["net-utils-non-bootclasspath-defaults"],
676
677 visibility: [
678 "//packages/modules/Wifi/service",
679 ],
680 apex_available: [
681 "com.android.wifi",
682 ],
683}
684
685java_library {
686 name: "net-utils-framework-wifi",
687 sdk_version: "module_current",
688 min_sdk_version: "30",
689 srcs: [":net-utils-framework-wifi-common-srcs"],
690 libs: [
691 "framework-annotations-lib",
692 "framework-connectivity.stubs.module_lib",
693 "unsupportedappusage",
694 ],
695 visibility: [
696 "//packages/modules/Wifi/framework",
697 ],
698 apex_available: ["com.android.wifi"],
699}