2019-12-06 18:12:24 +08:00
|
|
|
// 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.
|
|
|
|
|
|
2020-01-03 20:35:55 +08:00
|
|
|
// 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.
|
2020-01-14 14:47:16 +09:00
|
|
|
// 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.
|
2019-12-06 18:12:24 +08:00
|
|
|
|
2020-03-27 00:30:41 +01:00
|
|
|
// 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.
|
|
|
|
|
|
2021-02-12 15:39:10 -08:00
|
|
|
package {
|
2024-01-31 11:08:57 +00:00
|
|
|
default_team: "trendy_team_fwk_core_networking",
|
2021-02-12 15:39:10 -08:00
|
|
|
default_applicable_licenses: ["Android-Apache-2.0"],
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-15 15:59:31 +00:00
|
|
|
// This library shouldn't be used anymore (no class should be added), and per-user libraries like
|
|
|
|
|
// net-utils-service-connectivity or net-utils-framework-wifi should be used instead.
|
2020-06-25 23:39:15 +09:00
|
|
|
java_library {
|
2024-01-31 11:08:57 +00:00
|
|
|
name: "net-utils-device-common",
|
|
|
|
|
srcs: [
|
|
|
|
|
"device/com/android/net/module/util/arp/ArpPacket.java",
|
|
|
|
|
"device/com/android/net/module/util/DeviceConfigUtils.java",
|
|
|
|
|
"device/com/android/net/module/util/DomainUtils.java",
|
|
|
|
|
"device/com/android/net/module/util/FdEventsReader.java",
|
2024-06-17 14:18:36 -07:00
|
|
|
"device/com/android/net/module/util/FeatureVersions.java",
|
|
|
|
|
"device/com/android/net/module/util/HandlerUtils.java",
|
2024-01-31 11:08:57 +00:00
|
|
|
"device/com/android/net/module/util/NetworkMonitorUtils.java",
|
|
|
|
|
"device/com/android/net/module/util/PacketReader.java",
|
|
|
|
|
"device/com/android/net/module/util/SharedLog.java",
|
|
|
|
|
"device/com/android/net/module/util/SocketUtils.java",
|
2024-06-17 14:18:36 -07:00
|
|
|
"device/com/android/net/module/util/SyncStateMachine.java",
|
2024-01-31 11:08:57 +00:00
|
|
|
// 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: "30",
|
|
|
|
|
target_sdk_version: "30",
|
|
|
|
|
apex_available: [
|
|
|
|
|
"//apex_available:anyapex",
|
|
|
|
|
"//apex_available:platform",
|
|
|
|
|
],
|
|
|
|
|
visibility: [
|
2021-05-21 04:26:52 +00:00
|
|
|
"//packages/modules/Connectivity:__subpackages__",
|
|
|
|
|
"//packages/modules/Connectivity/framework:__subpackages__",
|
2020-09-08 19:16:15 +09:00
|
|
|
"//packages/modules/NetworkStack:__subpackages__",
|
2020-06-25 23:39:15 +09:00
|
|
|
"//packages/modules/CaptivePortalLogin",
|
2024-01-31 11:08:57 +00:00
|
|
|
],
|
|
|
|
|
static_libs: [
|
2024-06-17 14:18:36 -07:00
|
|
|
"modules-utils-statemachine",
|
2024-01-31 11:08:57 +00:00
|
|
|
"net-utils-framework-common",
|
|
|
|
|
],
|
|
|
|
|
libs: [
|
|
|
|
|
"androidx.annotation_annotation",
|
|
|
|
|
"framework-annotations-lib",
|
2024-08-30 00:29:58 +00:00
|
|
|
"framework-configinfrastructure.stubs.module_lib",
|
2024-01-31 11:08:57 +00:00
|
|
|
"framework-connectivity.stubs.module_lib",
|
|
|
|
|
],
|
|
|
|
|
lint: {
|
|
|
|
|
strict_updatability_linting: true,
|
|
|
|
|
error_checks: ["NewApi"],
|
|
|
|
|
},
|
2020-06-25 23:39:15 +09:00
|
|
|
}
|
|
|
|
|
|
2025-04-10 15:55:30 -07:00
|
|
|
// Contains staticlibs classes for use by NetworkStack
|
|
|
|
|
java_library {
|
|
|
|
|
name: "net-utils-networkstack",
|
|
|
|
|
srcs: [
|
|
|
|
|
"device/com/android/net/module/util/ProcfsParsingUtils.java",
|
2025-05-01 10:47:02 -07:00
|
|
|
"device/com/android/net/module/util/dhcp6/*.java",
|
2025-06-11 23:46:57 +00:00
|
|
|
"device/com/android/net/module/util/CommonConnectivityJni.java",
|
|
|
|
|
"device/com/android/net/module/util/RealtimeScheduler.java",
|
|
|
|
|
"device/com/android/net/module/util/TimerFdUtils.java",
|
|
|
|
|
"device/com/android/net/module/util/JniUtil.java",
|
2025-04-10 15:55:30 -07:00
|
|
|
"framework/com/android/net/module/util/HexDump.java",
|
|
|
|
|
],
|
|
|
|
|
sdk_version: "module_current",
|
|
|
|
|
min_sdk_version: "30",
|
|
|
|
|
target_sdk_version: "30",
|
|
|
|
|
visibility: [
|
|
|
|
|
"//packages/modules/Connectivity/tests:__subpackages__",
|
|
|
|
|
"//packages/modules/NetworkStack:__subpackages__",
|
|
|
|
|
],
|
|
|
|
|
libs: [
|
|
|
|
|
"androidx.annotation_annotation",
|
|
|
|
|
"framework-annotations-lib",
|
|
|
|
|
"framework-connectivity.stubs.module_lib",
|
2025-05-01 10:47:02 -07:00
|
|
|
"net-utils-device-common-struct",
|
|
|
|
|
"net-utils-device-common-struct-base",
|
2025-04-10 15:55:30 -07:00
|
|
|
],
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-11 13:12:16 -07:00
|
|
|
java_library {
|
|
|
|
|
name: "net-utils-dnspacket-common",
|
|
|
|
|
srcs: [
|
2024-01-31 11:08:57 +00:00
|
|
|
"framework/**/DnsPacket.java",
|
|
|
|
|
"framework/**/DnsPacketUtils.java",
|
|
|
|
|
"framework/**/DnsSvcbPacket.java",
|
|
|
|
|
"framework/**/DnsSvcbRecord.java",
|
|
|
|
|
"framework/**/HexDump.java",
|
|
|
|
|
"framework/**/NetworkStackConstants.java",
|
2021-10-11 13:12:16 -07:00
|
|
|
],
|
|
|
|
|
sdk_version: "module_current",
|
|
|
|
|
visibility: [
|
|
|
|
|
"//packages/services/Iwlan:__subpackages__",
|
|
|
|
|
],
|
2022-09-15 07:34:51 +00:00
|
|
|
libs: [
|
2023-09-18 08:26:08 +00:00
|
|
|
"androidx.annotation_annotation",
|
2022-09-15 07:34:51 +00:00
|
|
|
"framework-annotations-lib",
|
|
|
|
|
"framework-connectivity.stubs.module_lib",
|
|
|
|
|
],
|
2021-10-11 13:12:16 -07:00
|
|
|
}
|
|
|
|
|
|
2019-12-06 18:12:24 +08:00
|
|
|
filegroup {
|
|
|
|
|
name: "net-utils-framework-common-srcs",
|
2020-06-25 23:39:15 +09:00
|
|
|
srcs: ["framework/**/*.java"],
|
|
|
|
|
path: "framework",
|
2021-03-24 22:40:37 +09:00
|
|
|
visibility: [
|
|
|
|
|
"//frameworks/base",
|
2021-05-22 13:16:30 +00:00
|
|
|
"//packages/modules/Connectivity:__subpackages__",
|
2021-03-24 22:40:37 +09:00
|
|
|
],
|
2019-12-06 18:12:24 +08:00
|
|
|
}
|
|
|
|
|
|
2024-03-12 21:23:19 +08:00
|
|
|
// The net-utils-device-common-bpf library requires the callers to contain
|
|
|
|
|
// net-utils-device-common-struct-base.
|
2021-07-01 13:57:02 +00:00
|
|
|
java_library {
|
2021-11-10 01:06:51 +08:00
|
|
|
name: "net-utils-device-common-bpf",
|
2021-07-01 13:57:02 +00:00
|
|
|
srcs: [
|
2022-02-15 15:21:43 -08:00
|
|
|
"device/com/android/net/module/util/BpfBitmap.java",
|
2022-06-23 21:34:54 +08:00
|
|
|
"device/com/android/net/module/util/BpfDump.java",
|
2021-10-19 11:01:46 -07:00
|
|
|
"device/com/android/net/module/util/BpfMap.java",
|
2022-02-15 15:30:50 -08:00
|
|
|
"device/com/android/net/module/util/BpfUtils.java",
|
2022-01-21 10:16:54 +08:00
|
|
|
"device/com/android/net/module/util/IBpfMap.java",
|
2021-11-10 01:06:51 +08:00
|
|
|
"device/com/android/net/module/util/JniUtil.java",
|
2024-06-02 13:24:21 +09:00
|
|
|
"device/com/android/net/module/util/SingleWriterBpfMap.java",
|
2022-01-12 21:42:24 +01:00
|
|
|
"device/com/android/net/module/util/TcUtils.java",
|
2021-11-10 01:06:51 +08:00
|
|
|
],
|
2022-01-25 19:08:12 +09:00
|
|
|
sdk_version: "module_current",
|
2023-09-19 23:17:10 +00:00
|
|
|
min_sdk_version: "30",
|
2021-11-10 01:06:51 +08:00
|
|
|
visibility: [
|
|
|
|
|
"//packages/modules/Connectivity:__subpackages__",
|
|
|
|
|
"//packages/modules/NetworkStack:__subpackages__",
|
|
|
|
|
],
|
|
|
|
|
libs: [
|
|
|
|
|
"androidx.annotation_annotation",
|
2022-01-25 19:08:12 +09:00
|
|
|
"framework-connectivity.stubs.module_lib",
|
2024-03-12 21:23:19 +08:00
|
|
|
"net-utils-device-common-struct-base",
|
2021-11-10 01:06:51 +08:00
|
|
|
],
|
|
|
|
|
apex_available: [
|
|
|
|
|
"com.android.tethering",
|
|
|
|
|
"//apex_available:platform",
|
|
|
|
|
],
|
2023-09-27 16:03:30 +09:00
|
|
|
lint: {
|
|
|
|
|
strict_updatability_linting: true,
|
|
|
|
|
error_checks: ["NewApi"],
|
|
|
|
|
},
|
2021-11-10 01:06:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
java_library {
|
2024-03-12 21:23:19 +08:00
|
|
|
name: "net-utils-device-common-struct-base",
|
2021-11-10 01:06:51 +08:00
|
|
|
srcs: [
|
2025-07-28 12:44:32 -07:00
|
|
|
"device/com/android/net/module/util/LegacyStruct.java",
|
2021-07-01 13:57:02 +00:00
|
|
|
"device/com/android/net/module/util/Struct.java",
|
|
|
|
|
],
|
2022-01-25 19:08:12 +09:00
|
|
|
sdk_version: "module_current",
|
2023-09-19 23:17:10 +00:00
|
|
|
min_sdk_version: "30",
|
2021-07-01 13:57:02 +00:00
|
|
|
visibility: [
|
|
|
|
|
"//packages/modules/Connectivity:__subpackages__",
|
|
|
|
|
"//packages/modules/NetworkStack:__subpackages__",
|
|
|
|
|
],
|
|
|
|
|
static_libs: [
|
|
|
|
|
"net-utils-framework-common",
|
|
|
|
|
],
|
|
|
|
|
libs: [
|
|
|
|
|
"androidx.annotation_annotation",
|
2024-03-12 21:23:19 +08:00
|
|
|
"framework-annotations-lib", // Required by InetAddressUtils.java
|
2022-01-25 19:08:12 +09:00
|
|
|
"framework-connectivity.stubs.module_lib",
|
2021-07-01 13:57:02 +00:00
|
|
|
],
|
|
|
|
|
apex_available: [
|
|
|
|
|
"com.android.tethering",
|
|
|
|
|
"//apex_available:platform",
|
|
|
|
|
],
|
2023-09-27 16:03:30 +09:00
|
|
|
lint: {
|
|
|
|
|
strict_updatability_linting: true,
|
|
|
|
|
error_checks: ["NewApi"],
|
|
|
|
|
},
|
2021-07-01 13:57:02 +00:00
|
|
|
}
|
|
|
|
|
|
2024-03-12 21:23:19 +08:00
|
|
|
// The net-utils-device-common-struct library requires the callers to contain
|
|
|
|
|
// net-utils-device-common-struct-base.
|
2024-02-19 10:37:26 +08:00
|
|
|
java_library {
|
2024-03-12 21:23:19 +08:00
|
|
|
name: "net-utils-device-common-struct",
|
2024-02-19 10:37:26 +08:00
|
|
|
srcs: [
|
2024-03-12 21:23:19 +08:00
|
|
|
"device/com/android/net/module/util/Ipv6Utils.java",
|
|
|
|
|
"device/com/android/net/module/util/PacketBuilder.java",
|
|
|
|
|
"device/com/android/net/module/util/structs/*.java",
|
2024-02-19 10:37:26 +08:00
|
|
|
],
|
|
|
|
|
sdk_version: "module_current",
|
|
|
|
|
min_sdk_version: "30",
|
|
|
|
|
visibility: [
|
|
|
|
|
"//packages/modules/Connectivity:__subpackages__",
|
2024-03-12 21:23:19 +08:00
|
|
|
"//packages/modules/NetworkStack:__subpackages__",
|
2024-02-19 10:37:26 +08:00
|
|
|
],
|
|
|
|
|
libs: [
|
2024-03-12 21:23:19 +08:00
|
|
|
"androidx.annotation_annotation",
|
|
|
|
|
"framework-annotations-lib", // Required by IpUtils.java
|
|
|
|
|
"framework-connectivity.stubs.module_lib",
|
|
|
|
|
"net-utils-device-common-struct-base",
|
2024-02-19 10:37:26 +08:00
|
|
|
],
|
|
|
|
|
apex_available: [
|
|
|
|
|
"com.android.tethering",
|
2024-03-12 21:23:19 +08:00
|
|
|
"//apex_available:platform",
|
2024-02-19 10:37:26 +08:00
|
|
|
],
|
|
|
|
|
lint: {
|
|
|
|
|
strict_updatability_linting: true,
|
|
|
|
|
error_checks: ["NewApi"],
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-28 18:49:44 +08:00
|
|
|
// The net-utils-device-common-netlink library requires the callers to contain
|
2024-03-12 21:23:19 +08:00
|
|
|
// net-utils-device-common-struct and net-utils-device-common-struct-base.
|
2021-11-10 01:06:51 +08:00
|
|
|
java_library {
|
|
|
|
|
name: "net-utils-device-common-netlink",
|
|
|
|
|
srcs: [
|
2023-11-20 18:51:30 +00:00
|
|
|
"device/com/android/net/module/util/netlink/**/*.java",
|
2021-11-10 01:06:51 +08:00
|
|
|
],
|
2022-01-25 19:08:12 +09:00
|
|
|
sdk_version: "module_current",
|
2023-09-19 23:17:10 +00:00
|
|
|
min_sdk_version: "30",
|
2021-11-10 01:06:51 +08:00
|
|
|
visibility: [
|
|
|
|
|
"//packages/modules/Connectivity:__subpackages__",
|
|
|
|
|
"//packages/modules/NetworkStack:__subpackages__",
|
|
|
|
|
],
|
|
|
|
|
libs: [
|
|
|
|
|
"androidx.annotation_annotation",
|
2022-01-25 19:08:12 +09:00
|
|
|
"framework-connectivity.stubs.module_lib",
|
2023-08-28 18:49:44 +08:00
|
|
|
// For libraries which are statically linked in framework-connectivity, do not
|
|
|
|
|
// statically link here because callers of this library might already have a static
|
|
|
|
|
// version linked.
|
|
|
|
|
"net-utils-device-common-struct",
|
2024-03-12 21:23:19 +08:00
|
|
|
"net-utils-device-common-struct-base",
|
2021-11-10 01:06:51 +08:00
|
|
|
],
|
2024-11-17 22:38:48 +00:00
|
|
|
static_libs: [
|
|
|
|
|
"netd_aidl_interface-lateststable-java",
|
|
|
|
|
],
|
2021-11-10 01:06:51 +08:00
|
|
|
apex_available: [
|
|
|
|
|
"com.android.tethering",
|
|
|
|
|
"//apex_available:platform",
|
|
|
|
|
],
|
2023-09-27 16:03:30 +09:00
|
|
|
lint: {
|
|
|
|
|
strict_updatability_linting: true,
|
|
|
|
|
error_checks: ["NewApi"],
|
|
|
|
|
},
|
2021-11-10 01:06:51 +08:00
|
|
|
}
|
|
|
|
|
|
2023-08-28 18:49:44 +08:00
|
|
|
// The net-utils-device-common-ip library requires the callers to contain
|
2024-03-12 21:23:19 +08:00
|
|
|
// net-utils-device-common-struct and net-utils-device-common-struct-base.
|
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",
|
2023-09-19 23:17:10 +00:00
|
|
|
min_sdk_version: "30",
|
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
|
|
|
visibility: [
|
|
|
|
|
"//packages/modules/Connectivity:__subpackages__",
|
|
|
|
|
"//packages/modules/NetworkStack:__subpackages__",
|
|
|
|
|
],
|
|
|
|
|
libs: [
|
|
|
|
|
"framework-annotations-lib",
|
2024-08-30 00:29:58 +00:00
|
|
|
"framework-connectivity.stubs.module_lib",
|
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
|
|
|
],
|
|
|
|
|
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",
|
|
|
|
|
],
|
2023-09-27 16:03:30 +09:00
|
|
|
lint: {
|
2024-06-13 09:29:47 +00:00
|
|
|
strict_updatability_linting: true,
|
2023-09-27 16:03:30 +09:00
|
|
|
error_checks: ["NewApi"],
|
|
|
|
|
},
|
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
|
|
|
}
|
|
|
|
|
|
2019-12-06 18:12:24 +08:00
|
|
|
java_library {
|
|
|
|
|
name: "net-utils-framework-common",
|
2020-01-14 21:42:09 +09:00
|
|
|
srcs: [
|
|
|
|
|
":net-utils-framework-common-srcs",
|
|
|
|
|
],
|
2022-01-25 19:08:12 +09:00
|
|
|
sdk_version: "module_current",
|
2023-09-19 23:17:10 +00:00
|
|
|
min_sdk_version: "30",
|
2022-01-25 19:08:12 +09:00
|
|
|
libs: [
|
2022-06-24 14:56:24 +09:00
|
|
|
"androidx.annotation_annotation",
|
2022-01-25 19:08:12 +09:00
|
|
|
"framework-annotations-lib",
|
|
|
|
|
"framework-connectivity.stubs.module_lib",
|
2022-02-14 15:28:50 +08:00
|
|
|
"framework-connectivity-t.stubs.module_lib",
|
2023-08-07 15:20:07 +00:00
|
|
|
"framework-location.stubs.module_lib",
|
2022-01-25 19:08:12 +09:00
|
|
|
],
|
2019-12-06 18:12:24 +08:00
|
|
|
jarjar_rules: "jarjar-rules-shared.txt",
|
|
|
|
|
visibility: [
|
2020-06-20 11:38:17 +08:00
|
|
|
"//cts/tests/tests/net",
|
2020-06-26 18:34:52 +09:00
|
|
|
"//cts/tests/tests/wifi",
|
2020-10-31 04:28:58 +00:00
|
|
|
"//packages/modules/Connectivity/tests/cts/net",
|
2020-10-29 02:12:06 +00:00
|
|
|
"//packages/modules/Connectivity/Tethering",
|
2020-10-15 18:06:30 +09:00
|
|
|
"//frameworks/base/tests:__subpackages__",
|
2019-12-06 18:12:24 +08:00
|
|
|
"//frameworks/opt/net/ike",
|
|
|
|
|
"//frameworks/opt/telephony",
|
2020-10-01 12:45:31 +09:00
|
|
|
"//frameworks/base/wifi:__subpackages__",
|
2020-11-10 18:04:27 +09:00
|
|
|
"//packages/modules/Connectivity:__subpackages__",
|
2020-06-25 23:39:15 +09:00
|
|
|
"//packages/modules/NetworkStack:__subpackages__",
|
2019-12-06 18:12:24 +08:00
|
|
|
"//packages/modules/CaptivePortalLogin",
|
2020-12-24 06:12:25 +00:00
|
|
|
"//packages/modules/Wifi/framework/tests:__subpackages__",
|
2022-01-10 10:31:11 +00:00
|
|
|
"//packages/apps/Settings",
|
2021-04-19 18:04:34 +09:00
|
|
|
],
|
2023-09-27 16:03:30 +09:00
|
|
|
lint: {
|
|
|
|
|
strict_updatability_linting: true,
|
|
|
|
|
error_checks: ["NewApi"],
|
|
|
|
|
},
|
2023-03-31 14:59:49 +08:00
|
|
|
errorprone: {
|
|
|
|
|
enabled: true,
|
|
|
|
|
// Error-prone checking only warns of problems when building. To make the build fail with
|
|
|
|
|
// these errors, list the specific error-prone problems below.
|
|
|
|
|
javacflags: [
|
|
|
|
|
"-Xep:NullablePrimitive:ERROR",
|
|
|
|
|
],
|
|
|
|
|
},
|
2023-12-21 20:46:31 +00:00
|
|
|
apex_available: [
|
|
|
|
|
"//apex_available:platform",
|
|
|
|
|
"com.android.tethering",
|
|
|
|
|
],
|
2019-12-06 18:12:24 +08:00
|
|
|
}
|
2022-05-30 12:01:49 +00:00
|
|
|
|
|
|
|
|
java_library {
|
|
|
|
|
name: "net-utils-services-common",
|
2020-10-26 14:51:01 -07:00
|
|
|
srcs: [
|
|
|
|
|
"device/android/net/NetworkFactory.java",
|
2021-04-19 18:04:34 +09:00
|
|
|
"device/android/net/NetworkFactoryImpl.java",
|
|
|
|
|
"device/android/net/NetworkFactoryLegacyImpl.java",
|
|
|
|
|
"device/android/net/NetworkFactoryShim.java",
|
2020-10-26 14:51:01 -07:00
|
|
|
],
|
2021-10-27 19:02:14 +09:00
|
|
|
sdk_version: "module_current",
|
2021-01-29 04:42:27 +00:00
|
|
|
min_sdk_version: "30",
|
2021-10-27 19:02:14 +09:00
|
|
|
libs: [
|
|
|
|
|
"framework-annotations-lib",
|
2024-08-30 00:29:58 +00:00
|
|
|
"framework-connectivity.stubs.module_lib",
|
2024-07-10 14:26:50 -07:00
|
|
|
"modules-utils-build_system",
|
2021-10-27 19:02:14 +09:00
|
|
|
],
|
2022-01-24 07:58:12 +00:00
|
|
|
// TODO: remove "apex_available:platform".
|
|
|
|
|
apex_available: [
|
|
|
|
|
"//apex_available:platform",
|
2025-01-09 12:25:16 -08:00
|
|
|
"com.android.bt",
|
2022-01-24 07:58:12 +00:00
|
|
|
"com.android.tethering",
|
2022-05-30 12:01:49 +00:00
|
|
|
"com.android.wifi",
|
2022-01-24 07:58:12 +00:00
|
|
|
],
|
2020-01-03 20:35:55 +08:00
|
|
|
visibility: [
|
2022-01-20 14:34:15 +08:00
|
|
|
// TODO: remove after NetworkStatsService moves to the module.
|
2020-01-15 18:26:29 +09:00
|
|
|
"//frameworks/base/services/net",
|
2022-01-24 07:58:12 +00:00
|
|
|
"//packages/modules/Connectivity/service",
|
2021-11-19 18:33:12 +09:00
|
|
|
"//packages/modules/Connectivity/tests:__subpackages__",
|
2022-02-03 18:53:23 -08:00
|
|
|
"//packages/modules/Bluetooth/android/app",
|
2022-06-01 21:28:32 +00:00
|
|
|
"//packages/modules/Wifi/service:__subpackages__",
|
2020-01-03 20:35:55 +08:00
|
|
|
],
|
2023-09-27 16:03:30 +09:00
|
|
|
lint: {
|
|
|
|
|
strict_updatability_linting: true,
|
|
|
|
|
error_checks: ["NewApi"],
|
|
|
|
|
},
|
2020-01-03 20:35:55 +08:00
|
|
|
}
|
2020-01-14 14:47:16 +09:00
|
|
|
|
2022-12-20 00:07:38 -08:00
|
|
|
java_library {
|
|
|
|
|
name: "net-utils-device-common-async",
|
|
|
|
|
srcs: [
|
|
|
|
|
"device/com/android/net/module/util/async/*.java",
|
|
|
|
|
],
|
|
|
|
|
sdk_version: "module_current",
|
2023-09-19 23:17:10 +00:00
|
|
|
min_sdk_version: "30",
|
2022-12-20 00:07:38 -08:00
|
|
|
visibility: [
|
|
|
|
|
"//packages/modules/Connectivity:__subpackages__",
|
|
|
|
|
],
|
|
|
|
|
libs: [
|
|
|
|
|
"framework-annotations-lib",
|
|
|
|
|
],
|
|
|
|
|
static_libs: [
|
|
|
|
|
],
|
|
|
|
|
apex_available: [
|
|
|
|
|
"com.android.tethering",
|
|
|
|
|
"//apex_available:platform",
|
|
|
|
|
],
|
2023-09-27 16:03:30 +09:00
|
|
|
lint: {
|
|
|
|
|
strict_updatability_linting: true,
|
|
|
|
|
error_checks: ["NewApi"],
|
|
|
|
|
},
|
2022-12-20 00:07:38 -08:00
|
|
|
}
|
|
|
|
|
|
2023-04-06 15:52:26 -07:00
|
|
|
java_library {
|
|
|
|
|
name: "net-utils-device-common-wear",
|
|
|
|
|
srcs: [
|
|
|
|
|
"device/com/android/net/module/util/wear/*.java",
|
|
|
|
|
],
|
|
|
|
|
sdk_version: "module_current",
|
2023-09-19 23:17:10 +00:00
|
|
|
min_sdk_version: "30",
|
2023-04-06 15:52:26 -07:00
|
|
|
visibility: [
|
|
|
|
|
"//packages/modules/Connectivity:__subpackages__",
|
|
|
|
|
],
|
|
|
|
|
libs: [
|
|
|
|
|
"framework-annotations-lib",
|
|
|
|
|
],
|
|
|
|
|
static_libs: [
|
|
|
|
|
"net-utils-device-common-async",
|
|
|
|
|
],
|
|
|
|
|
apex_available: [
|
|
|
|
|
"com.android.tethering",
|
|
|
|
|
"//apex_available:platform",
|
|
|
|
|
],
|
2023-09-27 16:03:30 +09:00
|
|
|
lint: {
|
|
|
|
|
strict_updatability_linting: true,
|
|
|
|
|
error_checks: ["NewApi"],
|
|
|
|
|
},
|
2023-04-06 15:52:26 -07:00
|
|
|
}
|
|
|
|
|
|
2023-03-29 16:51:09 +09:00
|
|
|
// Limited set of utilities for use by service-connectivity-mdns-standalone-build-test, to make sure
|
|
|
|
|
// the mDNS code can build with only system APIs.
|
|
|
|
|
// The mDNS code is platform code so it should use framework-annotations-lib, contrary to apps that
|
|
|
|
|
// should use sdk_version: "system_current" and only androidx.annotation_annotation. But this build
|
|
|
|
|
// rule verifies that the mDNS code can be built into apps, if code transformations are applied to
|
|
|
|
|
// the annotations.
|
|
|
|
|
// When using "system_current", framework annotations are not available; they would appear as
|
|
|
|
|
// package-private as they are marked as such in the system_current stubs. So build against
|
|
|
|
|
// core_platform and add the stubs manually in "libs". See http://b/147773144#comment7.
|
|
|
|
|
java_library {
|
|
|
|
|
name: "net-utils-device-common-mdns-standalone-build-test",
|
|
|
|
|
// Build against core_platform and add the stub libraries manually in "libs", as annotations
|
|
|
|
|
// are already included in android_system_stubs_current but package-private, so
|
|
|
|
|
// "framework-annotations-lib" needs to be manually included before
|
|
|
|
|
// "android_system_stubs_current" (b/272392042)
|
|
|
|
|
sdk_version: "core_platform",
|
|
|
|
|
srcs: [
|
|
|
|
|
"device/com/android/net/module/util/FdEventsReader.java",
|
2024-08-01 15:12:10 +00:00
|
|
|
"device/com/android/net/module/util/HandlerUtils.java",
|
2023-03-29 16:51:09 +09:00
|
|
|
"device/com/android/net/module/util/SharedLog.java",
|
|
|
|
|
"framework/com/android/net/module/util/ByteUtils.java",
|
|
|
|
|
"framework/com/android/net/module/util/CollectionUtils.java",
|
2024-07-16 18:48:43 +09:00
|
|
|
"framework/com/android/net/module/util/DnsUtils.java",
|
2023-05-02 18:44:51 +09:00
|
|
|
"framework/com/android/net/module/util/HexDump.java",
|
2023-03-29 16:51:09 +09:00
|
|
|
"framework/com/android/net/module/util/LinkPropertiesUtils.java",
|
|
|
|
|
],
|
|
|
|
|
libs: [
|
|
|
|
|
"framework-annotations-lib",
|
|
|
|
|
"android_system_stubs_current",
|
|
|
|
|
"androidx.annotation_annotation",
|
|
|
|
|
],
|
|
|
|
|
visibility: ["//packages/modules/Connectivity/service-t"],
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-08 15:36:48 +00:00
|
|
|
// net-utils-framework-connectivity is only for framework-connectivity.
|
2024-07-02 13:17:43 +00:00
|
|
|
java_library {
|
|
|
|
|
name: "net-utils-framework-connectivity",
|
|
|
|
|
srcs: [
|
|
|
|
|
":net-utils-framework-connectivity-srcs",
|
|
|
|
|
],
|
|
|
|
|
sdk_version: "module_current",
|
|
|
|
|
min_sdk_version: "30",
|
|
|
|
|
apex_available: [
|
|
|
|
|
"com.android.tethering",
|
|
|
|
|
"//apex_available:platform",
|
|
|
|
|
],
|
|
|
|
|
visibility: [
|
2024-08-08 15:36:48 +00:00
|
|
|
"//packages/modules/Connectivity/framework",
|
2024-07-02 13:17:43 +00:00
|
|
|
],
|
|
|
|
|
libs: [
|
|
|
|
|
"androidx.annotation_annotation",
|
|
|
|
|
"framework-annotations-lib",
|
2024-08-30 00:29:58 +00:00
|
|
|
"framework-configinfrastructure.stubs.module_lib",
|
2024-07-02 13:17:43 +00:00
|
|
|
"framework-connectivity.stubs.module_lib",
|
|
|
|
|
],
|
2025-04-22 16:01:52 +00:00
|
|
|
static_libs: [
|
|
|
|
|
"net-utils-framework-common",
|
|
|
|
|
],
|
2024-07-02 13:17:43 +00:00
|
|
|
lint: {
|
|
|
|
|
strict_updatability_linting: true,
|
|
|
|
|
error_checks: ["NewApi"],
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
java_defaults {
|
|
|
|
|
name: "net-utils-non-bootclasspath-defaults",
|
|
|
|
|
sdk_version: "module_current",
|
|
|
|
|
min_sdk_version: "30",
|
|
|
|
|
libs: [
|
|
|
|
|
"androidx.annotation_annotation",
|
|
|
|
|
"framework-annotations-lib",
|
2024-08-30 00:29:58 +00:00
|
|
|
"framework-configinfrastructure.stubs.module_lib",
|
2024-07-02 13:17:43 +00:00
|
|
|
"framework-connectivity.stubs.module_lib",
|
|
|
|
|
"framework-connectivity-t.stubs.module_lib",
|
|
|
|
|
"framework-location.stubs.module_lib",
|
2024-08-30 00:29:58 +00:00
|
|
|
"framework-tethering.stubs.module_lib",
|
2024-07-02 13:17:43 +00:00
|
|
|
"unsupportedappusage",
|
|
|
|
|
],
|
|
|
|
|
static_libs: [
|
|
|
|
|
"modules-utils-build_system",
|
|
|
|
|
"modules-utils-statemachine",
|
|
|
|
|
"net-utils-non-bootclasspath-aidl-java",
|
|
|
|
|
"netd-client",
|
|
|
|
|
],
|
|
|
|
|
apex_available: [
|
|
|
|
|
"com.android.tethering",
|
|
|
|
|
"//apex_available:platform",
|
|
|
|
|
],
|
|
|
|
|
defaults_visibility: [
|
|
|
|
|
"//visibility:private",
|
|
|
|
|
],
|
|
|
|
|
lint: {
|
|
|
|
|
strict_updatability_linting: true,
|
|
|
|
|
error_checks: ["NewApi"],
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-08 15:36:48 +00:00
|
|
|
// net-utils-service-connectivity is only for service-connectivity.
|
2024-07-02 13:17:43 +00:00
|
|
|
java_library {
|
|
|
|
|
name: "net-utils-service-connectivity",
|
|
|
|
|
srcs: [
|
|
|
|
|
":net-utils-all-srcs",
|
|
|
|
|
],
|
|
|
|
|
exclude_srcs: [
|
|
|
|
|
":net-utils-framework-connectivity-srcs",
|
|
|
|
|
],
|
|
|
|
|
libs: [
|
|
|
|
|
"net-utils-framework-connectivity",
|
2024-08-30 00:29:58 +00:00
|
|
|
"framework-connectivity.impl",
|
|
|
|
|
"framework-tethering.impl",
|
2024-07-02 13:17:43 +00:00
|
|
|
],
|
|
|
|
|
defaults: ["net-utils-non-bootclasspath-defaults"],
|
2024-07-12 16:49:52 +00:00
|
|
|
jarjar_rules: "jarjar-rules-shared.txt",
|
2024-08-08 15:36:48 +00:00
|
|
|
visibility: [
|
|
|
|
|
"//packages/modules/Connectivity/service",
|
|
|
|
|
"//packages/modules/Connectivity/staticlibs/tests/unit",
|
|
|
|
|
],
|
2024-07-02 13:17:43 +00:00
|
|
|
}
|
|
|
|
|
|
2024-08-15 08:07:02 +00:00
|
|
|
// net-utils-connectivity-apks is only for NetworkStack, CaptivePortalLogin and
|
|
|
|
|
// Tethering.apk
|
|
|
|
|
// It includes all the static libraries in this directory, which is safe because
|
|
|
|
|
// these APKs use R8 to strip out unused code, and they do not depend on
|
|
|
|
|
// bootclasspath jars that may have duplicate copies of the included classes
|
|
|
|
|
// with the same jarjaring.
|
|
|
|
|
// Tethering.apk does depend on a bootclasspath jar (framework-tethering.jar),
|
|
|
|
|
// however it does not use any of the static libraries. If it did, Tethering.apk
|
|
|
|
|
// would need to use another variant that excludes classes that are already
|
|
|
|
|
// included in framework-tethering.jar (similarly to how framework-connectivity
|
|
|
|
|
// and service-connectivity do it). Otherwise, static libs included in
|
|
|
|
|
// framework-tethering and Tethering.apk and jarjared the same way would
|
|
|
|
|
// conflict.
|
2024-07-02 13:17:43 +00:00
|
|
|
java_library {
|
2024-07-26 13:07:50 +09:00
|
|
|
name: "net-utils-connectivity-apks",
|
2024-07-02 13:17:43 +00:00
|
|
|
srcs: [
|
|
|
|
|
":net-utils-all-srcs",
|
|
|
|
|
":framework-connectivity-shared-srcs",
|
|
|
|
|
],
|
|
|
|
|
defaults: ["net-utils-non-bootclasspath-defaults"],
|
2024-07-12 16:49:52 +00:00
|
|
|
jarjar_rules: "jarjar-rules-shared.txt",
|
2024-08-08 15:36:48 +00:00
|
|
|
visibility: [
|
|
|
|
|
"//packages/modules/CaptivePortalLogin:__subpackages__",
|
|
|
|
|
"//packages/modules/Connectivity/Tethering",
|
|
|
|
|
],
|
2024-07-02 13:17:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
aidl_interface {
|
|
|
|
|
name: "net-utils-non-bootclasspath-aidl",
|
|
|
|
|
srcs: [
|
|
|
|
|
":net-utils-aidl-srcs",
|
|
|
|
|
],
|
|
|
|
|
unstable: true,
|
|
|
|
|
backend: {
|
|
|
|
|
java: {
|
|
|
|
|
enabled: true,
|
|
|
|
|
min_sdk_version: "30",
|
|
|
|
|
apex_available: [
|
|
|
|
|
"com.android.tethering",
|
2024-07-12 16:49:52 +00:00
|
|
|
"com.android.wifi",
|
2024-08-05 14:24:26 +09:00
|
|
|
"//apex_available:platform",
|
2024-07-02 13:17:43 +00:00
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
cpp: {
|
|
|
|
|
enabled: false,
|
|
|
|
|
},
|
|
|
|
|
ndk: {
|
|
|
|
|
enabled: false,
|
|
|
|
|
},
|
|
|
|
|
rust: {
|
|
|
|
|
enabled: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
include_dirs: [
|
|
|
|
|
"packages/modules/Connectivity/framework/aidl-export",
|
|
|
|
|
],
|
|
|
|
|
visibility: [
|
|
|
|
|
"//system/tools/aidl/build",
|
|
|
|
|
],
|
2025-08-06 15:21:50 +09:00
|
|
|
imports: [
|
2025-07-02 17:45:00 +00:00
|
|
|
"netd_aidl_interface-V18", // For RouteInfoParcel.
|
2025-08-06 15:21:50 +09:00
|
|
|
],
|
2024-07-02 13:17:43 +00:00
|
|
|
}
|
|
|
|
|
|
2020-01-14 14:47:16 +09:00
|
|
|
// 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.
|
2020-06-25 23:39:15 +09:00
|
|
|
"device/android/net/NetworkFactory.java",
|
2021-04-19 18:04:34 +09:00
|
|
|
"device/android/net/NetworkFactoryImpl.java",
|
|
|
|
|
"device/android/net/NetworkFactoryLegacyImpl.java",
|
|
|
|
|
"device/android/net/NetworkFactoryShim.java",
|
2020-01-14 14:47:16 +09:00
|
|
|
],
|
2020-06-25 23:39:15 +09:00
|
|
|
path: "device",
|
2020-01-14 14:47:16 +09:00
|
|
|
visibility: [
|
|
|
|
|
"//frameworks/opt/telephony",
|
|
|
|
|
],
|
|
|
|
|
}
|
2020-01-16 09:19:11 -08:00
|
|
|
|
2024-07-12 16:49:52 +00:00
|
|
|
// Filegroup to build lib used by Wifi framework
|
2020-01-16 09:19:11 -08:00
|
|
|
// 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",
|
2020-01-16 09:19:11 -08:00
|
|
|
],
|
2020-06-25 23:39:15 +09:00
|
|
|
path: "framework",
|
2024-07-12 16:49:52 +00:00
|
|
|
visibility: ["//visibility:private"],
|
2020-01-16 09:19:11 -08:00
|
|
|
}
|
2024-07-02 13:17:43 +00:00
|
|
|
|
2024-10-01 15:07:51 -07:00
|
|
|
// Filegroup to build lib used by IPsec/IKE framework
|
|
|
|
|
// Any class here *must* have a corresponding jarjar rule in the IPsec build rules.
|
|
|
|
|
filegroup {
|
|
|
|
|
name: "net-utils-framework-ipsec-common-srcs",
|
|
|
|
|
srcs: [
|
|
|
|
|
"framework/com/android/net/module/util/HexDump.java",
|
|
|
|
|
],
|
|
|
|
|
path: "framework",
|
|
|
|
|
visibility: ["//visibility:private"],
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
java_library {
|
|
|
|
|
name: "net-utils-framework-ipsec",
|
|
|
|
|
sdk_version: "module_current",
|
|
|
|
|
min_sdk_version: "30",
|
|
|
|
|
srcs: [":net-utils-framework-ipsec-common-srcs"],
|
|
|
|
|
libs: [
|
|
|
|
|
"androidx.annotation_annotation",
|
|
|
|
|
],
|
|
|
|
|
visibility: [
|
|
|
|
|
"//packages/modules/IPsec",
|
|
|
|
|
],
|
|
|
|
|
apex_available: ["com.android.ipsec"],
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-02 13:17:43 +00:00
|
|
|
// Use a file group containing classes necessary for framework-connectivity. The file group should
|
|
|
|
|
// be as small as possible because because the classes end up in the bootclasspath and R8 is not
|
|
|
|
|
// used to remove unused classes.
|
|
|
|
|
filegroup {
|
|
|
|
|
name: "net-utils-framework-connectivity-srcs",
|
|
|
|
|
srcs: [
|
|
|
|
|
"device/com/android/net/module/util/BpfBitmap.java",
|
|
|
|
|
"device/com/android/net/module/util/BpfDump.java",
|
|
|
|
|
"device/com/android/net/module/util/BpfMap.java",
|
|
|
|
|
"device/com/android/net/module/util/BpfUtils.java",
|
|
|
|
|
"device/com/android/net/module/util/IBpfMap.java",
|
|
|
|
|
"device/com/android/net/module/util/JniUtil.java",
|
2025-07-28 12:44:32 -07:00
|
|
|
"device/com/android/net/module/util/LegacyStruct.java",
|
2024-07-02 13:17:43 +00:00
|
|
|
"device/com/android/net/module/util/SingleWriterBpfMap.java",
|
|
|
|
|
"device/com/android/net/module/util/Struct.java",
|
|
|
|
|
"device/com/android/net/module/util/TcUtils.java",
|
|
|
|
|
"framework/com/android/net/module/util/HexDump.java",
|
|
|
|
|
],
|
|
|
|
|
visibility: ["//visibility:private"],
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-01 09:25:28 +00:00
|
|
|
// Sources outside of com.android.net.module.util should not be added because many modules depend on
|
|
|
|
|
// them and need jarjar rules
|
2024-07-02 13:17:43 +00:00
|
|
|
filegroup {
|
|
|
|
|
name: "net-utils-all-srcs",
|
|
|
|
|
srcs: [
|
|
|
|
|
"device/**/*.java",
|
|
|
|
|
":net-utils-framework-common-srcs",
|
|
|
|
|
],
|
|
|
|
|
visibility: ["//visibility:private"],
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
filegroup {
|
|
|
|
|
name: "net-utils-aidl-srcs",
|
|
|
|
|
srcs: [
|
|
|
|
|
"device/**/*.aidl",
|
|
|
|
|
],
|
|
|
|
|
path: "device",
|
|
|
|
|
visibility: ["//visibility:private"],
|
|
|
|
|
}
|
2024-07-12 16:49:52 +00:00
|
|
|
|
|
|
|
|
java_library {
|
|
|
|
|
name: "net-utils-service-wifi",
|
|
|
|
|
srcs: [
|
|
|
|
|
":net-utils-all-srcs",
|
|
|
|
|
],
|
|
|
|
|
exclude_srcs: [":net-utils-framework-wifi-common-srcs"],
|
|
|
|
|
libs: [
|
|
|
|
|
"net-utils-framework-wifi",
|
|
|
|
|
],
|
|
|
|
|
defaults: ["net-utils-non-bootclasspath-defaults"],
|
|
|
|
|
|
|
|
|
|
visibility: [
|
|
|
|
|
"//packages/modules/Wifi/service",
|
|
|
|
|
],
|
|
|
|
|
apex_available: [
|
|
|
|
|
"com.android.wifi",
|
|
|
|
|
],
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
java_library {
|
|
|
|
|
name: "net-utils-framework-wifi",
|
|
|
|
|
sdk_version: "module_current",
|
|
|
|
|
min_sdk_version: "30",
|
|
|
|
|
srcs: [":net-utils-framework-wifi-common-srcs"],
|
|
|
|
|
libs: [
|
|
|
|
|
"framework-annotations-lib",
|
|
|
|
|
"framework-connectivity.stubs.module_lib",
|
|
|
|
|
"unsupportedappusage",
|
|
|
|
|
],
|
|
|
|
|
visibility: [
|
|
|
|
|
"//packages/modules/Wifi/framework",
|
|
|
|
|
],
|
|
|
|
|
apex_available: ["com.android.wifi"],
|
|
|
|
|
}
|
2024-11-08 11:51:07 +09:00
|
|
|
|
|
|
|
|
genrule {
|
|
|
|
|
name: "statslog-framework-connectivity-java-gen",
|
|
|
|
|
tools: ["stats-log-api-gen"],
|
|
|
|
|
cmd: "$(location stats-log-api-gen) --java $(out) --module connectivity --javaPackage com.android.net.module.util --javaClass FrameworkConnectivityStatsLog",
|
|
|
|
|
out: ["com/android/net/module/util/FrameworkConnectivityStatsLog.java"],
|
|
|
|
|
}
|
2024-10-02 22:38:10 +00:00
|
|
|
|
|
|
|
|
java_library {
|
|
|
|
|
name: "net-utils-service-vcn",
|
|
|
|
|
sdk_version: "module_current",
|
|
|
|
|
min_sdk_version: "30",
|
|
|
|
|
srcs: [
|
|
|
|
|
"device/com/android/net/module/util/HandlerUtils.java",
|
|
|
|
|
],
|
|
|
|
|
libs: [
|
|
|
|
|
"framework-annotations-lib",
|
|
|
|
|
],
|
|
|
|
|
visibility: [
|
|
|
|
|
// TODO: b/374174952 Remove it when VCN modularization is released
|
|
|
|
|
"//frameworks/base/packages/Vcn/service-b",
|
2025-07-09 01:17:17 +00:00
|
|
|
"//packages/modules/Connectivity/Vcn/service-b",
|
2024-10-02 22:38:10 +00:00
|
|
|
|
|
|
|
|
"//packages/modules/Connectivity/service-b",
|
|
|
|
|
],
|
|
|
|
|
apex_available: [
|
|
|
|
|
// TODO: b/374174952 Remove it when VCN modularization is released
|
|
|
|
|
"//apex_available:platform",
|
|
|
|
|
|
|
|
|
|
"com.android.tethering",
|
|
|
|
|
],
|
|
|
|
|
}
|
2025-07-09 01:19:40 +00:00
|
|
|
|
|
|
|
|
java_library {
|
|
|
|
|
name: "net-utils-framework-vcn",
|
|
|
|
|
sdk_version: "module_current",
|
|
|
|
|
min_sdk_version: "30",
|
|
|
|
|
srcs: [
|
|
|
|
|
"framework/com/android/net/module/util/HexDump.java",
|
|
|
|
|
],
|
|
|
|
|
libs: [
|
|
|
|
|
"androidx.annotation_annotation",
|
|
|
|
|
],
|
|
|
|
|
visibility: [
|
|
|
|
|
// TODO: b/374174952 Clean up the paths when the VCN
|
|
|
|
|
// code location is finalized
|
|
|
|
|
"//frameworks/base/packages/Vcn/framework-b",
|
|
|
|
|
"//packages/modules/Connectivity/Vcn/framework-b",
|
|
|
|
|
"//packages/modules/Connectivity/framework-b",
|
|
|
|
|
],
|
|
|
|
|
}
|