Commit graph android_packages_modules_Co.../thread
Message SHA1
Merge "Thread: simulate Thread on eth1 for tests" into main
Yakun Xu   authored and   Gerrit Code Review   commited 2024-05-17 03:52:14 +00:00
99d5727954
Merge "Thread: add multi-device test" into main
Yakun Xu   authored and   Gerrit Code Review   commited 2024-05-17 03:52:14 +00:00
45d7e1cffd
Thread: simulate Thread on eth1 for tests
This commit changes OpenThread to simulate on eth1 instead of loopback interface.

Bug: 329188649
Test: presubmit
Change-Id: I80a2842be02c03c5987ac8be8368fa86d7c6bace

Yakun Xu   commited 2024-05-16 15:32:08 +08:00
7bc7d69e1e
Thread: add multi-device test
This commit adds a basic multi-device test for Thread network.
Two nodes are used. One creates a network and the test verifies
the other one can discover it by Thread scan.

Test: presubmit
Bug: 329188649
Change-Id: Ice03015838bbf6fe836fac48c659a97850a89132

Yakun Xu   commited 2024-05-16 15:19:48 +08:00
f05592620f
Merge "Add netdata prefixes to tun interface routing table." into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-05-15 19:34:04 +00:00
43b62ae5ff
Add netdata prefixes to tun interface routing table.
When there are thread devices with DUA in the thread network, BR itself
may not have a DUA address, so it doesn't have route to DUA in the
thread-wpan routing table. When thread device sends a packet from the
DUA to AIL via BR, BR rpfilter would drop the packet. Adding the route
to DUA prefix in thread-wpan solves this problem.

Bug: 335762753

Test: atest ThreadNetworkIntegrationTests:android.net.thread.ThreadIntegrationTest#addPrefixToNetData_routeIsAddedToTunInterface
atest ThreadNetworkIntegrationTests:android.net.thread.ThreadIntegrationTest#removePrefixFromNetData_routeIsRemovedFromTunInterface

Change-Id: I5ca8f7e723116a63718734f72f1b463d9c380329

Yang Sun   commited 2024-05-15 22:26:35 +08:00
14de932e9b
Merge "Remove logging of notify thread enabled state." into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-05-15 12:24:43 +00:00
d199b6a232
Remove logging of notify thread enabled state.
This is already logged in ot-daemon when the state is updated.

Bug: 338695689
Change-Id: Ib8eb8b9fca3271e85a4915150ff0af4fee8847e1

Yang Sun   commited 2024-05-15 19:02:10 +08:00
5b929f6767
Merge "[Thread] rename isEnabled() to shouldEnableThread()" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-05-11 05:10:48 +00:00
5f2f7309db
Merge "[Thread] add airplane mode support" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-05-11 03:55:20 +00:00
0bf21e6f58
[Thread] rename isEnabled() to shouldEnableThread()
Follow up comments in aosp/3079292

Change-Id: I7d95a653cb08549fd30994e95f11794f0a7aac80

Kangping Dong   commited 2024-05-11 11:51:45 +08:00
eb51ad9cb0
[Thread] add airplane mode support
Listens to airplane mode in Thread system service and enables/disables
Thread accordingly:
1. When airplane is on, disable Thread but don't persist the state
2. If Thread is explicitly enabled when airplane mode is on, Thread will
   be enabled and the choice is remembered so that Thread will not be
   disabled the next time airplane mode is turned on
3. If Thread is explicitly disabled when airplane mode is on, it will be
   considered that the user wants to disable when airplane mode is
   turned on, so Thread will be auto disabled the next time airplane
   mode is turned on

The behavior described above is consistent with Wi-Fi and bluetooth.

Bug: 322742298
Change-Id: I1750922d9c304095e4114cddfbfe24d70d0e223a

Kangping Dong   commited 2024-05-10 16:14:12 +08:00
8e68015475
ThreadIntegrationTest: use longer ping timeout when reply is expected.
The ping timeout was 0.1s to keep the tests short, this may not be
enough to receive ping reply. When test case expects ping reply to be
received we can use a longer timeout of 1s.

