Commit graph

109,904 commits

Message SHA1
Merge "[Thread] leverage the TestableNetworkAgent to simplify the setup of test network" into main
Handa Wang   authored and   Gerrit Code Review   commited 2025-03-16 22:21:11 -07:00
ad3ca8bbb4
Merge "Enable the cached service removal feature by default" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-16 21:24:34 -07:00
c5852b2601
Merge "[Thread] create standalone border router test module" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-16 21:03:19 -07:00
51a2b6ae1f
[Thread] leverage the TestableNetworkAgent to simplify the setup of test network
Some previous setup steps were implemented in NsdManager test cases
hence we couldn't reuse them in Thread test cases. aosp/3377549
introduced more methods in TestableNetworkAgent class which we could use
to get unify the behavior and reduce redundant code.

Not sure if this can deflake the integration test cases.

Bug: 338061061

Change-Id: I6b4542505ec80bf06b736fecbbe7d6901d27cbc4

Handa Wang   commited 2025-03-16 20:10:09 -07:00
ff509d40ae
[Thread] create standalone border router test module
This is for reduce the overall time of the ThreadNetworkIntegrationTests
which now runs twice for both BR and non-BR cases

Bug: 403360961
Bug: 402480982

Change-Id: Ifa80b8e8885ed980064f92100ef817f9f62b4dc2

Kangping Dong   commited 2025-03-17 10:50:38 +08:00
f96d06db57
Merge changes I4bc29b10,I94a56b2b,I9ca025b1 into main
* changes:
  Add a queue system server-side for NetworkAgent
  Unify registration and NM assignment in NAI
  Return the registry in registerNetworkAgent.

Jean Chalard   authored and   Gerrit Code Review   commited 2025-03-16 15:57:51 -07:00
f04de0efc1
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
Implement RealtimeScheduler in DiscoveryExecutor
This provides more accurate delay callbacks, thereby enhancing
the executor's overall functionality.

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

Paul Hu   commited 2025-03-16 14:45:00 +00:00
0f4d1ab4d9
Merge "no-op: Remove checkAndNotifyCommonError with ResultReceiver" into main
Quang Luong   authored and   Gerrit Code Review   commited 2025-03-14 23:53:01 -07:00
67055ed7a8
Merge "Fix TetheringTest.failureEnablingIpForwarding verification count" into main
Quang Luong   authored and   Gerrit Code Review   commited 2025-03-14 19:51:47 -07:00
856f57a0ce
Fix TetheringTest.failureEnablingIpForwarding verification count
failureEnablingIpForwarding verifies that TetheringMetrics sends one
more error report than it should. This extra verification is caused by
any(class) being passed into the mock WifiManager.startTetheredHotspot,
which does not match null even though the actual code passes in a
null. This results in an extra failure that causes the extra error
report call.

Fix this by replacing any(class) with null, and removing the extra error
verification.

Bug: 216524590
Test: atest TetheringTest
Change-Id: I93986a999d573a186696e54793563e2be8405f39

Quang Anh Luong   commited 2025-03-15 10:42:22 +09:00
3b6ee54cf6
Merge "Add CompatibilityVersion v2 to CT downloader" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-14 09:26:07 -07:00
d64a649df9
Add CompatibilityVersion v2 to CT downloader
Bug: 377276991
Test: atest NetworkSecurityUnitTests
Change-Id: Ia8b7b7893b7edad6d108886eca12341703d3c8a0

Sandro Montanari   commited 2025-03-14 14:46:59 +00:00
af205e3b89
Merge "Move CronetInTetheringApexDefaults to //external/cronet" into main
Stefano Duo   authored and   Gerrit Code Review   commited 2025-03-14 06:57:05 -07:00
e02492ab14
Merge "Add a method to help mocking registerNetworkAgent" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-14 01:25:28 -07:00
13a5d4b36e
no-op: Remove checkAndNotifyCommonError with ResultReceiver
There are currently two variants of checkAndNotifyCommonError that do
the exactly the same thing, except one uses IIntResultListener and
another uses ResultReceiver. Remove the lesser-used ResultReceiver
variant and just use the IIntResultListener instead (with a
IIntResultListener wrapper for the ResultReceiver).

