Commit graph android_packages_modules_Co.../staticlibs
Message SHA1
Merge "Add config for client-side traffic stats rate-limit cache." into main
Junyu Lai   authored and   Gerrit Code Review   commited 2024-10-31 07:22:36 +00:00
30ff675df5
Add config for client-side traffic stats rate-limit cache.
This is a no-op change since the config is not used yet, and
the feature flag will be gradually rolled out instead of enabled
by default.
However, this change is necessary for follow-up changes to enable
toggling the feature and configuring its behavior through device
configuration flags.

This change includes:

 1. Disable the service-side cache flag if the client-side flag
    is enabled.
 2. Since the apps don't have enough permission to check the
    feature flag from DeviceConfig. Provides a binder interface
    for returning per-UID config,
    which only returns cache enabled if the SDK level is V+
    or the app's target SDK is V+.

Test: atest FrameworksNetTests:android.net.connectivity.android.net.TrafficStatsTest \
      FrameworksNetTests:android.net.connectivity.com.android.server.net.NetworkStatsServiceTest \
      CtsNetTestCases:android.net.cts.NetworkStatsBinderTest \
      FrameworksNetIntegrationTests:com.android.server.net.integrationtests.NetworkStatsIntegrationTest
Bug: 343260158
Change-Id: Id9761e4aea65fabe6466c875b787e178317a1da2

Junyu Lai   commited 2024-10-30 23:02:59 +08:00
b9071f8512
Merge "Disable IWLAN in tests on 24Q2" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-30 09:35:41 +00:00
e11336f01d
Disable IWLAN in tests on 24Q2
24Q2 reconnects mobile data when Wi-Fi is toggled when IWLAN is used,
which breaks multinetwork tests. Disable IWLAN as a workaround on such
builds.

Bug: 368477391
Test: atest
Change-Id: Ia5748dc2378c5fc4a43ff83e6b47e629eb8bf77a

Remi NGUYEN VAN   commited 2024-10-30 17:41:03 +09:00
1372ac2140
Merge "Add log when resetting DeviceConfig" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-25 02:25:38 +00:00
bdeff0e8e6
Add log when resetting DeviceConfig
The log should help investigate flakes, by knowing at which point
DeviceConfig is being reset and to which value.

Test: atest
Change-Id: Ia7392ad57d3df17b0d5194158b402f52bc90f7e3

Remi NGUYEN VAN   commited 2024-10-25 09:20:12 +09:00
001be79f0f
Merge "Remove dependencies on the 1-variant fallback" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-24 06:56:10 +00:00
ed99321230
Merge "Fix flakes due to cell reconnecting on wifi toggle" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-24 04:02:13 +00:00
e486d1d6b2
Fix flakes due to cell reconnecting on wifi toggle
On some networks, telephony may teardown its network
(unregisterAfterReplacement) when wifi is toggled to change the MMS
capability.

Update testRejectUnvalidated_TearDownNetwork to take that into account:
right after toggling wifi to make it unvalidated, wifi may still be
default if mobile data is being reconnected. Wait for mobile data to
reconnect and validate in that case.

Bug: 296403855
Test: atest
Change-Id: Ief46bed41ecb23d75c9a1f58e7a272e7f3de7caf

Remi NGUYEN VAN   commited 2024-10-24 11:22:56 +09:00
c19e8a00cc
Merge "Refactor is_packet_capture_supported() by expect_throws()" into main
Jimi Chen   authored and   Gerrit Code Review   commited 2024-10-24 01:19:30 +00:00
6833d84d0b
Merge "Create net-utils-framework-ipsec for IPsec module" into main
Yan Yan   authored and   Gerrit Code Review   commited 2024-10-23 23:00:40 +00:00
c9bb9e390c
Remove dependencies on the 1-variant fallback
When adding a dependencies, if the variants don't match, but the
dependency only has 1 variant anyways, soong will always use that
variant. This makes it hard to add new variants to soong, because the
1-variant fallback stops being used and you start getting missing
variant errors. Make changes to bp files such that all dependencies
correctly specify the variant to use.

Bug: 372091092
Flag: EXEMPT refactor
Test: m nothing
Change-Id: I8d4f59044f268088b44357d27322abbdcdc3001c

Cole Faust   commited 2024-10-22 16:31:00 -07:00
9ff8f4c81b
Merge "Add expect_throws() to assert_utils.py to check expected exception" into main
Jimi Chen   authored and   Gerrit Code Review   commited 2024-10-22 07:05:01 +00:00
7a4a85bf44
Refactor is_packet_capture_supported() by expect_throws()
Test: atest NetworkStaticLibHostPythonTests
Change-Id: Ibbc249e3d6ef182207ba3fe37c47bab7e099f2b0

Jimi Chen   commited 2024-10-22 03:07:27 +00:00
13a9f53d98
Add expect_throws() to assert_utils.py to check expected exception
Test: atest NetworkStaticLibHostPythonTests
Change-Id: I2e181f5b6f41e6de228d516dff970d47cfa3eaf6

