Commit graph android_packages_modules_Co.../tests
Message SHA1
Revert "Fix onActiveDataSubscriptionIdChanged is not received in multi SIM mode"
This reverts commit aecb2b65ba.

Reason for revert: Likely culprit for b/430219293 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Bug: 430219293
Change-Id: I9b786abf784de8c34b9f517236305330b79b227e

Chaitanya Cheemala (xWF)   authored and   Android (Google) Code Review   commited 2025-07-08 03:54:19 -07:00
1bcbb88955
Fix onActiveDataSubscriptionIdChanged is not received in multi SIM mode
Flag: EXEMPT mainline
Bug: 428673855
Test: manually
Change-Id: I0d7c2538ec33402dba64949c3fb34519605d843e

Jimi Chen   commited 2025-07-08 02:14:21 +00:00
aecb2b65ba
Merge "Add persisted logic to EthernetConfiguration" into main
Chuwei He   authored and   Android (Google) Code Review   commited 2025-06-26 21:15:19 -07:00
784cc003f6
Merge changes If5f9b5e8,I2ae559df into main
* changes:
  Remove delayed messages from handler queue correctly
  Exclude more files from mDNS standalone library

Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-06-26 17:47:59 -07:00
830b2bc40e
Remove delayed messages from handler queue correctly
This change replaces removeMessages() with removeEqualMessages().
The latter uses the equals() method to correctly compare the
content of interface name strings, ensuring previously delayed
messages are properly removed.

Bug: 427426427
Test: Manual testing with some modifications.
Test: atest ConnectivityCoverageTests NsdManagerTest
Flag: EXEMPT bug fix
Change-Id: If5f9b5e8425fc9bb235431edd78c3f3a28a037d8

Paul Hu   commited 2025-06-26 07:30:40 +00:00
4d22c15b0a
Add persisted logic to EthernetConfiguration
This patch added persisted logic to EthernetConfiguration, which allows
ethernet configuration to be set to be persistent across boot or not.

Bug: 397536853
Test: atest ConnectivityCoverageTests
Flag: EXEMPT mainline
Change-Id: I6e96dec0f802cf1a58e61bffb6c1dac34a0a91a5

Chuwei He   commited 2025-06-25 23:25:37 -07:00
7e60f9a82f
Merge "Format MdnsReplySenderTest" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-06-25 08:34:13 -07:00
7e90162275
Format MdnsReplySenderTest
Use the ktlint.py script to correct Kotlin code formatting errors.

Test: m
Flag: EXEMPT corret format
Change-Id: I1c184ce89e4e511340b8a32cb5dd3253191a8bbd

Paul Hu   commited 2025-06-25 10:18:15 +00:00
e823669fb7
Merge "Skip tests if FLAG_AVOID_BAD_WIFI_FROM_CARRIER_CONFIG is not enabled" into main
Jimi Chen   authored and   Android (Google) Code Review   commited 2025-06-24 22:30:31 -07:00
b09d959d06
Skip tests if FLAG_AVOID_BAD_WIFI_FROM_CARRIER_CONFIG is not enabled
Flag: android.net.platform.flags.avoid_bad_wifi_from_carrier_config
Bug: 424707713
Test: TH
Change-Id: I3253e95c92ff9001c73304e23ea829aa7f30f92f

Jimi Chen   commited 2025-06-25 00:59:15 +00:00
f8264fbf26
Merge "Skip tests if device does not suppor telephony subscription feature" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-06-24 02:53:53 -07:00
205b13a557
Skip tests if device does not suppor telephony subscription feature
Flag: EXEMPT mainline
Test: atest CtsNetTestCases:android.net.ConnectivitySettingsManagerTest#testShouldShowAvoidBadWifiToggleWithCarrierConfig \
 -- --test-arg com.android.testutils.ConnectivityTestTargetPreparer:ignore-mobile-data-check:true \
 --abi arm64-v8a
Change-Id: Ifeb04dc02075f4a40422b3caaef3e8eab57f1096

Jimi Chen   commited 2025-06-24 08:22:08 +00:00
2e4185e08c
Merge "Fix incorrect Global Settings key for reset in test cases." into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-06-23 23:00:04 -07:00
2e3de546ce
Fix incorrect Global Settings key for reset in test cases.
The test cases were incorrectly attempting to reset "network_carrier_aware_avoid_bad_wifi"
instead of "network_carrier_aware_avoid_bad_wifi/1" for specific subIds.
This commit corrects the key.

Flag: EXEMPT mainline
Bug: 425170385
Test: atest CtsNetTestCases:android.net.ConnectivitySettingsManagerTest --iterations 100
Change-Id: Iee9273faa77a68af2a75fe3c37ee6f3b2435cbf1

