Existing ThreadNetworkControllerService tests are using RunAsShell to
grant the permissions for indivitual APIs. Given the permission checks
are tested in the CTS tests, this is not very useful with the overhead
of complicating the testing code. Instead, this CL grants all the
permissions in setUp() with spy-ed Context.
This commit also fixes the issue in b/326793058 that the tests doesn't
run on a U device where the THREAD_NETWORK_PRIVILEGED permission doesn't
exist.
Bug: 326793058
Test: m ThreadNetworkUnitTests
Change-Id: I477cf30d737969ccf12180eae48d3b8fd6ed4a51
Added E2E test cases to verify that packets from Thread network with
link-local/mesh-local source address to multicast group with scope
larger than realm-local are not forwarded to infra link.
Bug: 325770316
Test: atest ThreadNetworkIntegrationTests:android.net.thread.BorderRoutingTest
Change-Id: I77cb8dbc43d0a2d6936a2a4db45e9dea541ea3c0
This commit also moves Thread flags to Connectivity/common to ease
maintenance.
Test: m framework-connectivity-t
Bug: 317290555
Merged-In: I50f3d3b8205a5a9ee8154a649318a2c175edbb71
Merged-In: I8a71f4ee49cc68a9512f432e454469200f2a5058
Change-Id: I8a71f4ee49cc68a9512f432e454469200f2a5058
The API `createRandomizedDataset()` randomly selects a channel
between channel 11 and 26. But not all countries support channels
between 11 and 26.
This CL selects random channel from the preferred channel mask if
the preferred channel mask is not 0, otherwise choose one from the
supported channel mask.
Bug:b/308310823
Test: atest ThreadNetworkUnitTests && atest CtsThreadNetworkTestCases
Change-Id: I6add3edc7e4fa888c46b57c4463ab18e0aa84e80
remove handling of this error code given it's not returned from
IOtDaemon APIs.
Test: atest CtsThreadNetworkTestCases
Change-Id: Id1d9b9d0ad45b7242e7c1d081b05ac51cf928603
In most cases, OT_ERROR_INVALID_STATE in ot-daemon indicates an internal
error. OtDaemonServer should actually maintain the state to make sure no
OT_ERROR_INVALID_STATE error can be returned.
Test: atest CtsThreadNetworkTestCases
Change-Id: I9dd6667548048873bf0c5b8eb85d929dfcaef997
This is required to included Thread module APIs in DP2 release.
See ag/26286387
merged-in is used to stop the CL from being merged into U branches
Bug: 325886480
Merged-In: I1eed7982b40d28947aa3f9575c568eac325dc832
Merged-In: I79be1b48058ce6fb08149e18cdd7a5f5b0762769
Change-Id: I79be1b48058ce6fb08149e18cdd7a5f5b0762769
This is required to included Thread module APIs in DP2 release.
See ag/26286387
Bug: 325886480
Ignore-AOSP-First: cherry pick of aosp/2968065
Change-Id: I79be1b48058ce6fb08149e18cdd7a5f5b0762769
This commit follows the guideline in go/ae-v-thread-admin-control that
Thread radio should be disabled when the user restriction is set and
nobody can enable Thread again (it fails with
ERROR_FAILED_PRECONDIFITION).
This commit adds only unit tests, E2E CTS tests are tracked in b/319079428
Bug: 319077876
Change-Id: I8981aa9e71948c64ee79701427ac794880826327
This test case lets the BR send a UDP message to Thread device using
socket API and verify the message is received on the Thread device via
ot-ctl udp command.
For now this only verifies the direction BR -> ED because the other
direction ED -> BR is depending on platform UDP feature which is not
enabled yet.
Bug: 321168973
Test: atest ThreadNetworkIntegrationTests:BorderRoutingTest#unicastRouting_borderRouterSendsUdpToThreadDevice_datagramReceived
Change-Id: I590583dd818f3d72dec41184e5427a8b08f842bb
Per CTS review comment in aosp/2949385:
```
You might want to make this a bit larger, otherwise if some new error codes are added in the future in a mainline update, already released CTS test packages will start to fail.
That should be fixed by mCTS, but since mCTS is not in place yet, it's best to be safe
```
This commit moves the too-large error code check into unit test to avoid
potential CTS compatibility issues.
Bug: 323791003
Change-Id: If99191630e1044cb8f5ed189bf79567cd51c3905
For ot-daemon to perform mDNS operations, we need to implement an AIDL
service NsdPublisher. MdnsPublisher forwards the calls to NsdManager.
For now, only register & unregster a service without a custom host is supported.
Bug: 320211657
Bug: 318323473
Test: atest CtsThreadNetworkTestCases
Change-Id: Ia392a0f57046f53973ac6bd6043dec915d170666
This commit handles the ot-daemon crash by automatically restarting it
and rejoin the network if ever joined.
This also fixes the address not deleted issue in TunInterfaceContorller.
Bug: 321540728
Bug: 309792480
Change-Id: I3ed466eb70818974a1e57f01456363bdf82915d5