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
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
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
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
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
The `setChannelMaxPowers` allows privilege app to set the max
power of each channel. It is going to be used for controlling the
output power of the Thread radio chip.
Bug: b/320594263
Test: atest ThreadNetworkUnitTests && atest CtsThreadNetworkTestCases
Change-Id: Ic47eccd6de2da0e6cdb8f21d5b4df156b1f11747
The Thread HAL supports only one client for a single Thread chip, so
ot-daemon needs to be force stopped in VTS tests because the testapp
needs to connect to the HAL service to perform tests.
Bug: 328538612
Change-Id: I5288e5747ab3957050d0e85c1ea684c6ead6c87d
Current implementation will auto-restart ot-daemon even when Thread
has been disabled by ThreadNetworkController#setEnabled(false). This
commit fixes this issue and also adds the "enable" / "disable" shell
command to ease testing.
Bug: 328538612
Change-Id: Icc9360ccf5d7daa6345def75d1860f046600b85b
Currently support customizing the vendor name, vendor oui and model
name.
Bug: 311324956
Test: atest ThreadNetworkIntegrationTests:android.net.thread.ServiceDiscoveryTest#meshcopOverlay_vendorAndModelNameAreSetToOverlayValue
Change-Id: I3ad916112c73c3f8a7eef4e3fa8d421ab9bf8276
This is needed by `ot-daemon` to clear all registrations when
re-initializing the `ot-daemon`'s `Application` class.
Bug: 323301831
Change-Id: I5ed3d2d29b08f4187ac1f406052d362cf2249c19