Jimi Chen   commited 2025-06-24 04:07:25 +00:00
bc9218530f
Merge "Wait for Soft AP completion before connecting" into main
Paul Hu   authored and   Android (Google) Code Review   commited 2025-06-23 20:28:03 -07:00
8cc1379c11
Merge "Register network_carrier_aware_avoid_bad_wifi setting change callback" into main
Jimi Chen   authored and   Android (Google) Code Review   commited 2025-06-23 19:59:08 -07:00
1895b07c81
Wait for Soft AP completion before connecting
The startWifiTethering method is modified to wait for the Soft AP
to be fully started and ready before it returns. Previously, this
method would return as soon as the tethering interface was
active. This could cause race conditions, leading to client
devices attempting to connect to the hotspot before it was fully
operational. The Soft AP is now guaranteed to have successfully
broadcast its information and be ready for connections.

Bug: 417369055
Test: atest CtsConnectivityMultiDevicesTestCases
Flag: EXEMPT bug fix
Change-Id: Ie0420753256bf26c5d44e8c856a87b3c9340a961

Paul Hu   commited 2025-06-23 14:46:58 +00:00
395c079244
Register network_carrier_aware_avoid_bad_wifi setting change callback
This commit registers the "network_carrier_aware_avoid_bad_wifi" URI
with the ContentResolver to allow for monitoring changes to this
specific Global.Settings entry.

Flag: EXEMPT mainline
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.MultinetworkPolicyTrackerTest
Change-Id: I0e9161c5390b71e5c3ecac89613aa042f40ab695

Jimi Chen   commited 2025-06-23 14:01:56 +00:00
1095a3486f
Merge "Migrate CSAgentWrapper to TestableCallback." into main
Jean Chalard   authored and   Android (Google) Code Review   commited 2025-06-22 18:43:23 -07:00
3cbf1e3b94
Merge "Check service meta-data for satellite opt-in" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-06-20 02:25:16 -07:00
bc19379378
Check service meta-data for satellite opt-in
Previously, the approach for apps to declare themselves
satellite-optimized was problematic. Relying solely on the
<application> tag for opt-in could significantly increase app
size. This was particularly an issue on older devices, where
the duplication of <meta-data> directly under the
<application> tag into each ProviderInfo could drastically
swell its size. A prime example of this negative impact was
crashes on Android 5.0 (API 21) and older devices, where
PackageManager.queryContentProviders would exceed the 1MB
Binder transaction limit due to the bloated ProviderInfo size.

The `isSatelliteDataOptimizedApp` method is updated to iterate
through a package's services if the application-level meta-data
is not found.

Flag: EXEMPT controlled by kill switch
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.SatelliteAccessControllerTest
Test: atest CtsHostsideNetworkTests:com.android.cts.net.HostsideSatelliteDataOptInTest
Bug: 424290966

Change-Id: I36b6a0093bc74de470443f6553b26b09d070ed9d

Junyu Lai   commited 2025-06-20 16:35:28 +08:00
441ce68713
Migrate CSAgentWrapper to TestableCallback.
This makes it much more powerful as well as consistent with
other use cases of this paradigm.

Test: TH
Flag: EXEMPT test-only
Change-Id: I4f5b86bfdd16d8bfe21b79235444817a13bc3c49

Chalard Jean   authored and   Jean Chalard   commited 2025-06-20 01:08:25 -07:00
6fe5d13b3a
Merge changes from topic "avoid-bad-wifi-api-update" into main
* changes:
  Enable per-subId 'avoid bad Wi-Fi' setting storage
  Use ConnectivitySettingsManager API for avoid bad Wi-Fi updates

Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-06-20 00:42:48 -07:00
553054fcee
Merge "Use handler thread to retrieve carrier config directly" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-06-19 06:06:08 -07:00
4ee72294c0
Enable per-subId 'avoid bad Wi-Fi' setting storage
Breaks out the `network_carrier_aware_avoid_bad_wifi` setting from a single
string key into individual `Global.Settings` entries per subscription ID.

Flag: EXEMPT mainline
Bug: 424330991
Test: atest ConnectivityCoverageTests:android.net.connectivity.android.net.ConnectivitySettingsManagerTest
Change-Id: Ida673c1b8b915719b8e64ea85a66c2b98862e5f5

Jimi Chen   commited 2025-06-19 11:30:06 +00:00
1bfe086299
Use ConnectivitySettingsManager API for avoid bad Wi-Fi updates
This change replaces the internal cache with the `ConnectivitySettingsManager` API
to manage "avoid bad Wi-Fi" settings. It reduces code duplication and improves
readability.

