Commit graph android_packages_modules_Co.../staticlibs/Android.bp
Message SHA1
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
Include structs lib in service-connectivity-pre-jarjar
To use the java struct definitions for multicast routing in connectivity
service, a new lib is defined and included in
service-connectivity-pre-jarjar.

Bug: 323503345

Test: presubmit
Change-Id: I664602fd0fa0a5da136ea28fd3c4d9068c5b46ab

Yang Sun   commited 2024-02-26 17:28:04 +08:00
1c9fb59004
Prepare for @RequiresApi class retention
The android framework has android.annotation.RequiresApi, which is a
copy of androidx.annotation.RequiresApi. However it was added with
source retention instead of class retention like androidx's version
has. This causes it to be missed if you compiled a library and then
used that library to compile something else, that library's public
methods won't have @RequiresApi on them when using that library's
compiled jar file.

To make @RequiresApi have class retention, we need to baseline the
NewApi issues that it would cause. These baselines also require
us to disable strict_updatability_linting in some places.

Bug: 323366771
Test: m lint-check
Change-Id: I0c984e3ba39e357ce102be442568f2d77a4f9034

Cole Faust   commited 2024-02-02 12:04:05 -08:00
53da9ac34c
[DON'T BLOCK] Test ownership migration rules
This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.

For more details please refer to the link below,
<add g3 doc link>

Bug: 304529413
Test: N/A
Change-Id: I243f17b3f0ad7af9ffa15ca242456e36688733f5
Merged-In: I243f17b3f0ad7af9ffa15ca242456e36688733f5

Aditya Choudhary   commited 2024-01-31 12:34:50 +00:00
01b5ede2b2
Merge "Migrate Tethering#dump to use runWithScissorsForDump" into main
Junyu Lai   authored and   Gerrit Code Review   commited 2024-01-10 09:46:12 +00:00
7b4ebdf2ef
Migrate Tethering#dump to use runWithScissorsForDump
This change includes:
  1. Refactor the logic in Tethering#dump into utils class.
  2. Move the utils class to a common place which could be referenced
     from other sub-modules.
  3. Add @MonitorThreadLeak annotation to enforce
     there is no thread leak problem.

Test: atest FrameworksNetTests NetworkStaticLibTests
Test: atest ConnectivityCoverageTests:com.android.networkstack.tethering.TetheringTest#testDumpTetheringLog
Test: adb shell dumpsys tethering (with hardcoded exception)
Fix: 312669345

Change-Id: Ia6fdfeeec2110afa0ec9e056e9db3843748845c3

Junyu Lai   commited 2024-01-10 13:56:55 +08:00
2ff42d264b
Make apex availability of net-utils-framework-common explicit
This java library is available to the following
1. NetworkStack, a platform app
2. TetheringNext, an app in com.android.tethering

The availability to (2) was done implicitly using a baseline map in
build/soong/apex/apex.go. Make this explicit in Android.bp

Bug: 281077552
Test: m nothing
Change-Id: I5738ef1fc153e7ef9ccdde512e61310b0fd1ddbb

Spandan Das   commited 2023-12-21 21:58:16 +00:00
2b83e7774c