Bug: 338061061

Test: atest ThreadNetworkIntegrationTests:android.net.thread.ThreadIntegrationTest#edPingsMeshLocalAddresses_oneReplyPerRequest
Change-Id: I988fb8973735d9b082c5b8c3c57566b950ae804b

Yang Sun   commited 2024-05-08 16:44:00 +08:00
d36928c916
[icmp] Add test to verify no duplicated icmp echo reply on mesh-local
addresses.

Bug: 333493455

Test: atest ThreadNetworkIntegrationTests:android.net.thread.ThreadIntegrationTest#edPingsMeshLocalAddresses_oneReplyPerRequest

Change-Id: I07aefa1311f15d3f801de64c0342694296f09469

Yang Sun   commited 2024-04-29 16:21:16 +08:00
d722a997bd
[Thread] fix CTS for U branches
Per aosp/2936050, before Android V, an App needs to explictily set
NET_CAPABILITY_LOCAL_NETWORK to request a Thread network. This CL
updates the test case so it can pass on U devices.

Bug: 336678348
Test: atest CtsThreadNetworkTestCases

Change-Id: I383e34cb94f67286c5a5ab3bad7a11d98c3c2871

Handa Wang   commited 2024-04-24 05:12:58 +00:00
42ea5408ae
Merge "Add OT multicast addresses to tun interface." into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-04-12 06:39:26 +00:00
aa72ee2dd5
Add OT multicast addresses to tun interface.
Bug: 333668308

Test: atest ThreadNetworkIntegrationTests:android.net.thread.ThreadIntegrationTest#joinNetwork_tunInterfaceJoinsAllRouterMulticastGroup
Change-Id: I0bb91259ae5cbe0eb9c5d71b7aa4e5b2a95f8c6b

Yang Sun   commited 2024-04-11 00:54:25 -07:00
244dce3722
Merge "[Thread] ignore the flaky test case advertisingProxy_srpClientUnregistersService_serviceIsNotDiscoverableByMdns" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-04-11 03:12:30 +00:00
e67e1a7166
[Thread] ignore the flaky test case advertisingProxy_srpClientUnregistersService_serviceIsNotDiscoverableByMdns
The flakiness of this test case is 1%. Disable the test case to prevent
the whole test module from being demotioned.

Bug: 333078476
Bug: 333806992
Change-Id: I820f7a567a7827eee280d0f545c9f654efe5eeaa

Handa Wang   commited 2024-04-11 01:51:06 +00:00
7ade29d142
Merge "[Thread] ignore the flaky test case meshcopService_joinedNetwork_discoveredHasNetwork" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-04-10 10:17:31 +00:00
9671e9a6d8
Merge "dataset selects a channel from channel 11 to 24" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-04-10 08:27:58 +00:00
e435650d41
Merge "[Thread] loose the restriction on the setEnabled API behavior" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-04-10 08:20:09 +00:00
df357e3612
dataset selects a channel from channel 11 to 24
Many Thread radio chips need to reduce their transmit power on edge
channels to pass regulatory RF certification. This CL restrcits the
dataset to select a channel from channel 11 to 24.

Bug: b/331708479
Test: atest ThreadNetworkUnitTests
Change-Id: I758c9f33629a0cafcc39bb9fde0ad45ab2699db8

Zhanglong Xia   commited 2024-04-10 14:43:17 +08:00
dac352d489
[Thread] ignore the flaky test case meshcopService_joinedNetwork_discoveredHasNetwork
Bug: 333649897
Bug: 332782903

Test: CI

Change-Id: I74e8e00f709c5820c58b85dbf90f2ab8019eb65a

Handa Wang   commited 2024-04-10 06:31:11 +00:00
81804470f9
[Thread] loose the restriction on the setEnabled API behavior
It's too strict that the device must rejoin the network after being
enabled again. This probably don't work on mobile devices. remove the
CTS case for now.

Change-Id: I3a4511f4b2fddddf982206720bbb61f718bc8327

