Commit graph android_packages_modules_Co.../thread
Message SHA1
[Thread] fix the failure in ThreadIntegrationTest
This test had an assumption that Thread is enabled which is not true. This CL enables Thread in the setUp().

Bug: 397583601
Change-Id: I9c4d5028a663c6fe1c581267ff7d172d0cba577c

Handa Wang   commited 2025-02-19 01:20:23 -08:00
424aec63e2
[Thread] allow disabling border router auto-join
Test: verified that when the config is set to `false`, thread won't start up after reboots:
```
➜  main-aosp-2 adb shell ot-ctl state
leader
Done
➜  main-aosp-2 adb reboot
➜  main-aosp-2 adb shell ot-ctl state
/system/bin/sh: ot-ctl: inaccessible or not found
➜  main-aosp-2 adb root
➜  main-aosp-2 adb shell ot-ctl state
disabled
Done
```

Bug: 378587036
Change-Id: I4d1c90ab3121f39219cbaf795879a7ba91db02a3

Kangping Dong   commited 2025-01-10 00:09:06 -08:00
d2fc66d4bb
Merge "[Thread] allow disabling SRP server wait for border routing" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2025-01-09 21:54:49 -08:00
7b7ff96c29
[Thread] allow disabling SRP server wait for border routing
It's default enabled that it waits for border routing establishment
before starting the SRP server. But there are also use cases where
the user may want to know what are the devices in the Thread network
before actually reach to the devices, or it doesn't depend on border
routing to reach to a Thread device.

Given that, this commit adds the support of starting SRP server
without waiting for border routing by adding a new
Runtime Resource Overlay configuration parameter:
config_thread_srp_server_wait_for_border_routing_enabled

Test: it's difficult to assert on the SRP server starts up timing. But manually verified that the SRP server starts without waiting for the routing manager when the RRO config is flipped:

```
01-09 20:18:35.835  7555  7555 I ot-daemon: [I] RoutingManager: RsSender: Sent RS 1/3
01-09 20:18:35.835  7555  7555 I ot-daemon: [I] RoutingManager: Received RS from fe80:0:0:0:98af:44ff:fe2e:fa80 on infra netif 17
01-09 20:18:35.835  7555  7555 I ot-daemon: [I] RoutingManager: Will evaluate routing policy in 00:00.150 (150 msec)
01-09 20:18:35.926  7555  7555 I ot-daemon: [I] NetDataPublshr: DNS/SRP service - State: Adding -> Added
01-09 20:18:35.926  7555  7555 I ot-daemon: [I] SrpServer-----: Start listening on port 53536
01-09 20:18:35.926  7555  7555 I ot-daemon: [I] NetworkData---: Sent ServerData
01-09 20:18:35.926  7555  7555 I ot-daemon: [I] NetworkData---: Received ServerData
01-09 20:18:35.926  7555  7555 I ot-daemon: [I] NetworkData---: Allocated Service ID = 1
01-09 20:18:35.926  7555  7555 I ot-daemon: [I] NetworkData---: Sent ServerData ack
01-09 20:18:35.926  7555  7555 I ot-daemon: [I] Notifier------: StateChanged (0x00000200) [NetData]
01-09 20:18:35.926  7555  7555 I ot-daemon: [I] Mle-----------: Send Data Response (ff02:0:0:0:0:0:0:1)
01-09 20:18:35.926  7555  7555 I ot-daemon: [I] BbrLeader-----: PBBR state: Unchanged
01-09 20:18:35.926  7555  7555 I ot-daemon: [I] BbrLeader-----: Rloc16:0x8800, seqno:69, delay:5, timeout:3600
01-09 20:18:35.926  7555  7555 I ot-daemon: [I] RoutingManager: Will evaluate routing policy in 00:03.558 (3558 msec)
01-09 20:18:35.926  7555  7555 I ot-daemon: [I] NetDataPublshr: DNS/SRP service (state:Added) in netdata - total:1, preferred:0, desired:2
```

Bug: 378587036
Change-Id: Ib768014f3c44dca89390cec823a1c2acac38ab0d

Kangping Dong   commited 2025-01-09 04:23:17 -08:00
fad62be2d2
Add logs in IntegrationTestUtils.kt for service discovery
Bug: 338061061
Change-Id: I17f52e7272c42c3a347e32b89d9d0a64edabcd4e

Yang Sun   commited 2025-01-02 16:53:35 +08:00
be81b8415c
Enable ThreadNetworkDemoApp for TV launcher
Bug: 384628457
Test: Verified the App shows up in the launcher of an Android TV locally

