Commit graph android_packages_modules_Co.../staticlibs/Android.bp
Message SHA1
Make callers of RoutingCoordinatorService pass in RouteInfoParcel
RoutingCoordinatorService's {add,remove,update}Route methods
all end up calling netd's *RouteParcel methods.

Make callers explicitly generate and pass in the parcel to the
manager class instead of having them pass in a RouteInfo and
having the service class convert the RouteInfo to a parcel.

Also remove the {add,remove,update}Route methods from
RoutingCoordinatorManager since they are unused.

This is a no-op refactor that simplifies upcoming changes.

RoutingCoordinator is not a stable interface and is not used
across the platform/mainline boundary, so there are no version
skew considerations.

Bug: 394308861
Test: atest ConnectivityCoverageTests
Flag: EXEMPT no-op refactor
Change-Id: Iedf4c9bc28c3fc8c289db421857acddc8c694990

Lorenzo Colitti   commited 2025-08-06 15:57:36 +09:00
8f8e59abf7
Introduce LegacyStruct to expose writeToBytes(ByteOrder)
The ByteOrder should be encoded by the field, not by the writeToBytes()
method. To fix this, a LegacyStruct is introduced which continues to
expose writeToBytes(ByteOrder) during the transition. This approach
helpfully creates a compile error when converting a Struct class back to
inheriting from Struct for all call sites of writeToBytes(ByteOrder).

Test: TH
Flag: EXEMPT mainline
Change-Id: I3b28c53ce3e884e59760744838b3518596de5c75

Patrick Rohr   commited 2025-07-28 15:58:48 -07:00
62d51d1bcd
Create CommonConnectivityJni to share between modules
Flag: EXEMPT mainline
Test: TH
Change-Id: Ia85dfd3d979803baca9e971d1083f54dff46de53

Jimi Chen   commited 2025-07-23 05:47:12 +00:00
e5a4e6b0ba
Prepare to move VCN: Define utility lib for framework VCN
This is a preparation CL before moving VCN code from frameworks/base
to p/m/Connectivity/

This CL defines a utility lib so that the VCN framework code can
use HexDump. With HexDump, VCN will define another lib for the IPsec
module.

Bug: 379938062
Flag: EXEMPT; pure refactoring
Test: FrameworksIkeTests, CtsIkeTestCases
Change-Id: I9bc8b37779315841c2a93328942d073b6bf40808

Yan Yan   commited 2025-07-10 20:46:41 +00:00
aa2f53143e
Prepare to move VCN: Add visibilities
Before moving VCN code, add the new code locations to the
"visibility" fields of Connectivity dependencies.

Bug: 379938062
Flag: EXEMPT; visibility changes
Test: presubmit
Change-Id: I904c601de2b17a9c0460eebde90622963f233567

Yan Yan   commited 2025-07-10 01:26:14 +00:00
7c75e441a0
Add socket destroying methods to InetDiagMessage.
Add socket destroying methods by address and permission to InetDiagMessage
to move that functions to ConnectivityService from Netd.

Bug: 373280981
Bug: 331139818
Flag: android.net.platform.flags.connectivity_service_destroy_socket
Test: atest NetworkStaticLibTests
Test: device test
Change-Id: I3c2136df5dfd618d1c757c07bce2b4211b807237

Sewook Seo   commited 2025-05-27 01:35:49 +00:00
45163857b2
Add Dhcp6*Packet classes to net-utils-networkstack
Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: Ica554c27a648095a23331a9d93cc6bbbcf572cec

Patrick Rohr   commited 2025-05-01 11:16:41 -07:00
f5e80bfb70
Adding IpAddress Struct type to store ip v4 and v6 addresses.
IPv4 addresses will be converted as v4-mapped-v6 address while
writting it to byte form. v4-mapped-v6 addresses in byte form will be
parsed to Inet4Address while converting it back.

Bug: 392509494
Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.StructTest
Flag: EXEMPT refactor
Change-Id: Ia906d2cae7bb7402ff937da267c2552431b2d0f7

