Commit graph

109,899 commits

Message SHA1
[Thread] do not set the country code again if the co-processor doesn't support it
Some the co-processors do not support setting the country code. This
commit enables the CountryCode module doesn't set the country again
after it knows that the co-processor doesn't support setting the
country code.

Bug: b/402276117
Test: atest ThreadNetworkUnitTests:ThreadNetworkCountryCodeTest#setCountryCodeNotSupported_returnUnsupportedFeatureError_countryCodeNotSetAgain

Change-Id: I8ca1f7aed3774a086e114e91d8100fb7fe9e3664

Zhanglong Xia   commited 2025-03-18 03:01:59 +00:00
f6187b99c7
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
[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
Merge "Fix flaky tests of route propagation from netdata to tun interface in ThreadIntegrationTest" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-11 02:18:20 -07:00
c2eba15017
[thread] refactor the settings module
The current settings APIs have a few issues:
1. It doesn't support default value which is derived from resource
   overlays
2. It exposes the default values of settings entries as public APIs
   while they shouldn't be

Bug: 401654864

Change-Id: I1bbe3f14507a497320401f02fa6da512558fe385

Kangping Dong   commited 2025-03-11 17:09:29 +08:00
d9bbec2fa1
[thread] Support non-BR mode
This commit adds a resource overlay config for OEMs to disable the
Border Router feature by default. Also updates the tests to cover both
BR and non-BR use cases

Bug: 401654864
Change-Id: I7dd4363836269a08853b58304f62fe52f9021a9e

Kangping Dong   commited 2025-03-11 17:09:29 +08:00
82988c3d98
Use SdkLevel.isAtLeastB() instead of SDK_INT
Replace the explicit SDK_INT checks with the helper function
SdkLevel.isAtLeastB().

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

Quang Anh Luong   commited 2025-03-11 17:16:56 +09:00
96f8e1b787
Fix flaky tests of route propagation from netdata to tun interface in ThreadIntegrationTest
Wait for route to be added/removed from link properties in the tests
instead of checking immediately, as it takes time for the change to
propagate from ot.

Bug: 401815392
Change-Id: Ie95f4beaa370514d31875b9f2e926762a38bc99e

Yang Sun   commited 2025-03-11 07:40:38 +00:00
82cdf67a19