This reverts commit 198b3218e7.
Reason for revert: we need only the settings changes (ag/32820024 and ag/32819994) to hide the settings toggle but don't need to make it default disabled as it makes no differences
Change-Id: I40dcea50eb3bbe16c9ffdb89c6182b976f819ece
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
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
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
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
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
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
The size of the lambda in ThreadNetworkControllerService#initialize() is getting larger so we introduce #initializeInternal() for better readability.
Change-Id: Idd7cb57e5ed03d27210c1199e03bfab51dbd1215
ot-daemon restarts
This CL tries to fix issue by removing error-prone shortcircuit checks.
The checks skip configuring the ot-daemon if they think the new state
is equal to the old state. However, the old state mainainted in
ThreadNetworkControllerService may be stale which causes issues.
Bug: 372592886
Test: atest ThreadNetworkIntegrationTests
Change-Id: Icab25cf094f8bf33832b4097ab8ee77b54badc6b
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 is a refactor CL to get rid of two almost identical IOtStatusReceivers.
Bug: 362861470
Change-Id: Iae004eab0c6735359924ab0f6546e84d55d29ff7
Test: None
This CL replaces all Log.i/e/w/d/wtf with SharedLog in ThreadNetworkService and its subcomponents.
Note that here are some necessary changes:
- Log.d() is changed to SharedLog.v()
- Only ERROR and WTF level of SharedLog supports Throwable. Some logging statements are changed slightly.
Bug: 351956873
Change-Id: I9c48381195fb3e96b7115ec2ebf229af048ea8de
This CL works with the corresponding ot-br-posix CL to separate the
config and the infra link state. In this way,
ThreadNetworkControllerService will call different APIs to send the
config/state to ot-daemon.
Bug: 362172947
Change-Id: Iae98325358f81ea2ff0c672577cc21a128ae049a
This is a no-op name refactoring CL to prepare for supporting Thread
in mobile use cases where Thread won't operate as a Border Router.
Flag: EXEMPT AIDL interface change (plus it just changes names)
Change-Id: Ib27bcb5b9cd5e9d04db720fde356be15e90068fa
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 refactors the code of ThreadNetworkControllerService to use
immutable BorderRouterConfiguration.
Bug: 358012289
Test: CI
Change-Id: Ifabf0144d5e8f5b5da2b8d64fc9e53c46f917dbb
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