Kangping Dong   commited 2024-04-10 13:06:43 +08:00
504fe7d510
Dynamically set mesh-local addresses preferred lifetime.
When there is an active OMR address(not deprecated), set the mesh-local
addresses as non-preferred. When there is no active OMR address, set
the mesh-local addresses as preferred.

Bug: 323624146

Test: atest ThreadNetworkIntegrationTests

Change-Id: I969c20ddadfd2d0bd97499da48efc9b32cfa7e0b

Yang Sun   commited 2024-04-09 02:26:00 -07:00
79b202ac9f
[Thread] wait for Thread address updates on thread-wpan
There are timing issues in the current
tunInterface_joinedNetwork_otAddressesAddedToTunInterface test that the
OT addresses (e.g. Leader ALOC) may be updated after the device
attaches while the test doesn't wait for the addresses being propagated
to the system_server.

This commit fixes this issue by waiting for the addresses check for 1
seconds before timing out.

Bug: 333078476
Change-Id: If672aab7535f200bd38b50f1ce691b7c32e4cc75

Kangping Dong   commited 2024-04-07 15:04:53 +08:00
8f105009af
[Thread] add E2E UDP test for app usage
Bug: 323300829
Bug: 325983649
Change-Id: I0e6b9029cb58a2b985e80003d6339e536d706ed3

Kangping Dong   commited 2024-04-04 18:52:53 +08:00
e9daad6264
Merge "[Thread] add NetworkCapability.NOT_METERED for Thread network" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-04-02 08:49:58 +00:00
8b15cc8f8e
[Thread] add NetworkCapability.NOT_METERED for Thread network
Thread is an unmetered network so we should add this capability.

Bug: 332219983
Test: `bw_costly_thread-wpan` won't show up after this CL.
Change-Id: I0818700e5e7aad04ae15b0d0fd4490ab3f12839e

Handa Wang   commited 2024-04-02 07:40:14 +00:00
a92080f443
[Thread] enable Service Discovery integration tests
Bug: 328527773
Bug: 332452386

Test: atest ThreadNetworkIntegrationTests:android.net.thread.ServiceDiscoveryTest

Change-Id: Ib1bc690c4f5bfcc30d4fb11b472fb4095505f1ef

Handa Wang   commited 2024-04-02 05:38:02 +00:00
b40140dcd0
[Thread] discover and resolve the meshcop service only on test network
The test case is flaky because the service is unexpectedly discovered
after it's already unregistered. Probably this is due to that on the
WiFi interface NsdManager somehow didn't hear the goodbye PTR for the
service so it can still 'discover' the service. Limiting the discovery
on test network may help avoid the flake because test network is
cleaner.

Bug: 331878313
Test: https://android-build.corp.google.com/builds/abtd/run/L17400030002839695

Change-Id: Icc09aae00cd90f64428387b97dbd9743140641e5

Handa Wang   commited 2024-04-01 01:26:56 +00:00
a449374772
Merge "set the country code when initializing the ot-daemon" into main
Zhanglong Xia   authored and   Gerrit Code Review   commited 2024-03-28 10:48:51 +00:00
1038c141fe
Merge "[Thread] remove queueing mechanism for NsdPublisher" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-03-28 09:20:37 +00:00
de10473d94
Merge "Separate Struct.java into its own lib." into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-03-28 06:23:57 +00:00
68d68d82ed
Merge "[Thread] add a unicast routing case when infra link switches" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-03-28 06:06:29 +00:00
28090042b6
[Thread] add a unicast routing case when infra link switches
Bug: 331567763
Test: atest ThreadNetworkIntegrationTests:android.net.thread.BorderRoutingTest#unicastRouting_afterInfraNetworkSwitchInfraDevicePingThreadDeviceOmr_replyReceived

Change-Id: I3bb0d4c8b1ab8d5e68c2fdcb854175d04dbe5336

Handa Wang   commited 2024-03-28 03:56:32 +00:00
d9e4ba6d26
[Thread] use toHexString for toString()
dumpHexString will create additional representations other than a HEX string, it's suitable for raw logging message but not in a Object#toString.