Flag: EXEMPT mainline
Bug: 422063047
Test: atest ConnectivityCoverageTests
Change-Id: I82d9e1afb7c318d584e708da6ad5c10f298f057b

Jimi Chen   commited 2025-06-19 11:30:02 +00:00
dd73a350f9
Merge "Update test to wait for LOST callback when disconnecting WiFi" into main
Motomu Utsumi   authored and   Android (Google) Code Review   commited 2025-06-19 01:39:20 -07:00
0d7bd2d772
Merge "Change EthernetPortInfo to EthernetPortState" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-06-18 21:26:04 -07:00
7882140d7d
Update test to wait for LOST callback when disconnecting WiFi
testReportNetworkInterfaceForTransports is flaky, and one failure reason
is that the device fails to reconnect to Wi-Fi after a disconnect.
The current failure message is misleading because ensureWiFiConnected()
receives callbacks from the previous Wi-Fi network.
This CL replaces disableWifi with ensureWifiDisconnected, which
explicitly waits for the LOST callback.
While this isn't a direct fix for the test failure, it will be helpful
for investigating the issue.

Bug: 416687630
Test: BatteryStatsManagerTest
Flag: EXEMPT test only change
Change-Id: I27cdf87c465b8caf6d2b1cd41a133ca4b9d28377

Motomu Utsumi   commited 2025-06-19 10:26:26 +09:00
532f36234c
Merge changes I6df4f98d,I8d7f0de3 into main
* changes:
  Add TrackingReason.NCM to test interfaces
  Start tracking NCM-only interfaces

Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-06-18 17:09:50 -07:00
8f3599dbdb
Merge changes I97b4cf85,I33134502,I43beb0d3,I1b681708 into main
* changes:
  Add EthernetPort#matches(interfaceName)
  Ignore NLMSG_DONE messages
  Only consider interfaces tracked by regex in EthernetManager#isAvailable
  Ensure provisioning is never started with Mode.NONE

Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-06-18 17:08:04 -07:00
f2b5e4a9a0
Add TrackingReason.NCM to test interfaces
This allows writing test cases for local-only NCM interfaces. However,
it does not allow writing tests for interfaces which have only one of
the TrackingReasons (i.e. REGEX or NCM).

This CL also adds a very basic integration test.

Test: atest EthernetManagerTest
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I6df4f98de62de9d1458978b0b00e9739903d0f3d

Patrick Rohr   commited 2025-06-18 14:52:32 -07:00
f80f66d424
Add EthernetPort#matches(interfaceName)
Interface matching in the ethernet module is still done by interface
name. Add an explicit #matches() function to avoid accidentally
comparing against the wrong object. Comparing a String to an
EthernetPort (or vice versa) is a valid java expression.

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

Patrick Rohr   commited 2025-06-18 14:49:41 -07:00
8b390a5cca
Merge "Revert "Remove an empty tryTest{} clause"" into main
ESWAR MAGATAPALLI (xWF)   authored and   Android (Google) Code Review   commited 2025-06-18 05:04:15 -07:00
3259332337
Merge "Fix flaky testHandleUdpSocketDestroy" into main
Motomu Utsumi   authored and   Android (Google) Code Review   commited 2025-06-18 03:16:33 -07:00
67f4f44402
Fix flaky testHandleUdpSocketDestroy
The SkDestroyListenerCallback posts a message to a handler thread.
This can cause a race condition when sendQuicConnectionClosePayload call
is verified.

This CL sets a timeout for verifying sendQuicConnectionClosePayload
call.
Additionally, a short timeout is used to assert that destroyUdpSocket is
not called.

Test: QuicConnectionCloserTest
Bug: 407226131
Flag: EXEMPT test only change
Change-Id: I62522fcafb91bef12e2781afbd090af8d0350f1e

Motomu Utsumi   commited 2025-06-18 15:56:56 +09:00
54a621a248
Revert "Remove an empty tryTest{} clause"
This reverts commit b26d3ae205.

Reason for revert: Droidmonitor created revert due to b/425504292. Will be verifying through ABTD before submission.

Fix: 425504292
Change-Id: I2a799375435837c0c38d1aec7de0bc2bf70e69d1

Priyanka Advani (xWF)   authored and   Android (Google) Code Review   commited 2025-06-17 13:13:37 -07:00
bf67b31b15
Merge "Allow VCN network to beat a physical cell in network ranking" into main
Yan Yan   authored and   Android (Google) Code Review   commited 2025-06-17 11:09:54 -07:00
7b1145e6b4
Only consider interfaces tracked by regex in EthernetManager#isAvailable
There is an argument that the API is @UnsupportedAppUsage since R and
this code only ships to T. In any case, just to be on the safe side, the
code should ignore NCM interfaces which are not part of the regex. (It
already ignores interfaces which are in tethering/server mode today).