Sarup Dalwani   commited 2025-04-30 07:42:25 -07:00
746540b874
Move ProcfsParsingUtils to staticlibs
net-utils-device-common says:

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.

Therefore, this patch adds a new net-utils-networkstack.

Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I8073ea019a9c306ce75424303e8a30bb39580b29

Patrick Rohr   commited 2025-04-11 15:11:33 -07:00
259c0b4f66
Merge changes I0b3ac7b4,I90385146 into main
* changes:
  Add Abstract Class for RealtimeScheduler
  Implement RealtimeScheduler in DiscoveryExecutor

Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-16 09:27:17 -07:00
7d1b5b56ce
Add Abstract Class for RealtimeScheduler
Because some APIs in RealtimeScheduler are higher than the min
SDK version for the standalone MDNS build, an abstract class is
required to allow the standalone MDNS build to pass.

Bug: 366373064
Test: atest FrameworksNetTests NsdManagerTest
      m service-connectivity-mdns-standalone-build-test
Change-Id: I0b3ac7b4f8dfceeb3dd81e6a5f368b5d57927c41

Paul Hu   commited 2025-03-16 14:46:14 +00:00
b84bb3b448
Merge "Use non-extended mockito for net-tests-utils" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2025-03-11 19:00:20 -07:00
ec2a5cc5c5
Use non-extended mockito for net-tests-utils
Mockito extended tends to cause all kinds of issues due to the way it
injects itself into the bytecode of framework classes instead of
creating subclasses.

Use non-extended mockito as it is not actually necessary for current
tests.

Test: atest
Change-Id: Id2874309cce2778c4405b852df9a3ae816c4abcb

Remi NGUYEN VAN   commited 2025-03-10 17:59:19 +09:00
05c376a4c5
Revert^2 "Use timerfd to improve the accuracy of query timing"
This reverts commit a481dc184f.

Reason for revert: Update this change to ensure proper closure of the timerfd object.

Change-Id: I14530ba77a39c77b4c7af6855ec77ba4907ab9f9

Paul Hu   commited 2025-03-06 15:13:12 +00:00
a3a34058fe
Modify apex_available to Bluetooth apex
Bluetooth apex name has changed from com.android.btservices to
com.android.bt. We now need to update the reference in the code.

Bug: 383863941
Flag: Exempt build infra
Test: m .
Change-Id: I92167eb785858565d28b1e72b3b98150378975a6

William Escande   commited 2025-01-09 12:25:16 -08:00
b82afa32e0
Revert "Use timerfd to improve the accuracy of query timing"
This reverts commit 3d51a99dc8.

Reason for revert: Does not close the timerfd object properly, which may cause a memory leak.

Change-Id: I25d7da13591696c9dfda60ee0fdd2574dbcdf337

Paul Hu   commited 2024-12-24 09:18:06 +00:00
a481dc184f
Merge "Use timerfd to improve the accuracy of query timing" into main
Paul Hu   authored and   Gerrit Code Review   commited 2024-12-13 00:16:21 -08:00
69ce1b9f15
Use timerfd to improve the accuracy of query timing
Timerfd can provide more accurate delayed callbacks than
Handler#postDelayed because it accounts for the time the device
spends in deep sleep. Using timerfd allows for more precise query
timing, which reduces the possibility of TTL expiration caused
by inaccurate delayed callbacks.

Bug: 366373064
Test: atest FrameworksNetTests NsdManagerTest
Change-Id: I980ec8fd43f63976ef5387bb57c7ed70a1b68d82

Paul Hu   commited 2024-12-12 02:57:00 +00:00
3d51a99dc8
Merge "Expose Connectivity libraries to VCN and tests" into main
Yan Yan   authored and   Gerrit Code Review   commited 2024-11-27 00:34:33 +00:00
e0e0636fa9
Merge "Create the timerfd helper class" into main
Paul Hu   authored and   Gerrit Code Review   commited 2024-11-26 08:23:21 +00:00
38bbfa8c82
Expose Connectivity libraries to VCN and tests
This patch exposes Connectivity libraries to allow migrating VCN to
its own non-updatable framework and service libraries. It also
creates a utility library for VCN.