Bug: 216524590
Test: covered by existing tests
Change-Id: I292a96b32cd975852a52c7953b03bcb35728db24

Quang Anh Luong   commited 2025-03-14 15:27:49 +09:00
d7c6e3022b
Merge "Add yuyanghuang@ to OWNERS_core_networking_xts for APF firmware tests" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2025-03-13 21:32:45 -07:00
b7fc5dc3c0
Add a queue system server-side for NetworkAgent
The intent is to remove the queue on the NetworkAgent side.
This queue is triggered with the same conditions as the
existing one.

Test: ConnectivityCoverageTests, CtsNetTests
Change-Id: I4bc29b10e48e13cdf3c3a8a15a7c8d15954d2457

Chalard Jean   commited 2025-03-14 13:23:50 +09:00
34ccc71462
Unify registration and NM assignment in NAI
Registration is marked by the creation of the network monitor
for a given network agent. This patch makes this fact much
more ovbious.

Test: CtsNetTests ConnectivityCoverageTests
Change-Id: I94a56b2bce6f453322b1eb91d6a6f14b31e7a95f

Chalard Jean   commited 2025-03-14 13:23:50 +09:00
2e2f5faecd
Return the registry in registerNetworkAgent.
This is a resubmit of
I0fd90716b9f5501bdcdc7ee5165321737a0076ae
which did not account for testing of this private method
in Telephony tests.

Also make the network agent registry two way to eliminate
reordering possibilities.

Test: ConnectivityCoverageTest, CtsNetTests
Change-Id: I9ca025b1369dcb1202f906d5cff79e3d935b40da

Chalard Jean   commited 2025-03-14 13:23:50 +09:00
80d4326d76
Add a method to help mocking registerNetworkAgent
This is a trick to help mocking registerNetworkAgent without
having to import its return type. In the near future the
return type will be changed to a non-public class, which
can't be seen in CTS.

Really this shouldn't be necessary because only Connectivity
tests should mock ConnectivityManager, but the practice is
different and other mockers need this support.

See also aosp/3538922

Test: NetworkAgentTest
Change-Id: I3ac63d95d3830a3b413f9ad12b84ac426b63dd08

Chalard Jean   commited 2025-03-14 13:23:37 +09:00
8fd6347d35
Add yuyanghuang@ to OWNERS_core_networking_xts for APF firmware tests
This commit adds yuyanghuang@ to the OWNERS_core_networking_xts file,
specifically for APF firmware tests that verify the correct behavior of
the Wi-Fi APF interpreter.

Test: TH
Change-Id: Ifa0243f342a7844bd06f0e42ba09f16e3bf34058

Yuyang Huang   commited 2025-03-14 13:16:04 +09:00
5ec4aeec41
Merge "[Thread] prefer only ML-EID in case OMR is missing" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-13 19:19:42 -07:00
93fa683874
Merge "Use NLM_F_REQUEST_ACK in createGetLinkMessage()" into main
Chuwei He   authored and   Gerrit Code Review   commited 2025-03-13 17:43:25 -07:00
9981725b18
Merge "Creating interface name to index tracking for Bpf Maps." into main
Sarup Dalwani   authored and   Gerrit Code Review   commited 2025-03-13 17:05:21 -07:00
9e15d35d01
Merge "Add Ping4 offload for APFv6 multi-devices tests" into main
Maciej Ĺ»enczykowski   authored and   Gerrit Code Review   commited 2025-03-13 12:03:23 -07:00
fab8a76659
Merge "Add at_least_B() decorator to restrict multi-device tests to Android B+ capable device." into main
Maciej Ĺ»enczykowski   authored and   Gerrit Code Review   commited 2025-03-13 12:01:33 -07:00
d5dd81741c
Merge changes from topic "revert-3527440-JRJJTQBUFC" into main
* changes:
  Revert "Reject TetheringRequests that fuzzy-match existing ones"
  Revert "Stop tethering request only if fuzzy-matched to existing..."

