Commit graph

107,489 commits

Message SHA1
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 "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
Merge "[Thread] request/release the NAT64 CIDR" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-10-23 07:11:52 +00:00
ec5bc1fc13
Merge changes I7184eaa0,I2c5951ab into main
* changes:
  Do not crash when adding UID ranges to a destroyed network.
  Test that UID ranges can incorrectly be added to a destroyed network.

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2024-10-23 04:39:07 +00:00
6bf2ce44e4
[Thread] request/release the NAT64 CIDR
This CL implements the logic to maintain the NAT64 CIDR at ThreadNetworkControllerService. When NAT64 is enabled, the service needs to request a CIDR via RoutingCoordinatorManager#requestDownstreamAddress(). When NAT64 is disabled, the service needs to release the CIDR via RoutingCoordinatorManager#releaseDownstreamAddress().

Bug: 350699020

Change-Id: I16397fd48c2925efd9d4833a335cf73832b4f4d6

Handa Wang   commited 2024-10-23 01:31:43 +00:00
a7318da774
Add compatibility version to log lists installed by CT
Introduce a CompatibilityVersion class to group installing operations on
log list related to the same compatibility version (e.g, v3).

Add support for multiple compatibility versions to the
CertificateTransparencyInstaller, although at the moment of writing
there exists only one compatibility version.

Test: atest NetworkSecurityUnitTests
Bug: 319829948
Change-Id: I503dd30cea93d2b1ba57e5ac91b8427394c453f8

Sandro Montanari   commited 2024-10-22 12:34:57 +00:00
a9aafb7c8c
Do not crash when adding UID ranges to a destroyed network.
aosp/3218864 fixed the crash when ranges are removed from a
destroyed network, but did not fix the case where the ranges are
added to a destroyed network.

This can happen if a multilayer request is filed when a network
has already been destroyed.

Fix: 368989698
Test: updated existing tests for this bug
Change-Id: I7184eaa01141f56b7ad774277c7dee03d5812298

Lorenzo Colitti   commited 2024-10-22 11:41:21 +00:00
dfe98fc5be
Test that UID ranges can incorrectly be added to a destroyed network.
This will likely crash the system.

Bug: 368989698
Test: test-only change
Change-Id: I2c5951ab4ccb2c17c4e87912053130377b9941ba

Lorenzo Colitti   commited 2024-10-22 11:40:09 +00:00
a81bfafda5
[Thread] Mark ThreadConfiguration#isDhcpv6PdEnabled() as @hide
This CL marks ThreadConfiguration#isDhcpv6PdEnabled() as @hide because
there's no way yet to set it as enabled. When PD is implemented, we'll
expose this API as System API.

Bug: 342519412

Change-Id: I6b8f7b83bd01c0ba045c777e6f613bc4a74d9dfb

Handa Wang   commited 2024-10-22 07:33:00 +00:00
7616fdd777
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
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 changes I24b0bf5f,I950d6787 into main
* changes:
  Introduce dependencies object for EntitlementManager
  Improved Entitlement UI Launch for multiple admin users

Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-21 11:42:28 +00:00
0537a07d86
[Thread] fix the test util of setNat64EnabledAndWait to apply old config
Bug: 356770473
Change-Id: I6d1e3d6acc9a101b3e783ab4493ed25a3aa732a1

Yang Sun   commited 2024-10-21 08:45:59 +00:00
ee4ab96116
[Thread] use setConfiguration API in NAT64 tests
Bug: 356770473

Change-Id: I98c80de24cbaaa7206ddbd2bf62350066c998ba5

Handa Wang   commited 2024-10-21 06:04:09 +00:00
52c72a11bf
Merge "[Thread] Let TunInterfaceController.getLinkProperties() return a copy of LinkProperties" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-21 06:01:42 +00:00
b5e5d3bef9
[Thread] Let TunInterfaceController.getLinkProperties() return a copy of LinkProperties
This CL avoids accidental edits to the `mLinkProperties` field of TunInterfaceController.

Change-Id: Ie696412c0593cece2fddcd6bc097db2829ef16e7

Handa Wang   commited 2024-10-21 02:51:03 +00:00
380e8244a5
Merge "Set diagnostics log-data-type to CONNDIAG" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-21 02:47:42 +00:00
e6f9b7cbbc
Introduce dependencies object for EntitlementManager
This is a no-op refactoring which only introduce
dependencies object injection to replace the wrapper class.

Test: atest TetheringTests:EntitlementManagerTest
Fix: 363972541
Change-Id: I24b0bf5f8951c453af1e9ae9278285d1a7b86849

Junyu Lai   commited 2024-10-21 10:22:48 +08:00
1193f08d69
Improved Entitlement UI Launch for multiple admin users
This change addresses the launch of entitlement UI activities
in Headless System User Mode (HSUM) on multi-user devices.

HSUM is a configuration where the system user (user 0) does
not represent a human user and primarily runs system services.
In this mode, the first user set up on the device is not user 0.

Modified the EntitlementManager logic to handle the
launch of the entitlement UI in multi-user environments,
specifically addressing scenarios where HSUM is enabled, which
includes:
  1. Always launch the UI to the foreground current user.
  2. Check whether the current user is allowed to show the UI.