Bug: 369703242
Test: atest FrameworksVcnTests && atest CtsVcnTestCases
Flag: EXEMPT no functional change
Change-Id: I1981f1cc824dcf426a76a0af8e4e3460fccb754e

Yan Yan   commited 2024-11-23 23:07:44 -08:00
587f996eb4
Create the timerfd helper class
Create a helper class in Java to provide easy access to timerfd
JNI methods.

Bug: 366373064
Test: atest NetworkStaticLibTests
Change-Id: Iea09cd29e2a6ed837ece30c512393be2e27e8c2e

Paul Hu   commited 2024-11-22 07:12:55 +00:00
8c8d2b1bd8
Add FrameworkConnectivityStatsLog for logging metrics
Introduced FrameworkConnectivityStatsLog within the
framework-connectivity module. This enables logging of metrics, such as
terrible error events, from components residing in the bootclasspath.

Test: manual
Change-Id: I478d957b06721b35135a45dbbcda72a2c3e9f9ce

Yuyang Huang   commited 2024-11-21 11:51:58 +00:00
1cc7769bbe
Remove framework-connectivity-shared-srcs from net-utils-all-srcs
Having framework-connectivity-shared-srcs in net-utils-all-srcs is risky because it's also adds classes to other modules like WiFi.

Bug: 376587883
Change-Id: I829cc6f1e9865e6a5fc23ddcfa8d6f45aac27e06

Handa Wang   commited 2024-11-01 09:25:28 +00:00
e12dfea4f0
Create net-utils-framework-ipsec for IPsec module
Allow IPsec to use com.android.net.module.util.HexDump

Bug: 369703242
Test: atest FrameworksIkeTests && atest CtsIkeTestCases
Flag: EXEMPT pure refactoring
Change-Id: Iab261ac1851ad43b0359f467768b7374afc6629f

Yan Yan   commited 2024-10-21 17:51:26 +00:00
61f779ca04
Merge changes from topic "refactor-pac" into main
* changes:
  Update unit tests to reflect the changes to RoutingCoordinator and PrivateAddressCoordinator
  Move PrivateAddressCoordinator from Tethering to staticlibs
  Refator IpServer to allocate IPv4 address via RoutingCoordinatorManager API
  Introduce PrivateAddressCoordinator methods at RoutingCoordinatorManager

Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-17 01:28:02 +00:00
e2a031b159
Move PrivateAddressCoordinator from Tethering to staticlibs
This CL moves PrivateAddressCoordinator from Tethering to staticlibs
so that RoutingCooridnatorService can create an instance of
PrivateAddressCoordinator.

Bug: 350699020

Change-Id: I13ccd515972243719465c1c9ab844f802bc8884b

Handa Wang   commited 2024-10-16 23:54:29 +00:00
69aee7b055
Ensure the dump service is completed
If dumping MdnsDiscoveryManager is not executed on the handler
thread, it may not complete in time because the dump task is
performed on the handler thread. Therefore, use
HandlerUtils#runWithScissorsForDump to ensure the dump service
is completed.

Test: dumpsys servicediscovery
Change-Id: Ifbb972fe7a83677b7cdcc97bb6c5c099ce56bb8f

Paul Hu   commited 2024-10-09 08:52:37 +00:00
78713203b3
Make java_sdk_library dependencies explicit
modules should specify the submodule of java_sdk_library that the module
actually depends on

Test: CI
Bug: 358613520
Change-Id: I0367068c901df98483f6cf95160d3e7801881b0a

Jihoon Kang   commited 2024-09-10 00:01:31 +00:00
8401b6a9f0
Add documentation on usage of net-utils-connectivity-apks
Explain this is only for use by NetworkStack, CaptivePortalLogin, Tethering, and why.