Jimi Chen   commited 2024-10-22 03:06:47 +00:00
a0c0168ae6
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 "Split requestDownstreamAddress into two methods" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-10-18 05:06:39 +00:00
f1a422de95
Merge "Add report header to failure diagnostics" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-18 04:46:04 +00:00
40b2466b1d
Merge "Create a timerfd JNI class" into main
Paul Hu   authored and   Gerrit Code Review   commited 2024-10-18 02:01:25 +00:00
6911ab9dd9
Split requestDownstreamAddress into two methods
This CL splits requestDownstreamAddress into two methods:  requestStickyDownstreamAddress and requestDownstreamAddress.

- The requestStickyDownstreamAddress is equivalent to the former requestDownstreamAddress when useLastAddress=true.
- The new requestDownstreamAddress method allows allocating an address without providing the interface type and scope, which is Thread NAT64's use case.


Bug: 369282577


Change-Id: Ib839d121c7b46c492f2c4c1c61b52b5d017fa055

Handa Wang   commited 2024-10-18 01:29:53 +00:00
389bc7f13e
Add report header to failure diagnostics
Add a one line header of JSON info about the failure in failure
diagnostics reports.

This can then be automatically collected to calculate statistics about
particular failures, for example how often they happen when wifi is not
connected, not validated etc.

Test: atest
Change-Id: Ic4c99c53fc2686aaf2f1651522aa2f0d82d0cb86

Remi NGUYEN VAN   commited 2024-10-18 09:41:33 +09:00
e980872140
Merge "Consolidate handler thread check functions in HandlerUtils" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-17 02:25:57 +00:00
b0e3eaf70b
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
Merge "Revert "Add link-related methods at NetlinkUtils"" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2024-10-17 01:22:59 +00:00
d598ced4a6
Update unit tests to reflect the changes to RoutingCoordinator and
PrivateAddressCoordinator

Bug: 350699020

Change-Id: Id0ae47dcb03c60b6caafa3feeecaf8b21092a101

Handa Wang   commited 2024-10-16 23:54:29 +00:00
d789d1b8de
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
Introduce PrivateAddressCoordinator methods at RoutingCoordinatorManager
This CL exposes PrivateAddressCoordinator methods at
RoutingCoordinatorManager and implements the methods in
RoutingCoordinatorService.

The objective is to allow a system service like Thread to request an
IPv4 address allocation.

Bug: 350699020

Change-Id: I65dc309f0b503d544e0fddc1168131fa6174796c

Handa Wang   commited 2024-10-16 23:54:25 +00:00
e5e06f9f7c
Revert "Add link-related methods at NetlinkUtils"
Revert submission 3274112-NetlinkUtilsLinkMethods

Reason for revert: This change broken gantry gate, which will block the mainline release. We need to revert this change and to unblock the release.

https://atp.googleplex.com/test_runs?testName=v2/mainline-engprod/networking/gce-coverage-v-build-module-on-s-platform%&branchName=git_main-mainline-daily-release

https://android-build.corp.google.com/test_investigate/invocation/I87400010326574859/test/TR66129480211416540/

Reverted changes: /q/submissionid:3274112-NetlinkUtilsLinkMethods

Change-Id: I49338a17a8a2d284480f1a29472bf66359c14e2b

Yuyang Huang   authored and   Gerrit Code Review   commited 2024-10-16 16:18:40 +00:00
9b8b300ca8
Consolidate handler thread check functions in HandlerUtils
Moved common handler thread check functions from MdnsUtils.java
to HandlerUtils.java within the staticlib to facilitate reuse by
both Connectivity and NetworkStack modules.

Test: TH
Change-Id: Id96f6558c32c44fbdf2d2ce3e57c14da0cbf3ed7

Paul Hu   commited 2024-10-16 10:07:03 +00:00
84a40ff16d
Merge "Do not run diagnostics on assumption failures" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-16 07:16:44 +00:00
8eff4fd04b
Create a timerfd JNI class
The timerfd delivers timer expiration notifications via a file
descriptor, which can be used to implement delayed callbacks.
Create a JNI class to interface with the timerfd system calls.

Bug: 366373064
Test: m
Change-Id: I0ae7a4cf618838e614b2fa4523b55a4d0e8f74e2

Paul Hu   commited 2024-10-16 06:29:48 +00:00
eb73d4ddda
Do not run diagnostics on assumption failures
Assumption failures are not actual failures, do not run connectivity
diagnostics for these.

Test: atest
Change-Id: I1d78eb6f12412e13cf4c29718ff8869ed089f491

Remi NGUYEN VAN   commited 2024-10-16 15:26:47 +09:00
3feb788aa5
Merge "Add options to disable diagnostics collector" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-16 06:02:22 +00:00
5024551d11
Add options to disable diagnostics collector
Disable by default on local builds (which generally have "eng.username"
as their INCREMENTAL version), and add an option to allow disabling
manually on other builds as well.

Test: atest

Change-Id: I2d406a55ba0e3d57ed30e740b6c011124905b8d7