This CL also marks a couple of related functions properly as public.
These functions are not @VisibleForTesting; they belong to the public
interface of the class.

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

Patrick Rohr   commited 2025-06-17 09:12:37 -07:00
fb8c780b6f
Do not try to send updated allowed ranges for destroyed networks
Test: TH
Bug: 420229020
Flag: EXEMPT bugfix
Change-Id: Ibc1c4cf2d94afe86f22b515ac0b91c85f6506f8e

Chalard Jean   commited 2025-06-17 13:53:42 +09:00
4d2887b593
Change EthernetPortInfo to EthernetPortState
This patch changes the name of class EthernetPortInfo to
EthernetPortState.

Bug: 397536853
Test: build
Flag: EXEMPT mainline
Change-Id: I7f42170cdde33ca31dea3d622678565ea5dc1026

Chuwei He   commited 2025-06-17 13:48:42 +09:00
d790973d3e
Allow VCN network to beat a physical cell in network ranking
This patch adds a new POLICY to identify a VCN network offer, and
updates NetworkRanker to allow a VCN network to win over a physical
cell network. This is to fix the issue where VCN cannot exit safe
mode when there is already a phsical cell

Bug: 391977557
Test: NetworkRankerTest(new test)
Flag: EXEMPT bugfix
Change-Id: I00ebeb3eeb30ca8b46d25bbde1b6fd3dfee53993

Yan Yan   commited 2025-06-17 01:30:07 +00:00
6eab1d0af3
Merge "Introduce interface name field to SocketKey" into main
Paul Hu   authored and   Android (Google) Code Review   commited 2025-06-16 18:28:55 -07:00
fff6a3fdcd
Merge "Fix flake in ConnectivityDiagnosticsManager" into main
Jean Chalard   authored and   Android (Google) Code Review   commited 2025-06-16 17:59:12 -07:00
fa0cb83eee
Merge "Remove an empty tryTest{} clause" into main
Jean Chalard   authored and   Android (Google) Code Review   commited 2025-06-16 17:02:17 -07:00
93b476260b
Introduce interface name field to SocketKey
This commit adds a new interfaceName field to the SocketKey
class, which allows us to uniquely identify sockets based on
their interface name in addition to their network and interface
index. This information is used for subsequent changes to
identify the target ServiceTypeClient by the interface name.

Bug: 410734687
Test: atest ConnectivityCoverageTests NsdManagerTest
Flag: EXEMPT refactor
Change-Id: Ic312b26ca572d12b7c3177b84aced9d487636003

Paul Hu   commited 2025-06-16 16:10:01 +00:00
ef6f92b903
Fix flake in ConnectivityDiagnosticsManager
...or at least make it considerably less common.
Sometimes the network is not validated. Instead of checking that the
diagnostics message says it is validated, check that it agrees with
the network capabilities.

Fixes: b/371856020
Test: ConnectivityDiagnosticsManagerTest and TH
Flag: EXEMPT test-only change
Change-Id: I83ff7572a300adf250f82869eff7c55664296f95

Chalard Jean   commited 2025-06-16 15:39:59 +09:00
3a6edd4e01
Remove an empty tryTest{} clause
tryTest is marked @CheckResult for good reason – it's useless
if you don't have a cleanup{} clause. This causes the IDE to
mark the entire block with a warning.

Test: NetworkAgentTest
Flag: EXEMPT test-only change
Change-Id: I80a4ccffa6469639e9aa2af7abc92e8ec7afe086

Chalard Jean   authored and   Jean Chalard   commited 2025-06-15 20:44:57 -07:00
b26d3ae205
Pass TrackingReason to NetworkInterfaceState
Because changing the tethering mode invokes addInterface(), the
tracking mode for the tethering interface needs to be persisted
separately.

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

Patrick Rohr   commited 2025-06-13 16:14:08 -07:00
a2d1cb97fa
Use handler thread to retrieve carrier config directly
Binder calls to the `CarrierConfigManager` API have a P99 latency of 25ms.
This latency is acceptable for direct execution on the handler thread,
eliminating the need for a separate background thread.

This change reduces complexity and improves code readability.

Flag: EXEMPT mainline
Bug: 422063047
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.MultinetworkPolicyTrackerTest
Change-Id: Id163adb51e9d8db00d1412815852ff0da830789b

Jimi Chen   commited 2025-06-13 11:32:16 +00:00
fbdc438e7a