1// 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 15// 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. 20// 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. 25 26// 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 30package { 31 default_applicable_licenses: ["Android-Apache-2.0"], 32} 33 34java_library { 35 name: "net-utils-device-common", 36 srcs: [ 37 "device/com/android/net/module/util/DeviceConfigUtils.java", 38 "device/com/android/net/module/util/FdEventsReader.java", 39 "device/com/android/net/module/util/HexDump.java", 40 "device/com/android/net/module/util/PacketReader.java", 41 "device/com/android/net/module/util/SharedLog.java", 42 // This library is used by system modules, for which the system health impact of Kotlin 43 // has not yet been evaluated. Annotations may need jarjar'ing. 44 // "src_devicecommon/**/*.kt", 45 ], 46 sdk_version: "module_current", 47 min_sdk_version: "29", 48 target_sdk_version: "30", 49 apex_available: [ 50 "//apex_available:anyapex", 51 "//apex_available:platform", 52 ], 53 visibility: [ 54 "//frameworks/base/packages/Tethering", 55 "//packages/modules/Connectivity:__subpackages__", 56 "//packages/modules/Connectivity/framework:__subpackages__", 57 "//frameworks/opt/net/ike", 58 "//frameworks/opt/net/wifi/service", 59 "//packages/modules/Wifi/service", 60 "//frameworks/opt/net/telephony", 61 "//packages/modules/NetworkStack:__subpackages__", 62 "//packages/modules/CaptivePortalLogin", 63 "//frameworks/libs/net/common/tests:__subpackages__", 64 "//frameworks/libs/net/common/testutils:__subpackages__", 65 ], 66 static_libs: [ 67 "net-utils-framework-common", 68 ], 69 libs: [ 70 "androidx.annotation_annotation", 71 "framework-annotations-lib", 72 ], 73 lint: { strict_updatability_linting: true }, 74} 75 76java_defaults { 77 name: "lib_mockito_extended", 78 static_libs: [ 79 "mockito-target-extended-minus-junit4" 80 ], 81 jni_libs: [ 82 "libdexmakerjvmtiagent", 83 "libstaticjvmtiagent", 84 ], 85} 86 87java_library { 88 name: "net-utils-dnspacket-common", 89 srcs: [ 90 "framework/**/DnsPacket.java", 91 "framework/**/DnsPacketUtils.java", 92 ], 93 sdk_version: "module_current", 94 visibility: [ 95 "//packages/services/Iwlan:__subpackages__", 96 ], 97 libs: ["framework-annotations-lib"], 98} 99 100filegroup { 101 name: "net-utils-framework-common-srcs", 102 srcs: ["framework/**/*.java"], 103 path: "framework", 104 visibility: [ 105 "//frameworks/base", 106 "//packages/modules/Connectivity:__subpackages__", 107 ], 108} 109 110java_library { 111 name: "net-utils-device-common-bpf", 112 srcs: [ 113 "device/com/android/net/module/util/BpfBitmap.java", 114 "device/com/android/net/module/util/BpfMap.java", 115 "device/com/android/net/module/util/BpfUtils.java", 116 "device/com/android/net/module/util/HexDump.java", 117 "device/com/android/net/module/util/IBpfMap.java", 118 "device/com/android/net/module/util/JniUtil.java", 119 "device/com/android/net/module/util/Struct.java", 120 "device/com/android/net/module/util/TcUtils.java", 121 "device/com/android/net/module/util/bpf/*.java", 122 ], 123 sdk_version: "module_current", 124 min_sdk_version: "29", 125 visibility: [ 126 "//frameworks/libs/net/common/tests:__subpackages__", 127 "//frameworks/libs/net/common/testutils:__subpackages__", 128 "//packages/modules/Connectivity:__subpackages__", 129 "//packages/modules/NetworkStack:__subpackages__", 130 ], 131 libs: [ 132 "androidx.annotation_annotation", 133 "framework-connectivity.stubs.module_lib", 134 ], 135 apex_available: [ 136 "com.android.tethering", 137 "//apex_available:platform", 138 ], 139 lint: { strict_updatability_linting: true }, 140} 141 142java_library { 143 name: "net-utils-device-common-struct", 144 srcs: [ 145 "device/com/android/net/module/util/HexDump.java", 146 "device/com/android/net/module/util/Ipv6Utils.java", 147 "device/com/android/net/module/util/PacketBuilder.java", 148 "device/com/android/net/module/util/Struct.java", 149 "device/com/android/net/module/util/structs/*.java", 150 ], 151 sdk_version: "module_current", 152 min_sdk_version: "29", 153 visibility: [ 154 "//frameworks/libs/net/common/testutils:__subpackages__", 155 "//packages/modules/Connectivity:__subpackages__", 156 "//packages/modules/NetworkStack:__subpackages__", 157 ], 158 static_libs: [ 159 "net-utils-framework-common", 160 ], 161 libs: [ 162 "androidx.annotation_annotation", 163 "framework-connectivity.stubs.module_lib", 164 ], 165 apex_available: [ 166 "com.android.tethering", 167 "//apex_available:platform", 168 ], 169 lint: { strict_updatability_linting: true }, 170} 171 172java_library { 173 name: "net-utils-device-common-netlink", 174 srcs: [ 175 "device/com/android/net/module/util/netlink/*.java", 176 ], 177 sdk_version: "module_current", 178 min_sdk_version: "29", 179 visibility: [ 180 "//frameworks/libs/net/common/testutils:__subpackages__", 181 "//packages/modules/Connectivity:__subpackages__", 182 "//packages/modules/NetworkStack:__subpackages__", 183 ], 184 static_libs: [ 185 "net-utils-device-common-struct", 186 ], 187 libs: [ 188 "androidx.annotation_annotation", 189 "framework-connectivity.stubs.module_lib", 190 ], 191 apex_available: [ 192 "com.android.tethering", 193 "//apex_available:platform", 194 ], 195 lint: { strict_updatability_linting: true }, 196} 197 198java_library { 199 // TODO : this target should probably be folded into net-utils-device-common 200 name: "net-utils-device-common-ip", 201 srcs: [ 202 "device/com/android/net/module/util/ip/*.java", 203 ], 204 sdk_version: "module_current", 205 min_sdk_version: "29", 206 visibility: [ 207 "//frameworks/libs/net/common/tests:__subpackages__", 208 "//frameworks/libs/net/common/testutils:__subpackages__", 209 "//packages/modules/Connectivity:__subpackages__", 210 "//packages/modules/NetworkStack:__subpackages__", 211 ], 212 libs: [ 213 "framework-annotations-lib", 214 "framework-connectivity", 215 ], 216 static_libs: [ 217 "net-utils-device-common", 218 "net-utils-device-common-netlink", 219 "net-utils-framework-common", 220 "netd-client", 221 ], 222 apex_available: [ 223 "com.android.tethering", 224 "//apex_available:platform", 225 ], 226 lint: { strict_updatability_linting: true }, 227} 228 229java_library { 230 name: "net-utils-framework-common", 231 srcs: [ 232 ":net-utils-framework-common-srcs", 233 ], 234 sdk_version: "module_current", 235 libs: [ 236 "framework-annotations-lib", 237 "framework-connectivity.stubs.module_lib", 238 "framework-connectivity-t.stubs.module_lib", 239 ], 240 jarjar_rules: "jarjar-rules-shared.txt", 241 visibility: [ 242 "//cts/tests/tests/net", 243 "//cts/tests/tests/wifi", 244 "//packages/modules/Connectivity/tests/cts/net", 245 "//frameworks/base/packages/Tethering", 246 "//packages/modules/Connectivity/Tethering", 247 "//frameworks/base/tests:__subpackages__", 248 "//frameworks/opt/net/ike", 249 "//frameworks/opt/telephony", 250 "//frameworks/base/wifi:__subpackages__", 251 "//frameworks/base/packages/Connectivity:__subpackages__", 252 "//packages/modules/Connectivity:__subpackages__", 253 "//packages/modules/NetworkStack:__subpackages__", 254 "//packages/modules/CaptivePortalLogin", 255 "//frameworks/libs/net/common/tests:__subpackages__", 256 "//frameworks/libs/net/common/device", 257 "//packages/modules/Wifi/framework/tests:__subpackages__", 258 "//packages/apps/Settings", 259 ], 260 lint: { strict_updatability_linting: true }, 261} 262filegroup { 263 name: "net-utils-services-common-srcs", 264 srcs: [ 265 "device/android/net/NetworkFactory.java", 266 "device/android/net/NetworkFactoryImpl.java", 267 "device/android/net/NetworkFactoryLegacyImpl.java", 268 "device/android/net/NetworkFactoryShim.java", 269 ], 270 visibility: [ 271 "//frameworks/base/services/net", 272 ], 273} 274 275java_library { 276 name: "net-utils-services-common", 277 srcs: [ 278 ":net-utils-services-common-srcs", 279 ], 280 sdk_version: "module_current", 281 min_sdk_version: "30", 282 static_libs: [ 283 "modules-utils-build_system", 284 ], 285 libs: [ 286 "framework-annotations-lib", 287 "framework-connectivity", 288 ], 289 // TODO: remove "apex_available:platform". 290 apex_available: [ 291 "//apex_available:platform", 292 "com.android.bluetooth", 293 "com.android.tethering", 294 ], 295 visibility: [ 296 // TODO: remove after NetworkStatsService moves to the module. 297 "//frameworks/base/services/net", 298 "//packages/modules/Connectivity/service", 299 "//packages/modules/Connectivity/tests:__subpackages__", 300 "//packages/modules/Bluetooth/android/app", 301 ], 302 lint: { strict_updatability_linting: true }, 303} 304 305// Use a filegroup and not a library for telephony sources, as framework-annotations cannot be 306// included either (some annotations would be duplicated on the bootclasspath). 307filegroup { 308 name: "net-utils-telephony-common-srcs", 309 srcs: [ 310 // Any class here *must* have a corresponding jarjar rule in the telephony build rules. 311 "device/android/net/NetworkFactory.java", 312 "device/android/net/NetworkFactoryImpl.java", 313 "device/android/net/NetworkFactoryLegacyImpl.java", 314 "device/android/net/NetworkFactoryShim.java", 315 ], 316 path: "device", 317 visibility: [ 318 "//frameworks/opt/telephony", 319 ], 320} 321 322// Use a filegroup and not a library for wifi sources, as this needs corresponding jar-jar 323// rules on the wifi side. 324// Any class here *must* have a corresponding jarjar rule in the wifi build rules. 325filegroup { 326 name: "net-utils-framework-wifi-common-srcs", 327 srcs: [ 328 "framework/com/android/net/module/util/DnsSdTxtRecord.java", 329 "framework/com/android/net/module/util/Inet4AddressUtils.java", 330 "framework/com/android/net/module/util/InetAddressUtils.java", 331 "framework/com/android/net/module/util/MacAddressUtils.java", 332 "framework/com/android/net/module/util/NetUtils.java", 333 ], 334 path: "framework", 335 visibility: [ 336 "//frameworks/base", 337 ], 338} 339 340// Use a filegroup and not a library for wifi sources, as this needs corresponding jar-jar 341// rules on the wifi side. 342// Any class here *must* have a corresponding jarjar rule in the wifi build rules. 343filegroup { 344 name: "net-utils-wifi-service-common-srcs", 345 srcs: [ 346 "device/android/net/NetworkFactory.java", 347 "device/android/net/NetworkFactoryImpl.java", 348 "device/android/net/NetworkFactoryLegacyImpl.java", 349 "device/android/net/NetworkFactoryShim.java", 350 ], 351 visibility: [ 352 "//frameworks/opt/net/wifi/service", 353 "//packages/modules/Wifi/service", 354 ], 355} 356