Remi NGUYEN VAN   commited 2024-10-16 13:27:14 +09:00
2665f0a4d5
Merge "Add connectivity diagnostics on test failure" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2024-10-16 04:11:58 +00:00
c0ebf16036
Add connectivity diagnostics on test failure
When CtsNetTestCases tests fail, or when a tryTest statement fails,
collect connectivity diagnostics and output them as a test artifact.

tryTest must be followed by cleanup blocks, which often change the
configuration, so having diagnostics when the tryTest fails in addition
to after the test failure is useful.

The collected diagnostics will be available as individual test
artifacts. They should make it easier to investigate test failures, and
could be collected across test runs in an automated way.

Output files are currently limited at 20 per run, to avoid collecting
too much data in case everything is failing in the run.

Test: atest
Change-Id: Iaa48e519028dc61c03d387beeade7d41fca2ef48

Remi NGUYEN VAN   commited 2024-10-16 10:05:35 +09:00
43730b3f0f
Rename TapPacketReader to PollPacketReader for broader applicability
* Renamed TapPacketReader to PollPacketReader to better reflect its
  functionality beyond TAP interface interaction.
* The class includes general logic for polling and sending packets to
  file descriptors, making it suitable for wider use cases.

Test: TH
Change-Id: Icdf9a9d7ef6f49b589ed9cdbd05159ab95e7e5d9

Yuyang Huang   commited 2024-10-15 13:42:05 +09:00
eb3c631b89
Merge "Ensure the dump service is completed" into main
Paul Hu   authored and   Gerrit Code Review   commited 2024-10-14 01:46:21 +00:00
ef1b2ea92e
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
Retrieve IPv4 and IPv6 addresses for client and server device in test setup
Test: m connectivity_multi_devices_snippet && atest CtsConnectivityMultiDevicesTestCases
Change-Id: Icba82832fa1840ea1a3299f61027666d4dd90d46

Jimi Chen   commited 2024-10-07 13:34:02 +00:00
4c3a13c048
Add send and check reply packet function for multi-devices tests
The `send_packet_and_expect_reply_received` start capurting packets,
and then send out request packets, then get expected packets counts to validate.
In the end, stop capturing for the specified interface.

Test: m connectivity_multi_devices_snippet && atest CtsConnectivityMultiDevicesTestCases
Change-Id: I275534a45ce0ed363fa8ab9d12272d25845aa598

Jimi Chen   commited 2024-10-07 13:34:01 +00:00
d07d47b1d3
Add packet capture and match network_stack adb command to to apf_utils
It wraps the following 3 commands for multi-devices tests
- cmd network_stack capture start <interface>
- cmd network_stack capture stop <interface>
- cmd network_stack capture matched-packet-counts <interface> <pkt-in-hex>

Add a helper function `is_packet_capture_supported` as APFv6 precondition check.
Test: atest NetworkStaticLibHostPythonTests

Change-Id: I526c678c6e753cee3969b04a56ab33e5e3d1600d

Jimi Chen   commited 2024-10-07 13:33:57 +00:00
1644f95852
Support get multiple ipv4/ipv6 addresses in apf_utils
Test: atest NetworkStaticLibHostPythonTests
Change-Id: I806696437acf905c049762d59a46c866ff0584ef

Jimi Chen   commited 2024-09-27 06:55:54 +00:00
738bf999d5
Merge "Revert "Use unicast instead of broadcast as ethernet destination in test_apf_drop_ethercat"" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-09-26 18:12:15 +00:00
b437e753f7
Revert "Use unicast instead of broadcast as ethernet destination in test_apf_drop_ethercat"
This reverts commit 46102348e0.

Reason for revert: mistakenly submitted.

Change-Id: I6072a9828a8cc0633ca35ea2ecf7707f2b3573a1

Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-09-26 18:11:41 +00:00
c3eccf9ef4
Merge "Add link-related methods at NetlinkUtils" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-09-26 09:47:31 +00:00
842fb52fef
Add link-related methods at NetlinkUtils
This CL adds static methods at NetlinkUtils class that send the
netlink message to kernel to configure the network interface up or down,
rename the interface, and query the interface.

Bug: 364501824
Test: NetworkStackIntegrationTests:android.net.ip.IpClientSignatureTest

Change-Id: Ie545a6617adff2601f405df01dea9edd59952a53

Chih-Yu Huang   commited 2024-09-26 15:08:31 +09:00
a7fc900db7
Merge "Use unicast instead of broadcast as ethernet destination in test_apf_drop_ethercat" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-09-25 21:02:35 +00:00
aabad69006
Use unicast instead of broadcast as ethernet destination in test_apf_drop_ethercat
To prevent packet dropped earlier by multicast filtering,
use unicast ethernet destination instead

Bug: 360730207
Test: m connectivity_multi_devices_snippet && atest CtsConnectivityMultiDevicesTestCases:ApfV4Test
Change-Id: I4816b71f68f349abf1423c7013bb058ccc233d61

Jimi Chen   authored and   Maciej Żenczykowski   commited 2024-09-25 19:42:01 +00:00
46102348e0
Merge "Add createGetLinkMessage() at RtNetlinkLinkMessage" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-09-25 11:55:40 +00:00
1a9758e5a2