Change-Id: I5c41a76e1856b24ba588549a44c04d145ca09254

Handa Wang   commited 2024-12-16 22:57:58 -08:00
0d03b260bc
Merge "Handle non IPv6 packet in getRaPios" into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-12-06 05:35:26 +00:00
5123022755
Handle non IPv6 packet in getRaPios
Bug: 338061061

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

Change-Id: Ia637dc8ec4cca919bd1957148ec2c104ab1895ac

Yang Sun   commited 2024-12-06 02:18:22 +00:00
5b018cfd06
[Thread] refactor OtDaemonServer::Initialize argument order
see aosp/3391987 for background

Change-Id: I798bfc172e3207c97d520785d62f5381c9d050ad

Kangping Dong   commited 2024-12-05 15:54:55 +08:00
7ce2471354
Merge "Add WRITE_ALLOWLISTED_DEVICE_CONFIG when modifying DeviceConfig" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-11-25 05:40:31 +00:00
9a07a34c64
Add WRITE_ALLOWLISTED_DEVICE_CONFIG when modifying DeviceConfig
Bug: 380648508
Test: atest ThreadNetworkControllerServiceTest
Change-Id: I36908316f5eef6a3712c98f5901a5c162db3471c

Yang Sun   commited 2024-11-25 10:00:32 +08:00
4b43c079ff
Merge "Add test for TREL service not unpublish when feature disabled" into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-11-21 07:10:55 +00:00
5c66824a44
Add test for TREL service not unpublish when feature disabled
Bug: 379804913

Change-Id: I8dd98a0605dd7e9c53b144f6227791a2080e8263

Yang Sun   commited 2024-11-21 10:22:32 +08:00
51d7725e08
Merge "Configure TREL feature from feature flag." into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-11-19 06:08:23 +00:00
41fa2d75a1
Configure TREL feature from feature flag.
Bug: 354868035
Bug: 359089751

Test: atest ThreadNetworkIntegrationTests:ServiceDiscoveryTest#trel_servicePublished

Change-Id: Ib545df6bf5ce20f35914b4695dbd2e3c1e1232e4

Yang Sun   commited 2024-11-18 20:13:00 +08:00
bb7efba754
Merge "[Thread] Add a NAT64 test case after switching to another infra network" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-11-16 08:07:12 +00:00
7c064a8a27
Merge "[Thread] introduce TestTunNetworkUtils and use it in existing test cases" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-11-13 05:43:32 +00:00
7175f59956
[Thread] Add a NAT64 test case after switching to another infra network
Bug: 377618622
Change-Id: I699a218a3bb18582406654381cd31c26675f3c77

Handa Wang   commited 2024-11-13 05:20:03 +00:00
26a68af724
[Thread] introduce TestTunNetworkUtils and use it in existing test cases
TestTunNetworkUtils is a centralized place to control the test TUN networks used by integration test. With this we can safely tear down all test networks in `teardown()` instead of tearing down the newly created network in `finally` clause.

Bug: 377640059
Change-Id: I57b34bb2644bd6a5bb73ed1573932f35de657c8f

Handa Wang   commited 2024-11-13 04:29:10 +00:00
ebd31b8a6a
Merge "remove useless variable" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-11-12 10:28:52 +00:00
4205696aaf
[Thread] avoid re-setting the infra link state when the state doesn't change
In the situation where infra state changes very frequently, it may cause the border routing to frequently restart.

Bug: 377821980
Test: atest ThreadNetworkIntegrationTests

Change-Id: Id2862b0db7e01f89da20c56c4ad2f0086d4b6a98

Handa Wang   commited 2024-11-07 08:13:03 +00:00
0435210627
[Thread] add integration tests for aosp/3334156
Bug: 374037595
Change-Id: I1a380067681297c6047d9b0b772c873ecd110754

Kangping Dong   commited 2024-11-06 16:35:28 +08:00
3b6bb1ba4a
Merge "[Thread] add private API ThreadNetworkSpecifier" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-11-06 07:01:55 +00:00
594a9a8cfa
[Thread] save time in InternetAccessTest by only joining the network once
Similar to aosp/3325897

Change-Id: Ifba212b22f86a9131c718b5c2ab544a6bbbbf1b4

Handa Wang   commited 2024-11-06 03:05:28 +00:00
e9e00def4d
[Thread] add a NAT64 test case for UDP echo server
This CL adds a test case for UDP traffic in InternetAccessTest. The test case verifies that a Thread device can send a UDP message to a UDP echo server and receive a reply.