Priyanka Advani (xWF)   authored and   Gerrit Code Review   commited 2025-03-13 11:43:21 -07:00
99ef00112e
Revert "Reject TetheringRequests that fuzzy-match existing ones"
Revert submission 3527440

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

Reverted changes: /q/submissionid:3527440

Change-Id: Ife596c639899528778f53fef797749fa88596dd6

Priyanka Advani (xWF)   commited 2025-03-13 10:22:16 -07:00
01b6b070ad
Revert "Stop tethering request only if fuzzy-matched to existing..."
Revert submission 3527440

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

Reverted changes: /q/submissionid:3527440

Change-Id: I31ae861d5151c9db7e559ba19db7f07c9545d422

Priyanka Advani (xWF)   authored and   Gerrit Code Review   commited 2025-03-13 10:22:16 -07:00
e72faa10ed
Creating interface name to index tracking for Bpf Maps.
Adding mechanism to track interaface name to interface index, this map
would be used by BpfNetMaps for storing interface index.

Bug: 400681214
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.InterfaceTrackerTest
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.BpfNetMapsTest
Change-Id: I2a65cac908d9c4d10714e3fe26be20322d4a1db3

Sarup Dalwani   commited 2025-03-13 17:04:54 +00:00
53ecd95072
Add Ping4 offload for APFv6 multi-devices tests
Introduce Ping4 offload support for improved APFv6 multi-device testing.
Adds a decorator to restrict tests to Android B+ capable client device.

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

Jimi Chen   commited 2025-03-13 14:05:26 +00:00
0f3f5517e1
Add at_least_B() decorator to restrict multi-device tests to Android B+ capable device.
Test: TH
Change-Id: Id5fde8c59560bb84bed062331121c3524f362c7b

Jimi Chen   commited 2025-03-13 14:05:09 +00:00
476552a7ae
Enable the cached service removal feature by default
The nsd_cached_services_removal flag has been successfully rolled
out to the public stage on Pixel devices and has significantly
improved the Nearby connection success rate. Consequently, this
flag should be enabled by default with a kill switch, allowing
the feature to be deployed to all production devices.

Bug: 352629221
Test: atest ConnectivityCoverageTests NsdManagerTest
Change-Id: Ib37b94d729e4d9a8da6f3e574bf149141ebe4a56

Paul Hu   commited 2025-03-13 11:34:18 +00:00
39959b1cb3
[Thread] prefer only ML-EID in case OMR is missing
This is to avoid applications uses Aloc address for source address which
would cause issues when there are multiple devices sharing the same
Aloc.

Bug: 396019291

Change-Id: I287007ddecd9d0fa2ac8da92f4de691e7844b259

Kangping Dong   commited 2025-03-13 15:27:37 +08:00
74a6ca6478
Merge changes Ia8a8eab7,I1e193f35 into main
* changes:
  Stop tethering request only if fuzzy-matched to existing request
  Reject TetheringRequests that fuzzy-match existing ones

Quang Luong   authored and   Gerrit Code Review   commited 2025-03-12 23:20:13 -07:00
a4b6164304
Stop tethering request only if fuzzy-matched to existing request
stopTethering with a TetheringRequest should only stop tethering if
there is an existing request (pending or serving) that fuzzy-matches the
input and whose UID matches the caller (unless the caller is Settings,
which is allowed to remove any request).

If there is no existing fuzzy-matched request, return
TETHER_ERROR_UNKNOWN_REQUEST.

Bug: 216524590
Test: atest TetheringTest RequestTrackerTest TetheringManagerTest
Change-Id: Ia8a8eab78fbecd38321fd0d48734855cff16febb

Quang Anh Luong   commited 2025-03-13 12:49:08 +09:00
a73b21ac11
Reject TetheringRequests that fuzzy-match existing ones
Legacy behavior will return success results to multiple startTethering
calls of the same type, even though the link layer can only support one
of those requests at a time (other than tethered AP + LOHS).