Change-Id: I7e2f6ee62aa65a47cf596af36d54d96ce50b4b1f

Remi NGUYEN VAN   commited 2024-08-15 08:07:02 +00:00
514f40b0c3
Revert "Use addEntries when creating NetworkStats"
This reverts commit 668560d85a.

Reason for revert: Devices failing to boot, see b/359795863 

Change-Id: I13dc629e2eb626bff1aed6ff262699c3f577ab9c

Sam Dubey   authored and   Gerrit Code Review   commited 2024-08-14 10:00:32 +00:00
c006797ed4
Use addEntries when creating NetworkStats
In the current design, NetworkStats.addEntry is used within a
loop to create a NetworkStats instance from entries. This results
in a large memory footprint because the addEntry() method clones
the original NetworkStats instance each time it is called.

This change utilizes the newly created API to add a list of
entries at once. This approach only clones the instance once,
thereby reducing the required memory footprint.

Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.NetworkStatsUtilsTest#testPublicStatsToAndroidNetStats
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.net.module.util.NetworkStatsUtilsTest
      (on S device)
Test: atest ConnectivityCoverageTests:com.android.testutils.NetworkStatsUtilsTest
      (on S device)
Bug: 335680025
Change-Id: I5c635613ed3ba34d840ee71b6bef21d10105df0d

Junyu Lai   commited 2024-08-13 17:46:20 +08:00
668560d85a
Improve staticlibs/Android.bp
- Add comments clarifying the use cases of
  net-utils-framework-connectivity and net-utils-service-connectivity
- Apply stricter visibility for the staticlibs

Bug: 357803496
Test: CI
Change-Id: I0d13b436976c3194c0fe350a905a8edf3e4df73a

Handa Wang   commited 2024-08-08 15:42:00 +00:00
8be10bfdff
Add //apex_available:platform in net-utils-non-bootclasspath-aidl build rule.
`net-utils-connectivity-apks` has the dependency on
`net-utils-non-bootclasspath-aidl`, to make sure the CaptivePortalLogin
apk module still can use `net-utils-connectivity-apks`, expand the
`net-utils-non-bootclasspath-aidl` to support apk module in platform.

Bug: 329361366
Test: TH
Change-Id: I6d2f723fdc28037ed40072565d93b4307d7f5a45

Xiao Ma   commited 2024-08-06 15:02:01 +09:00
b28199a146
Rename net-utils-tethering to net-utils-connectivity-apks.
CaptivePortalLogin module also require the static lib
net-utils-tethering, rename it to net-utils-connectivity-apks for more
usage scope.

Bug: 329361366
Test: TH
Change-Id: Id68255fec9b1586f445bbd7bf290df3403e4ca11

Xiao Ma   commited 2024-08-02 11:20:21 +09:00
6793fd0621
Merge "Create new lib for Wifi module" into main
Gabriel Biren   authored and   Gerrit Code Review   commited 2024-07-25 16:35:31 +00:00
29d14e7a54
Create new lib for Wifi module
Bug: 344894225
Test: build
Change-Id: I28f85852965d20371c674ec39c5c3e5026d47358

Nate Jiang   commited 2024-07-25 05:51:17 +00:00
5f0471c949
Merge "Remove superfluous visibility from net-utils-device-common." into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-07-22 02:48:53 +00:00
8811e1d06a
Consolidate DNS label comparison functions in DnsUtils
Moved common DNS label comparison functions from MdnsUtils.java to
DnsUtils.java within the staticlib to facilitate reuse by both
Connectivity and NetworkStack modules.

Test: TH
Change-Id: Ie839c5621d2c4b74e41987a0c6d1141d0d6e24f8