Bug: 374232259
Change-Id: Id138248f1ed26c1cc5728cc06b42e3223c449125

Handa Wang   commited 2024-11-05 09:00:50 +00:00
18e8b27832
[Thread] create a base class TestUdpServer
This class is useful for creating a class that responds to specific type of UDP messages. E.g. DNS server and UDP echo server.

Bug: 356770473
Test: atest ThreadNetworkIntegrationTests:android.net.thread.InternetAccessTest

Change-Id: I6880bb825ac5077d4a73f9d986116c571863e1d8

Handa Wang   commited 2024-11-05 09:00:46 +00:00
23ee433f03
[Thread] add private API ThreadNetworkSpecifier
Bug: 374037595
Change-Id: I8d63a742ec2a03a1cf2f023711696379c975ff80

Kangping Dong   commited 2024-11-05 13:36:44 +08:00
2967cfaf4e
[Thread] join/leave the network only once to save time in BorderRoutingTest
This can save around 10 seconds per test case.

Bug: 376423433
Change-Id: I7c61d03a57c06ff391b6486ac4e9b201adf67483

Handa Wang   commited 2024-11-01 09:03:40 +00:00
e61c10a2e7
Merge "[Thread] Disable flaky test nat64_withAilNat64Prefix_threadDevicePingIpv4InfraDevice_outboundPacketIsForwarded" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-31 15:41:14 +00:00
0f0885aa40
Merge "[Thread] add private API for disabling border router" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-31 15:30:43 +00:00
a2f666e08a
[Thread] add private API for disabling border router
Bug: 374036806
Change-Id: Ib8ca8bbd2b3018c39c9250e1b3ce70b193273c1b

Kangping Dong   commited 2024-10-31 14:30:25 +08:00
56449db1be
[Thread] Disable flaky test nat64_withAilNat64Prefix_threadDevicePingIpv4InfraDevice_outboundPacketIsForwarded
Bug: 376573921
Change-Id: I017a7c3bfbb46a367a32156159495930120adb35

Handa Wang   commited 2024-10-31 05:09:38 +00:00
833b22da87
[Thread] add an integration test case for resolving a host via DNS recursive resolver
This CL adds new test cases for verifying the Thread Border Router's
DNS Recursive Resolver feature: The DNS clients resolves google.com
successfully when the feature is enabled.

Bug: 354868095
Test: atest ThreadNetworkIntegrationTests:android.net.thread.InternetAccessTest

Change-Id: I1b021151c6843b30c3f47559ab20dec405af5dea

Handa Wang   commited 2024-10-30 06:42:17 +00:00
5e8a1fdfda
Merge "[Thread] tell ot-daemon about the DNS servers on the infra link" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-10-28 14:16:44 +00:00
c8653e771a
[Thread] Fix the overlap of top app bar and the system's status bar in demo app
Before: https://screenshot.googleplex.com/7NJy8izdNKJoa4u
After: https://screenshot.googleplex.com/V4PyKzkQbwBVJw8

Change-Id: I3073541ea02ae9936fef728f04aece1d6389c5e8

Handa Wang   commited 2024-10-28 05:58:11 +00:00
0997dd93a1
[Thread] tell ot-daemon about the DNS servers on the infra link
This CL passes the DNS servers' information to ot-daemon which was
fetched from LinkProperties of the infra link. This can enable the DNS
recursive resolver feature of the Thread Border Router.

The integration test case will be covered when aosp/3259932 is merged. Currently the test case CL cannot be merged because the there's a dependency PR in GitHub hasn't been merged: https://github.com/openthread/openthread/pull/10864.

Bug: 365892457
Bug: 354868095
Test: atest ThreadNetworkIntegrationTests:android.net.thread.InternetAccessTest

Change-Id: I66e54715ecaf8e0a43324d4afd4398e8884d8738

Handa Wang   commited 2024-10-28 05:29:00 +00:00
2d9992c186
[Thread] Add NAT64 switch to Thread demo app
This CL adds a switch to the Thread demo app that allows the user to enable or disable NAT64.

See screenshot https://screenshot.googleplex.com/3UDJ6wXqRf6WKRy.

Bug: 375559106
Change-Id: I2a5c9f08ef664e62a5c34987eedb321e2b01fd85

Handa Wang   commited 2024-10-25 09:20:00 +00:00
39f0ea9106
Merge "Fix lint warnings in thread_network_settings_fragment.xml" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-24 06:47:31 +00:00
0ac740b1ff
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
[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
[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
[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
[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 "[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
[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
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