1. allow OEMs to default the vendor and model name to system properties.
2. use the vendor & model name for net diag TLVs
Change-Id: I30e988ba3e9cb9f9c5dc3a096f162d5dbcdfbc11
Some android devices call the API `setChannelMaxPowers()` to set the
Thread radio output power. Then there is no need for these devices
to set the Thread country code.
This commit adds an overlay configuration `config_thread_country_code_enabled`
to enable/disable setting the Thread country code.
Bug: b/402276117
Test: atest ThreadNetworkUnitTests:ThreadNetworkCountryCodeTest#initialize_countryCodeDisabled_defaultCountryCodeIsUsed
Change-Id: I215c64757d0277853f8d4625ace363a4d7bb974b
This commit unregisters all country code callbacks (WiFi, Telephony and
Location) when the CountryCode module detects that the co-processor
doesn't support setting the country code.
Bug: b/402276117
Test: atest ThreadNetworkUnitTests:ThreadNetworkCountryCodeTest#setCountryCodeNotSupported_returnUnsupportedFeatureError_unregisterAllCallbacks
Change-Id: I65d57e0e826202ad696335200645bf6d78c8b87c
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
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
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
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
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
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
service
This CL implements the ThreadNetworkController#setConfiguration. When
the ThreadNetworkControllerService receives this call, the configuration
is passed to ot-daemon and triggers according OT APIs. On success, the
configuration is persisted to the local storage and triggers
OutcomeReceiver#onSuccess. On failure, it triggers
OutcomeReceiver#onError.
Bug: 368456504
Change-Id: I570ec3fead204cd3b6c05629ef409967245350b8
The mapping from network to interface name is passed from
ThreadNetworkControllerService to NsdPublisher, so that NsdPublisher can
send interface index to mdns subscribers when a service is resolved.
Bug: 321883491
Test: presubmit
Change-Id: I401c38ba3fbc7b2a2de5cbc9ab1132c657518f32
modules should specify the submodule of java_sdk_library that the module
actually depends on
Test: CI
Bug: 358613520
Change-Id: I0367068c901df98483f6cf95160d3e7801881b0a
This CL changes the hiden API `setChannelMaxPowers` to system API
to allow the privilege app to set the max power of each Thread channel.
Bug: b/346686506
Test: atest CtsThreadNetworkTestCases
Change-Id: I1089a4a315971c3bca8ec688a02143ddec93d039
This CL adds a test case to verify the upstream network request has
desired transport types and network capabilities.
Bug: 356346764
Test: CI
Change-Id: Id81b5f60ce2ca574582aaf106840eab0b7aca927
Previously the upstream network selector wrongly cleared the default
network capabilities so there's a risk of choosing VPN as the upstream
network, which is undesired.
Bug: 356346764
Test: atest ThreadNetworkIntegrationTests
ThreadNetworkControllerServiceTest
Change-Id: Ic1762775734d734f1974a753f100814b61d66589
This CL adds 3 things as @SystemApi:
- The ThreadConfiguration class except the Builder nested class.
- The ThreadNetworkController#registerConfigurationCallback method.
- The ThreadNetworkController#unregisterConfigurationCallback method.
Bug: 342519412
Test: CtsThreadNetworkTestCases
Change-Id: I8d3e48b73d471af1515f251451a1259a4bde69af
This is basically a revert of aosp/3079292 to disable the handling of
the airplane mode. The cause is that there are a few reported ANR issues
on real devices and they points to the handlers here in Thread module.
Before we figure out the root cause, let's disable the airplane mode
handler in Thread to recover the presubmit tests.
Bug: 353115531
Bug: 352484437
Bug: 350586929
Bug: 352316041
Change-Id: I569ced2855658f965ddf51242600ee3c325781a7
per offline discussion, it's better to provide support of customizing
any vendor-specific TXTs to make the solution more generic. The preivous
defined "vgh" TXT entry is deprected.
Bug: 343671003
Change-Id: I6e2804e346d04078b7d28bfdc18ed6c23c5c10e6
This commit fills in the ticks of active timestamp of randomly generated
dataset as defined in Thread spec.
Bug: 347838683
Change-Id: I5d8ba3ca7728e1890996fdd64198f7bc90bfb1fa
* changes:
[Thread] support ThreadConfiguration API at ThreadNetworkControllerService
[Thread] add support for configuration at ThreadNetworkController
Treehugger Robotauthored and Gerrit Code Reviewcommited 2024-06-24 10:03:18 +00:00
It turns out context.registerReceiver(receiver, intentFilter,
permission, flags, handler) is not posting the receiver on the handler
and will result in ANR in activity manager if the receiver is blocked
This commit makes it safer by posting the receiver body to mHandler
explicitly.
Bug: 340368050
Change-Id: Ib6b8c0a8952ce43c935f39b0978f47268b108a79
This is to avoid running tests on devices that do not support Thread. Otherwise, the tests will fail with ClassNotFoundException when the test classes are loaded
Change-Id: I286394ae925ad7258aa82cd308ac963ee334992c
This CL lets NsdPublisher support resolving an mDNS host via one-shot
mDNS query. Because NsdManager not yet responds to such a query
properly, we cannot add an integration test for this. I've verified the
Discovery Proxy use case work properly on real devices.
Bug: 322434640
Test: atest NsdPublisherTest
Change-Id: Ie67f2fb9dd012408c123c354fc29f1a943280780
This commit tries to use network time as authoritative time source for
generating Thread operational dataset. If the time is get successfully,
the authoritative bit will be set in the dataset.
Bug: 340130726
Test: presubmit
Change-Id: Ibaca1f866be0be121763fdb63e02621809484b17
A summary of changes in this commit:
1. add new commands mirroring the java APIs: "join", "migrate" and
"leave"
2. Use THREAD_NETWORK_TESTING for guarding access to shell commands
which are for testing
3. Refactor ThreadNetworkShellCommand for readability
Bug: 329368792
Change-Id: Ibdb256674533704dc1d000a15c162f41cec5047f
@Test annotated methods are running in threads like
"Thread[Time-limited test,5,main]" which is created by FailOnTimeout.java,
while @Before annotated setUp() is running in thread
"Thread[Instr: androidx.test.runner.AndroidJUnitRunner,5,main]" which is
created by AndroidJUnitRunner.
The issue is that there are code in ThreadNetworkControllerService
checking all its methods runs on the thread associated to the provided
handler. This constraint doesn't hold in this unit test because
TestLooper runs all the posted tasks on the current thread rather than
the thread associated to its backed looper. So the tests will fail with
Log.wtf() which terminates the process on eng build.
This commit fixes this issue by annotating the test class with
@UiThreadTest to force methods annotated with @Before, @After and @Test
to run on the main / UI thread.
Test: run this test class on aosp_cf_x86_64_phone-trunk_staging-eng
Bug: 342092067
Change-Id: I7d75de5ac31234f3051e9ed332da33c1da6a8c98