Commit graph android_packages_modules_Co.../thread
Message SHA1
Merge "[Thread] add @RequiresPermissions for unregisterXxxCallback APIs" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2023-11-14 06:29:41 +00:00
5532b8884c
Merge "[Thread] resolve open comments for aosp/2737373" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2023-11-14 06:28:59 +00:00
b46d21a898
[Thread] add @RequiresPermissions for unregisterXxxCallback APIs
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

Kangping Dong   commited 2023-11-13 17:29:07 +08:00
8e44412f7c
implement InfraInterfaceController
InfraInterfaceController is used for creating an socket for
sending/receiving ICMPv6 ND messages on the infrastructure network
interface.

Bug: 299552948
Test: verified on a Cuttlefish

Change-Id: I02eafadafbf7a04e12fe74954b4812462c532e45

Handa Wang   authored and   Chalard Jean   commited 2023-11-10 21:11:01 +09:00
d295f8f146
[Thread] resolve open comments for aosp/2737373
Change-Id: Id2c58d8bf72139f10036b5488a12f45dd0c7c2db

Kangping Dong   commited 2023-11-09 17:48:34 +08:00
c959d665ab
Merge "[Thread] add ThreadNetworkUnitTests to postsubmit" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2023-11-09 09:23:12 +00:00
474abf134e
Merge "[Thread] add documentation for Pending Dataset constructor" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2023-11-09 02:55:16 +00:00
ac94d2cec6
[Thread] add documentation for Pending Dataset constructor
Per API council review feedback in b/307939803

Bug: 307939803
Test: atest CtsThreadNetworkTestCases
Change-Id: Ia5fbb38e24d09c4a8d95ce0dfd6058a65d5d4614

Kangping Dong   commited 2023-11-09 02:55:53 +08:00
a925218c4f
[Thread] move createRandomDataset to ThreadNetworkController
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

Kangping Dong   commited 2023-11-08 22:39:33 +08:00
af4f1f576c
[Thread] add ThreadNetworkController APIs
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

Kangping Dong   commited 2023-11-08 17:56:16 +08:00
b1c75dbe8c
[Thread] add ServiceManagerWrapper
Add a JNI wrapper of the NDK version of the ServiceManager which allows
us to retrieve the ot-daemon lazy service.

Bug: 262683651
Test: atest CtsThreadNetworkTestCases
Change-Id: I1d331d1ba06c2b88f156622d4ae864dae7b15dc3

Kangping Dong   commited 2023-11-08 17:46:18 +08:00
192e4b0289
Merge "[Thread] fix OperationalDatasetTimestamp#toTlvValue is not loss-less" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2023-11-07 19:20:44 +00:00
9efc28e6d0
[Thread] add ThreadNetworkUnitTests to postsubmit
Change-Id: I475096305728ba5177d680d5d09b7ee3a89a8ed8

Kangping Dong   commited 2023-11-08 03:19:10 +08:00
1b273056e4
Merge "Make FlaggedAPI available to CtsThreadNetworkTestCases" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2023-11-07 07:29:13 +00:00
f652d2ca82
[Thread] fix OperationalDatasetTimestamp#toTlvValue is not loss-less
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

Kangping Dong   commited 2023-11-07 13:13:06 +08:00
160b4d38f9
[Thread] add a script for make-pretty
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

Kangping Dong   commited 2023-11-07 12:41:42 +08:00
7dffade561
Make FlaggedAPI available to CtsThreadNetworkTestCases
FlaggedAPI will be ignored in udc-mainline-prod.
This makes CtsThreadNetworkTestCases build fail.
This CL updates CtsThreadNetworkTestCases to build against FlaggedAPI
and also updates framework-connectivity-jarjar-rules not to jarjar
FlaggedAPI.

Test: TH
Test: m CtsThreadNetworkTestCases
Change-Id: Ida8872b3bf61b7a59733f5fcec9e7d250efd3e58

Motomu Utsumi   commited 2023-11-07 12:21:45 +09:00
ada9e9877c
Merge "Clean up obsolete aliases for Truth." into main
Krzysztof Kosiński   authored and   Gerrit Code Review   commited 2023-10-26 09:07:59 +00:00
93196302b1
Merge "[Thread] graduate CtsThreadNetworkTestCases from postsubmit" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2023-10-26 08:48:27 +00:00
24ae5c2d06
Clean up obsolete aliases for Truth.
Bug: 255714762
Test: presubmit
Change-Id: I1a6394f6ff1cd56fac0f7a340857fdaee92fcbab

Krzysztof Kosiński   commited 2023-10-26 07:13:22 +00:00
4656f54cdd
[Thread] graduate CtsThreadNetworkTestCases from postsubmit
Bug: 297729075
Test; build and pass the presubmit

Change-Id: Ie90fd5dfd1d77ed45b39c527d37954f5ff6facd8

Kangping Dong   commited 2023-10-25 22:38:00 +08:00
706c234aeb
[Thread] make the Manager and Controller class 'final'
Per the API review council, the classes should be "final" by default

Bug: 301076593
Test: build && atest CtsThreadNetworkTestCases
Change-Id: I85f0b4fabe5b1bcec2be052620b38a07c58181d7

Kangping Dong   commited 2023-10-25 22:03:11 +08:00
5e1d430d33
[Thread] add Thread Operational Dataset API
Design doc: go/thread-android-api
Android FR: b/235016403

Bug: 262683651
Change-Id: Icbd4ee4150e3fd78df627c2e726c259e7ee50871

Kangping Dong   commited 2023-10-25 18:13:07 +08:00
7fea5fa6a2
[Thread] flagging Android Thread APIs
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

Kangping Dong   commited 2023-10-24 19:45:04 +08:00
75aa485604
Clean up obsolete aliases for Truth.
Bug: 255714762
Test: presubmit
Change-Id: If91e9af5409fed9d5ccdd13749a0f562c545d589

Krzysztof Kosiński   commited 2023-10-07 00:48:10 +00:00
739ed22507
[Thread] initial Thread network service
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

Kangping Dong   commited 2023-09-12 21:48:57 +08:00
1cec48f3c0
[Thread] add ot-daemon to com.android.tethering
ot-daemon is a dependency of the new Thread feature. This commit
add the ot-daemon binary and init rc file to the Tethering module.
Note that the ot-daemon service is default disabled and versioned
init rc file is used to ensure that this service won't be started
before Android U.

This is expected to increase the size of "com.android.tethering.capex"
by around 400 KB.

Manual verification:
1. on Android T (33) CF device, the ot-daemon service is not started
   after device boots; It reports service not found error when trying
   to start the ot-daemon service with adb shell command "start
   ot-daemon"
2. on Android U (34) CF device, the ot-daemon service is not started
   after device boots; It can be started with shell comamnd "start
   ot-daemon" but then failed because of missing sepolicy rules as
   expected

Test: see above manual verification note
Bug: 296211911
Change-Id: I222e2bbcc2ad0be2beec9f5f3406e7144d314370

Kangping Dong   commited 2023-09-11 14:46:19 +08:00
f2060610c0
[Thread] move Thread into com.android.tethering
Bug: 296211911
Change-Id: Ifd4f7cd06f1aeaba739d27d2328e89031ca73235

Kangping Dong   commited 2023-08-23 14:28:50 +08:00
e7fef8938a