For B+, clean up this behavior by only allowing the amount of requests
that the link layer can concurrently support. To do this, we'll
introduce the concept of "fuzzy-matching" such that if a new request
fuzzy-matches an existing request (either pending or serving), this
indicates that the link layer cannot support the new request
concurrently, and we'll fail the new request with
TETHER_ERROR_DUPLICATE_REQUEST.

To keep track of serving requests, we'll store the request and it's
IpServer in RequestTracker when we call IpServer.enable(), and we'll
remove it (indexed by IpServer) when
1) Calling IpServer.onStop()
2) Calling IpServer.unwanted()
3) We detect an IpServer transition to AvailableState with error code

Bug: 216524590
Test: atest TetheringTest RequestTrackerTest TetheringManagerTest
Change-Id: I1e193f3595a48f806fb70fd08630a12ce2631a59

Quang Anh Luong   commited 2025-03-13 11:11:17 +09:00
2add9260ef
Use NLM_F_REQUEST_ACK in createGetLinkMessage()
This rtnl message is used with sendOneShotKernelMessage() which expects
that kernel returns an ACK. We need to set NLM_F_ACK explicitly for
that.

Bug: 379021505
Test: Manually run and no more exception with EAGAIN.
Change-Id: Iba21fedf60f5eca63eceee9362e252952bb805c1

Chuwei He   commited 2025-03-12 18:30:04 -07:00
03a10fd14d
Move CronetInTetheringApexDefaults to //external/cronet
The JNI libs that this target depends on are going to be shimmed on top
of ToT and Stable Cronet. This reduces the number of cross-repo dependencies, making that change simpler (see http://aosp/3507996).

Test: m
Bug: b:396593141
Change-Id: I5e8ab89ea0ebe6a82f006568f30961dcf2f0603e

Stefano Duo   commited 2025-03-12 10:00:42 -07:00
279ba624bc
Merge "Invoke tcpdump with -l" into main
Junyu Lai   authored and   Gerrit Code Review   commited 2025-03-12 02:18:14 -07:00
ca91ebdcab
Fix flaky test for trel service discovery
When checking for trel services published by a BR, we need to filter the
services by their service name, since there might be other devices
publishing trel service at the same time.

Bug: 399518677
Change-Id: I56518dbe6c79b48aa048073d8556a53e1261e8bd

Yang Sun   commited 2025-03-12 07:18:16 +00:00
ffd3986c99
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
Merge "Use SdkLevel.isAtLeastB() instead of SDK_INT" into main
Quang Luong   authored and   Gerrit Code Review   commited 2025-03-11 14:42:37 -07:00
b453055426
Merge "Only allow one pending bluetooth request at a time" into main
Quang Luong   authored and   Gerrit Code Review   commited 2025-03-11 14:39:30 -07:00
7fb9055ff3
Merge "Revert "Return the registry in registerNetworkAgent."" into main
Chaitanya Cheemala (xWF)   authored and   Gerrit Code Review   commited 2025-03-11 08:22:41 -07:00
82c551e08e
Revert "Return the registry in registerNetworkAgent."
This reverts commit 70ede3260c.

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

Change-Id: If72cc264c5e505348309c6c11dbbfd11adeaf31b

Chaitanya Cheemala (xWF)   authored and   Gerrit Code Review   commited 2025-03-11 06:05:49 -07:00
846fb39e8a
[thread] loose the restrictions on ThreadNetworkManager APIs
1. We don't need to assert that ThreadNetworkManager is always null
   when the Thread hardware features are not present. There can be more
   useful Thread features which don't require the hardware
2. The getAllThreadNetworkControllers() API has no documentation says
   the returned list is guaranteed not empty.

Change-Id: Ie77110067ff670053a2125b30b2791b9f54b2582

Kangping Dong   commited 2025-03-11 20:58:51 +08:00
17740cb799
Merge changes from topic "thread-router" into main
* changes:
  [thread] refactor the settings module
  [thread] Support non-BR mode

Kangping Dong   authored and   Gerrit Code Review   commited 2025-03-11 03:37:36 -07:00
7cb5078ba1