Change-Id: I184eb10bafa2db1103a4ef5cf82250db52aec278

Kangping Dong   commited 2024-03-28 03:54:11 +00:00
21e5d68f74
set the country code when initializing the ot-daemon
The country code is lost after the ot-daemon is restarted. This
CL stores the country code to persistent settings and reads
out the previously stored country code to set the country code
when the ot-daemon is initialized.

Bug: b/326021472
Test: atest ThreadNetworkUnitTests

Change-Id: I6982a57ba4845f5a45f3366400c531398e82339e

Zhanglong Xia   commited 2024-03-28 10:36:24 +08:00
4eab54b40e
Separate Struct.java into its own lib.
* Struct.java is removed from net-utils-device-common-bpf and
  net-utils-device-common-struct's source list
* Created a lib net-utils-device-common-struct-base for Struct.java
* Updated libs that require Struct.java to include
  net-utils-device-common-struct-base.
* Replaced net-utils-multicast-forwarding-structs with
  net-utils-device-common-struct in service-connectivity

Bug: 323503345

Test: build tethering module.
Change-Id: I3f60715c3d8043b7569db7612dee9d4fa1ccba59

Yang Sun   commited 2024-03-27 20:15:17 +08:00
3aa62e6773
[Thread] remove queueing mechanism for NsdPublisher
The queueing mechanism is not needed because b/323300118 is fixed.

Bug: 331512403
Bug: 323300118
Test: atest CtsThreadNetworkTestCases

Change-Id: Id7e868db69668494c1c7e3c473931a3087dc5755

Handa Wang   commited 2024-03-27 09:01:52 +00:00
05571d4a08
Merge "[Thread] add logs for Thread enabled state" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-03-27 03:49:11 +00:00
40029ad089
[Thread] add logs for Thread enabled state
Change-Id: I62bd170dc12dde7663e5811133709847e1808675

Kangping Dong   commited 2024-03-26 14:21:20 +00:00
edee1cac9b
Merge "Update THREAD_ENABLED key string in ThreadPersistentSettings" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-03-26 11:18:35 +00:00
f2832c79d6
Update THREAD_ENABLED key string in ThreadPersistentSettings
Updated from Thread_enabled to thread_enabled

Test: presubmit
Change-Id: If0296f4d4bdf37f4564ee6fabdeffffe9d3020dd

Yang Sun   commited 2024-03-26 17:13:32 +08:00
2d4f91d548
check the Thread required features before running ThreadNetworkControllerTest
This CL checks if the device supports Thread specific features before
running the test case ThreadNetworkControllerTest. If the device
doesn't support specific features, just skip the test case.

Bug: b/330879812
Test: atest ThreadNetworkIntegrationTests
Change-Id: I1452ab02cc62228102d4a140f39abf13b79542c7

Zhanglong Xia   commited 2024-03-26 13:20:24 +08:00
c1d4e1eea1
[mdns] support discovering and resolving services
Bug: 305866779
Test: atest ThreadNetworkIntegrationTests:android.net.thread.ServiceDiscoveryTest

Change-Id: I96ee5b835c90fa55136dbbde68d36bbf2044b420

Handa Wang   commited 2024-03-22 06:32:23 +00:00
abefbf0b9f
Merge "[Thread] fix ot-daemon state consistency issues" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-03-22 06:31:18 +00:00
3a9d363bdf
Merge "[Thread] fix access to mOtDaemon" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-03-22 05:16:01 +00:00
619c41c01c
[Thread] fix ot-daemon state consistency issues
1. the OtDaemonState in OtDaemonCallbackProxy class is not cleared when
   ot-daemon dies
2. register ot-daemon state callback within the IOtDaemon#initialize API
   to avoid missing state changes between initialize() and
registerStateCallback()

Bug: 330441708
Change-Id: Ice58566582b40a6d25627cf01dec93da61ad3596

Kangping Dong   commited 2024-03-22 10:58:24 +08:00
0d22aded3d