This ensures the UI is presented to the appropriate user.

Test: Manual
  1. Mock requires entitlement
  2. adb shell cmd user set-system-user-mode-emulation headless
  3. enable hotspot
Test: atest TetheringTests:EntitlementManagerTest
Fix: 363972541

Change-Id: I950d678741a3f1714f347206fa161bcd7538b402

Junyu Lai   commited 2024-10-21 10:22:42 +08:00
b4a92ff791
Set diagnostics log-data-type to CONNDIAG
This will mark connectivity diagnostics files collected on failure as
CONNDIAG type, so they can be easily identified in test results. Having
a separate type will also allow automatically filtering them so they can
be pulled across test results and flake stats can be aggregated (for
example to identify which wifi access points are typically flaky).

The CONNDIAG type was added in change ID:
Ib56decb7660e9f93844337fa7a5bf9b00610c1c6

See that change for details of the option on FilePullerLogCollector.

Test: atest
Change-Id: I00fe23acf308723583e8ec82a032b42475a68173

Remi NGUYEN VAN   commited 2024-10-21 09:25:46 +09:00
5714031dcc
Merge "[Thread] introduce ThreadNetworkControllerService#initializeInternal()" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-18 10:44:28 +00:00
2b5f3a2778
Merge "Add test for meshcop service state bit for epskc." into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-18 09:53:11 +00:00
2c2e1cce3a
[Thread] introduce ThreadNetworkControllerService#initializeInternal()
The size of the lambda in ThreadNetworkControllerService#initialize() is getting larger so we introduce #initializeInternal() for better readability.

Change-Id: Idd7cb57e5ed03d27210c1199e03bfab51dbd1215

Handa Wang   commited 2024-10-18 09:35:54 +00:00
2801791773
Add test for meshcop service state bit for epskc.
Bug: 373749923

Test: atest CtsThreadNetworkTestCases

Change-Id: I7e8661eb447f4055dce19a0b16857324d7cd9b18

Yang Sun   commited 2024-10-18 08:00:54 +00:00
a9efc24ade
Merge "Update requestDownstreamAddress calls in PrivateAddressCoordinatorTest" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-10-18 06:11:19 +00:00
5f6f114c91
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 "[Thread] add CLI commands for getting/setting config" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-10-18 04:42:41 +00:00
82a82e5c84
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
Update requestDownstreamAddress calls in PrivateAddressCoordinatorTest
Bug: 369282577
Change-Id: Idccd15a8191e519a19afc71668e4ae2003efb71e

Handa Wang   commited 2024-10-18 01:29:56 +00:00
b1145dc6b1
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 "Disable perfetto lock for OnSetup/OnStart/OnStart." into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-17 18:30:37 +00:00
3b0f86784a
Disable perfetto lock for OnSetup/OnStart/OnStart.
This lock causes a deadlock in the handler where OnStop is holding it
waiting for the poller to complete, but the poller is waiting for the
lock in GetDataSourceLocked.

As a result Write can be called concurrent to OnStart/OnStop, but not
OnSetup (guaranteed by Perfetto). The state Write reads is const from
OnSetup onwards, so is fine to read without a lock.

Bug: 320700806
Test: atest libnetworkstats_test
Change-Id: I2a8390268aa8f55c617c22e48129b5cb6fbaf673

Ryan Zuklie   commited 2024-10-17 15:27:20 +00:00
68a760a273
[Thread] add CLI commands for getting/setting config
Bug: 364237115

Change-Id: Ice42d7d02cfefd733042282939635502c259d9d5

Handa Wang   commited 2024-10-17 07:40:42 +00:00
7eb1bbd369
Standardize handler thread checks
Use HandlerUtils#ensureRunningOnHandlerThread to perform handler
thread checks instead of individual methods within the class.

Test: TH
Change-Id: I6d893dc9eedc588660797768a03e7ad7ab636479

Paul Hu   commited 2024-10-17 06:14:05 +00:00
c0e709700c
Merge "[Thread] add configuration methods in ThreadNetworkControllerWrapper" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-10-17 05:37:33 +00:00
fe6dedde08
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
Refator IpServer to allocate IPv4 address via RoutingCoordinatorManager
API

This CL refactors IpServer to allocate IPv4 address via RoutingCoordinatorManager
instead of directly talking to PrivateAddressCoordinator class.

Bug: 350699020

Change-Id: I5c68620626a3668c079234da232f0ef2beb46628

Handa Wang   commited 2024-10-16 23:54:29 +00:00
55e005251d
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
Delete a surprising amount of dead code
Test: TH
Change-Id: I901409eca3d1549035825183031756647b35cbd3

Patrick Rohr   commited 2024-10-16 18:50:21 +00:00
8589c09369
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
[Thread] add configuration methods in ThreadNetworkControllerWrapper
Change-Id: I56b4ca76e7f62d924f99527b36eac24ed151c53b

Handa Wang   commited 2024-10-16 14:55:19 +00:00
1c7d51a743
Merge "Refactor shouldTestThisNetworkType" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-16 11:02:48 +00:00
507922a1e3
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