Per API council feedback and API guideline at
go/android-api-guidelines#provide-executor, it should call
Binder.clearCallingIdentity() before invoking the app-supplied callbacks
so that the app doesn't use the system-server's identity for permission
check in the callback.
Bug: 309952666
Test: atest ThreadNetworkUnitTests
Change-Id: I3cfbce29c0a516506bb76a44b151a583c8477806
Per API council review suggestions in b/309952666, add the same
permission requirements for the unregister APIs.
Bug: 309952666
Test: atest CtsThreadNetworkTestCases
Change-Id: Idc481c7676ddc5d748fe7803f74dd63981186c09
Make it clear that Duration#ZERO is used for automatically selecting a
reasonable value by the system.
Bug: 307939803
Test: atest CtsThreadNetworkTestCases
Change-Id: I880dca187902464fbe45ed6f2a64e9f88a5493ab
Per API council review feedback in b/307939803
Bug: 307939803
Test: atest CtsThreadNetworkTestCases
Change-Id: Ia5fbb38e24d09c4a8d95ce0dfd6058a65d5d4614
This commit renames `createRandomDataset` to `createRandomizedDataset`
and moves this method to ThreadNetworkController class.
The reason for moving this method is that we rely on the service side to
know which channels are currently supported by this device and there is
no safe way for ActiveOperationalDataset to created a randomized full
dataset by its own. Moving this method to ThreadNetworkController also
allows us to support future platform-dependend configurations.
Bug: 308117328
Bug: 307939803
Change-Id: I0b0b7b727c3b326ab59bb1299ace15df1ff1ad5e
The ThreadNetworkController class provides APIs for managing the Thread
network, for example, attach to a specific network, form a network with
given dataset or update/migrate an existing network.
Bug: 262683651
Test: atest CtsThreadNetworkTestCases
Change-Id: Ib3c267d2c81a8c3c7772ed3c9cd2092487cc941a
OperationalDatasetTimestamp is saving the timestamp as an Instant
object, and this has the problem that when the dataset timestamp is
written to a TLV, it's going to loss precision as the nanoseconds
of the Instant is converted to "Ticks". This results in bug that
the dataset timestamp doesn't equal to the same value when it's
converted back from a TLV:
```
var timestamp1 = OperationalDatasetTimestamp.fromInstant(Instant.ofEpochSecond(100, 999938900));
byte[] tlv = timestamp1.toTlvValue();
timestamp2 = OperationalDatasetTimestamp.fromTlvValue(tlv);
assertThat(timestamp2).isEqualTo(timestamp1); // This fails!!!
```
Bug: 308408536
Test: atest ThreadNetworkUnitTests CtsThreadNetworkTestCases
Change-Id: I81b482a05337b6d1150edaa28b860034592a4347
This make-pretty.sh can be called from any where and it formats only
java code under packages/modules/Connectivity/thread/
Test: ./thread/scripts/make-pretty.sh
Change-Id: I1b24025cf0267c81a7b133d1e8a08f77cc7ddc0e
Per the API review council, the classes should be "final" by default
Bug: 301076593
Test: build && atest CtsThreadNetworkTestCases
Change-Id: I85f0b4fabe5b1bcec2be052620b38a07c58181d7
This commit declares the initial "thread_enabled" feature flag and use
this to flag all existing and future Thread system APIs with @FlaggedApi
Bug: 301473012
Test: build
Change-Id: I43f64ce38f7fd0806733b21c4f393e4563e6a467
This commit sets up the initial Thread network service for the
Android Thread feature which allows an Android device to create
a Thread network and being a Border Router.
See https://www.threadgroup.org/What-is-Thread for background of
Thread.
See b/235016403 for the Android Thread feature request.
Test: lunch aosp_cf_x86_64_tv-userdebug
m && launch_cvd
atest CtsThreadNetworkTestCases
Bug: 262683651
Change-Id: Ie1bb23084531f67165ec068ea3ca39592dbc01d1