android_packages_modules_Co.../staticlibs/Android.bp

348 lines
12 KiB
Text
Raw Normal View History

// Copyright (C) 2019 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// 1. The "net-utils-framework-common" library is also compiled into the framework and placed on the
// boot classpath. It uses jarjar rules so that anything outside the framework can use this
// library directly.
// 2. The "net-utils-services-common" library is for use by modules and frameworks/base/services.
// It does not need to be jarjared because it is not placed on the bootclasspath.
// 3. The "net-utils-telephony-common-srcs" filegroup is for use specifically by telephony, which
// places many of its classes, even non-API service classes, on the boot classpath. Any file that
// is added to this filegroup *must* have a corresponding jarjar rule in the telephony jarjar
// rules file. Otherwise, it will end up on the boot classpath and other modules will not be able
// to provide their own copy.
// Note: all filegroups here must have the right path attribute because otherwise, if they are
// included in the bootclasspath, they could incorrectly be included in the SDK documentation even
// though they are not in the current.txt files.
package {
default_applicable_licenses: ["Android-Apache-2.0"],
}
java_library {
name: "net-utils-device-common",
srcs: [
"device/com/android/net/module/util/DeviceConfigUtils.java",
"device/com/android/net/module/util/FdEventsReader.java",
"device/com/android/net/module/util/HexDump.java",
"device/com/android/net/module/util/PacketReader.java",
Move static utils to the static library These classes used to live as a static utility in the NetworkStack module, but that's not the right place for them. The point of this patch is to *not* require topics, as any change in this space will very quickly spin out of control and become unmanageable. As such, this starts with creating equivalent classes in a single, easier to manage change. Followup changes will migrate users of the old classes to use these ones instead. Finally, the old classes can be removed. This way, work can be broken down into separate changes and be checked in little by little, rather than one huge topic with many changes doing everything in one go, which is unlikely to be manageable. There are no code changes from the originals, but a number of reorganizations, most of them unavoidable. • Vertical spacing (these classes fix it) • Package names/imports are adjusted • Added @hide on NetlinkMonitor • Move all contents of RouteUtils to NetdUtils, because all methods depend on INetd, and some of the targets do not/cannot depend on netd-client • Restrict the files used by the filegroup net-utils-framework-wifi-common-srcs, since that target does not necessarily provide all dependencies to all its users. • Don't move NetworkMonitorUtils, since it depends on SdkLevel, and net-utils-framework-common-srcs is using **/*.java. It would have been possible to list explicitly all files actually necessary in this filegroup, but NetworkMonitorUtils is actually only used by the networking modules and not the framework. Eventually it should move but it doesn't have to be in this patch, which is complicated enough as it is. • RouteUtils is now empty, because some new methods will be added to it soon and it is less expensive to keep it empty than to remove it now and add it again later. • Merge NetdUtils, and unify the constants. Some changes to satisfy checkstyle : • Remove unused imports • Reorder modifiers in InterfaceController • Remove {} in IpNetworkMonitor • Remove redundant public modifier in IpNetworkMonitor • Add javadoc to a few methods • Add whitespace around | in InterfaceParams However, don't rename members in IpNeighborMonitor like checkstyle would prefer because this would make migration to this more involved. Test: NetworkStaticLibsTests NetdStaticLibTests Change-Id: I439121cba5d7ea95aa4d6c80ea25207c316880a0
2021-10-07 15:29:13 +09:00
"device/com/android/net/module/util/SharedLog.java",
// This library is used by system modules, for which the system health impact of Kotlin
// has not yet been evaluated. Annotations may need jarjar'ing.
// "src_devicecommon/**/*.kt",
],
sdk_version: "module_current",
min_sdk_version: "29",
target_sdk_version: "30",
apex_available: [
"//apex_available:anyapex",
"//apex_available:platform",
],
visibility: [
"//frameworks/base/packages/Tethering",
"//packages/modules/Connectivity:__subpackages__",
"//packages/modules/Connectivity/framework:__subpackages__",
"//frameworks/opt/net/ike",
"//frameworks/opt/net/wifi/service",
"//packages/modules/Wifi/service",
"//frameworks/opt/net/telephony",
"//packages/modules/NetworkStack:__subpackages__",
"//packages/modules/CaptivePortalLogin",
"//frameworks/libs/net/common/tests:__subpackages__",
"//frameworks/libs/net/common/testutils:__subpackages__",
],
static_libs: [
"net-utils-framework-common",
],
libs: [
"androidx.annotation_annotation",
"framework-annotations-lib",
],
lint: { strict_updatability_linting: true },
}
java_defaults {
name: "lib_mockito_extended",
static_libs: [
"mockito-target-extended-minus-junit4"
],
jni_libs: [
"libdexmakerjvmtiagent",
"libstaticjvmtiagent",
],
}
java_library {
name: "net-utils-dnspacket-common",
srcs: [
"framework/**/DnsPacket.java",
"framework/**/DnsPacketUtils.java",
],
sdk_version: "module_current",
visibility: [
"//packages/services/Iwlan:__subpackages__",
],
libs: ["framework-annotations-lib"],
}
filegroup {
name: "net-utils-framework-common-srcs",
srcs: ["framework/**/*.java"],
path: "framework",
visibility: [
"//frameworks/base",
"//packages/modules/Connectivity:__subpackages__",
],
}
java_library {
name: "net-utils-device-common-bpf",
srcs: [
"device/com/android/net/module/util/BpfBitmap.java",
"device/com/android/net/module/util/BpfMap.java",
"device/com/android/net/module/util/BpfUtils.java",
"device/com/android/net/module/util/HexDump.java",
"device/com/android/net/module/util/IBpfMap.java",
"device/com/android/net/module/util/JniUtil.java",
"device/com/android/net/module/util/Struct.java",
"device/com/android/net/module/util/TcUtils.java",
"device/com/android/net/module/util/bpf/*.java",
],
sdk_version: "module_current",
min_sdk_version: "29",
visibility: [
"//frameworks/libs/net/common/tests:__subpackages__",
"//frameworks/libs/net/common/testutils:__subpackages__",
"//packages/modules/Connectivity:__subpackages__",
"//packages/modules/NetworkStack:__subpackages__",
],
libs: [
"androidx.annotation_annotation",
"framework-connectivity.stubs.module_lib",
],
apex_available: [
"com.android.tethering",
"//apex_available:platform",
],
lint: { strict_updatability_linting: true },
}
java_library {
name: "net-utils-device-common-struct",
srcs: [
"device/com/android/net/module/util/HexDump.java",
"device/com/android/net/module/util/Ipv6Utils.java",
"device/com/android/net/module/util/PacketBuilder.java",
"device/com/android/net/module/util/Struct.java",
"device/com/android/net/module/util/structs/*.java",
],
sdk_version: "module_current",
min_sdk_version: "29",
visibility: [
"//frameworks/libs/net/common/testutils:__subpackages__",
"//packages/modules/Connectivity:__subpackages__",
"//packages/modules/NetworkStack:__subpackages__",
],
static_libs: [
"net-utils-framework-common",
],
libs: [
"androidx.annotation_annotation",
"framework-connectivity.stubs.module_lib",
],
apex_available: [
"com.android.tethering",
"//apex_available:platform",
],
lint: { strict_updatability_linting: true },
}
java_library {
name: "net-utils-device-common-netlink",
srcs: [
"device/com/android/net/module/util/netlink/*.java",
],
sdk_version: "module_current",
min_sdk_version: "29",
visibility: [
"//frameworks/libs/net/common/testutils:__subpackages__",
"//packages/modules/Connectivity:__subpackages__",
"//packages/modules/NetworkStack:__subpackages__",
],
static_libs: [
"net-utils-device-common-struct",
],
libs: [
"androidx.annotation_annotation",
"framework-connectivity.stubs.module_lib",
],
apex_available: [
"com.android.tethering",
"//apex_available:platform",
],
lint: { strict_updatability_linting: true },
}
Move static utils to the static library These classes used to live as a static utility in the NetworkStack module, but that's not the right place for them. The point of this patch is to *not* require topics, as any change in this space will very quickly spin out of control and become unmanageable. As such, this starts with creating equivalent classes in a single, easier to manage change. Followup changes will migrate users of the old classes to use these ones instead. Finally, the old classes can be removed. This way, work can be broken down into separate changes and be checked in little by little, rather than one huge topic with many changes doing everything in one go, which is unlikely to be manageable. There are no code changes from the originals, but a number of reorganizations, most of them unavoidable. • Vertical spacing (these classes fix it) • Package names/imports are adjusted • Added @hide on NetlinkMonitor • Move all contents of RouteUtils to NetdUtils, because all methods depend on INetd, and some of the targets do not/cannot depend on netd-client • Restrict the files used by the filegroup net-utils-framework-wifi-common-srcs, since that target does not necessarily provide all dependencies to all its users. • Don't move NetworkMonitorUtils, since it depends on SdkLevel, and net-utils-framework-common-srcs is using **/*.java. It would have been possible to list explicitly all files actually necessary in this filegroup, but NetworkMonitorUtils is actually only used by the networking modules and not the framework. Eventually it should move but it doesn't have to be in this patch, which is complicated enough as it is. • RouteUtils is now empty, because some new methods will be added to it soon and it is less expensive to keep it empty than to remove it now and add it again later. • Merge NetdUtils, and unify the constants. Some changes to satisfy checkstyle : • Remove unused imports • Reorder modifiers in InterfaceController • Remove {} in IpNetworkMonitor • Remove redundant public modifier in IpNetworkMonitor • Add javadoc to a few methods • Add whitespace around | in InterfaceParams However, don't rename members in IpNeighborMonitor like checkstyle would prefer because this would make migration to this more involved. Test: NetworkStaticLibsTests NetdStaticLibTests Change-Id: I439121cba5d7ea95aa4d6c80ea25207c316880a0
2021-10-07 15:29:13 +09:00
java_library {
// TODO : this target should probably be folded into net-utils-device-common
name: "net-utils-device-common-ip",
srcs: [
"device/com/android/net/module/util/ip/*.java",
],
sdk_version: "module_current",
min_sdk_version: "29",
visibility: [
"//frameworks/libs/net/common/tests:__subpackages__",
"//frameworks/libs/net/common/testutils:__subpackages__",
"//packages/modules/Connectivity:__subpackages__",
"//packages/modules/NetworkStack:__subpackages__",
],
libs: [
"framework-annotations-lib",
"framework-connectivity",
],
static_libs: [
"net-utils-device-common",
"net-utils-device-common-netlink",
"net-utils-framework-common",
"netd-client",
],
apex_available: [
"com.android.tethering",
"//apex_available:platform",
],
lint: { strict_updatability_linting: true },
Move static utils to the static library These classes used to live as a static utility in the NetworkStack module, but that's not the right place for them. The point of this patch is to *not* require topics, as any change in this space will very quickly spin out of control and become unmanageable. As such, this starts with creating equivalent classes in a single, easier to manage change. Followup changes will migrate users of the old classes to use these ones instead. Finally, the old classes can be removed. This way, work can be broken down into separate changes and be checked in little by little, rather than one huge topic with many changes doing everything in one go, which is unlikely to be manageable. There are no code changes from the originals, but a number of reorganizations, most of them unavoidable. • Vertical spacing (these classes fix it) • Package names/imports are adjusted • Added @hide on NetlinkMonitor • Move all contents of RouteUtils to NetdUtils, because all methods depend on INetd, and some of the targets do not/cannot depend on netd-client • Restrict the files used by the filegroup net-utils-framework-wifi-common-srcs, since that target does not necessarily provide all dependencies to all its users. • Don't move NetworkMonitorUtils, since it depends on SdkLevel, and net-utils-framework-common-srcs is using **/*.java. It would have been possible to list explicitly all files actually necessary in this filegroup, but NetworkMonitorUtils is actually only used by the networking modules and not the framework. Eventually it should move but it doesn't have to be in this patch, which is complicated enough as it is. • RouteUtils is now empty, because some new methods will be added to it soon and it is less expensive to keep it empty than to remove it now and add it again later. • Merge NetdUtils, and unify the constants. Some changes to satisfy checkstyle : • Remove unused imports • Reorder modifiers in InterfaceController • Remove {} in IpNetworkMonitor • Remove redundant public modifier in IpNetworkMonitor • Add javadoc to a few methods • Add whitespace around | in InterfaceParams However, don't rename members in IpNeighborMonitor like checkstyle would prefer because this would make migration to this more involved. Test: NetworkStaticLibsTests NetdStaticLibTests Change-Id: I439121cba5d7ea95aa4d6c80ea25207c316880a0
2021-10-07 15:29:13 +09:00
}
java_library {
name: "net-utils-framework-common",
srcs: [
":net-utils-framework-common-srcs",
],
sdk_version: "module_current",
libs: [
"framework-annotations-lib",
"framework-connectivity.stubs.module_lib",
"framework-connectivity-t.stubs.module_lib",
],
jarjar_rules: "jarjar-rules-shared.txt",
visibility: [
"//cts/tests/tests/net",
"//cts/tests/tests/wifi",
"//packages/modules/Connectivity/tests/cts/net",
"//frameworks/base/packages/Tethering",
"//packages/modules/Connectivity/Tethering",
"//frameworks/base/tests:__subpackages__",
"//frameworks/opt/net/ike",
"//frameworks/opt/telephony",
"//frameworks/base/wifi:__subpackages__",
"//frameworks/base/packages/Connectivity:__subpackages__",
"//packages/modules/Connectivity:__subpackages__",
"//packages/modules/NetworkStack:__subpackages__",
"//packages/modules/CaptivePortalLogin",
"//frameworks/libs/net/common/tests:__subpackages__",
"//frameworks/libs/net/common/device",
"//packages/modules/Wifi/framework/tests:__subpackages__",
"//packages/apps/Settings",
],
lint: { strict_updatability_linting: true },
}
java_library {
name: "net-utils-services-common",
srcs: [
"device/android/net/NetworkFactory.java",
"device/android/net/NetworkFactoryImpl.java",
"device/android/net/NetworkFactoryLegacyImpl.java",
"device/android/net/NetworkFactoryShim.java",
],
sdk_version: "module_current",
min_sdk_version: "30",
static_libs: [
"modules-utils-build_system",
],
libs: [
"framework-annotations-lib",
"framework-connectivity",
],
// TODO: remove "apex_available:platform".
apex_available: [
"//apex_available:platform",
"com.android.bluetooth",
"com.android.tethering",
"com.android.wifi",
],
visibility: [
// TODO: remove after NetworkStatsService moves to the module.
"//frameworks/base/services/net",
"//packages/modules/Connectivity/service",
"//packages/modules/Connectivity/tests:__subpackages__",
"//packages/modules/Bluetooth/android/app",
"//packages/modules/Wifi/service:__subpackages__",
],
lint: { strict_updatability_linting: true },
}
// Use a filegroup and not a library for telephony sources, as framework-annotations cannot be
// included either (some annotations would be duplicated on the bootclasspath).
filegroup {
name: "net-utils-telephony-common-srcs",
srcs: [
// Any class here *must* have a corresponding jarjar rule in the telephony build rules.
"device/android/net/NetworkFactory.java",
"device/android/net/NetworkFactoryImpl.java",
"device/android/net/NetworkFactoryLegacyImpl.java",
"device/android/net/NetworkFactoryShim.java",
],
path: "device",
visibility: [
"//frameworks/opt/telephony",
],
}
// Use a filegroup and not a library for wifi sources, as this needs corresponding jar-jar
// rules on the wifi side.
// Any class here *must* have a corresponding jarjar rule in the wifi build rules.
filegroup {
name: "net-utils-framework-wifi-common-srcs",
srcs: [
Move static utils to the static library These classes used to live as a static utility in the NetworkStack module, but that's not the right place for them. The point of this patch is to *not* require topics, as any change in this space will very quickly spin out of control and become unmanageable. As such, this starts with creating equivalent classes in a single, easier to manage change. Followup changes will migrate users of the old classes to use these ones instead. Finally, the old classes can be removed. This way, work can be broken down into separate changes and be checked in little by little, rather than one huge topic with many changes doing everything in one go, which is unlikely to be manageable. There are no code changes from the originals, but a number of reorganizations, most of them unavoidable. • Vertical spacing (these classes fix it) • Package names/imports are adjusted • Added @hide on NetlinkMonitor • Move all contents of RouteUtils to NetdUtils, because all methods depend on INetd, and some of the targets do not/cannot depend on netd-client • Restrict the files used by the filegroup net-utils-framework-wifi-common-srcs, since that target does not necessarily provide all dependencies to all its users. • Don't move NetworkMonitorUtils, since it depends on SdkLevel, and net-utils-framework-common-srcs is using **/*.java. It would have been possible to list explicitly all files actually necessary in this filegroup, but NetworkMonitorUtils is actually only used by the networking modules and not the framework. Eventually it should move but it doesn't have to be in this patch, which is complicated enough as it is. • RouteUtils is now empty, because some new methods will be added to it soon and it is less expensive to keep it empty than to remove it now and add it again later. • Merge NetdUtils, and unify the constants. Some changes to satisfy checkstyle : • Remove unused imports • Reorder modifiers in InterfaceController • Remove {} in IpNetworkMonitor • Remove redundant public modifier in IpNetworkMonitor • Add javadoc to a few methods • Add whitespace around | in InterfaceParams However, don't rename members in IpNeighborMonitor like checkstyle would prefer because this would make migration to this more involved. Test: NetworkStaticLibsTests NetdStaticLibTests Change-Id: I439121cba5d7ea95aa4d6c80ea25207c316880a0
2021-10-07 15:29:13 +09:00
"framework/com/android/net/module/util/DnsSdTxtRecord.java",
"framework/com/android/net/module/util/Inet4AddressUtils.java",
"framework/com/android/net/module/util/InetAddressUtils.java",
"framework/com/android/net/module/util/MacAddressUtils.java",
"framework/com/android/net/module/util/NetUtils.java",
],
path: "framework",
visibility: [
"//frameworks/base",
],
}
// Use a filegroup and not a library for wifi sources, as this needs corresponding jar-jar
// rules on the wifi side.
// Any class here *must* have a corresponding jarjar rule in the wifi build rules.
filegroup {
name: "net-utils-wifi-service-common-srcs",
srcs: [
"device/android/net/NetworkFactory.java",
"device/android/net/NetworkFactoryImpl.java",
"device/android/net/NetworkFactoryLegacyImpl.java",
"device/android/net/NetworkFactoryShim.java",
],
visibility: [
"//frameworks/opt/net/wifi/service",
"//packages/modules/Wifi/service",
],
}