Yuyang Huang   commited 2024-07-18 12:00:59 +09:00
d851a04db4
fix dependency on modules-utils-build
net-utils-services-common used to include modules-utils-build as a
static lib, but this has the issues of forcing lib depending on it to
also have the modules-utils-build.
When trying to add this lib to a framework library within the same apex,
it fail the StrictJavaPackagesTest.
By moving the responsibilities to link it to the caller we no longer
have the initial issue

Bug: 343121936
Test: Build target using net-utils-services-common
Test: atest StrictJavaPackagesTest
Flag: Exempt simple dependency fix
Change-Id: I96137c177e9c38d39243eedd1729e7626b4cdcdf

William Escande   commited 2024-07-10 14:26:50 -07:00
51c0be5d4f
Remove superfluous visibility from net-utils-device-common.
This is not used outside core networking modules and because it's not
jarjar'd, is not safe to use outside core networking modules anyway.

Change-Id: I1d8dfb0191b94e64ba3e7062f3a547348d9b0403
Test: TH

Lorenzo Colitti   commited 2024-07-05 08:34:37 +00:00
af35f454d5
Refactor staticlibs
This CL introduces net-utils-framework-connectivity, net-utils-tethering
and net-utils-service-connectivity as staticlibs.

- net-utils-framework-connectivity will be used by
  framework-connectivity-pre-jarjar.
- net-utils-service-connectivity and net-utils-tethering are the
  static liraries used by service-connectivity-pre-jarjar and Tethering
  respectively.

Bug: 350699020
Test: CI

Change-Id: I4dbb2b0de905a576cfcf24d2d5d1f1a261d2bd68

Handa Wang   commited 2024-07-05 05:26:46 +00:00
9b0df36ea4
Merge "Revert "Prepare for @RequiresApi class retention"" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-26 11:47:49 +00:00
270f0064f6
Revert "Prepare for @RequiresApi class retention"
This reverts commit 53da9ac34c.
And fixes the linter errors.

Bug: 328190227
Test: TH
Change-Id: I92e0f268c770b6e46bdc781d4867f1e0b505d4ad

Motomu Utsumi   commited 2024-06-26 19:14:30 +09:00
a1a0034f0e
Move SyncStateMachine to staticlibs
Test: mm
Change-Id: I51685a454a3d0fab578fef1eeb42d600adef06e6

Patrick Rohr   commited 2024-06-21 08:25:25 -07:00
aa06b2bf8e
Add a SingleWriterBpfMap class that caches reads.
This should speed up BPF map reads by returning the cached value
without needing a system call.

Bug: 343166906
Test: added parameterization to BpfMapTest
Change-Id: Ifc0c5baa80f6d46356434c249749e87fe2f9ec6c

Lorenzo Colitti   commited 2024-06-05 06:48:27 +00:00
05be2f52fd
Separate Struct.java into its own lib.
* Struct.java is removed from net-utils-device-common-bpf and
  net-utils-device-common-struct's source list
* Created a lib net-utils-device-common-struct-base for Struct.java
* Updated libs that require Struct.java to include
  net-utils-device-common-struct-base.
* Replaced net-utils-multicast-forwarding-structs with
  net-utils-device-common-struct in service-connectivity

Bug: 323503345

Test: build tethering module.
Change-Id: I3f60715c3d8043b7569db7612dee9d4fa1ccba59

Yang Sun   commited 2024-03-27 20:15:17 +08:00
3aa62e6773
Merge "Remove unused library visibility" into main
Chiachang Wang   authored and   Gerrit Code Review   commited 2024-03-04 02:43:27 +00:00
2154e525b3
Remove unused library visibility
This commit removes the unused library visibility.

The "frameworks/base/packages/Connectivity" folder is the
temporary folder for modulizing the connectivity codes. There is
no such need now.

Test: m
Change-Id: Ia2890fe64c1bc369fcb90be645263bc56c98a7b2

Chiachang Wang   commited 2024-03-01 00:57:52 +00:00
52d329642a
Merge "Include structs lib in service-connectivity-pre-jarjar" into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-02-29 03:16:28 +00:00
db67a80430