Commit graph android_packages_modules_Co.../thread
Message SHA1
Merge "[Thread] create socket dev/socket/ot-daemon/thread-wpan.sock" into main am: 3457225fa3
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2911492

Change-Id: Icbc179f162917e0e13caa52e19b81837fff8c9b5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Kangping Dong   authored and   Automerger Merge Worker   commited 2024-01-24 10:39:08 +00:00
565aafd5b5
Merge "[Thread] create socket dev/socket/ot-daemon/thread-wpan.sock" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-01-24 10:08:28 +00:00
3457225fa3
Merge "[Thread] add error code ERROR_UNKNOWN for forward compatibility" into main am: 649571ddf7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2910724

Change-Id: I6efcd5f7c5352871a9d89c5284dd227085a84431
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Kangping Dong   authored and   Automerger Merge Worker   commited 2024-01-24 02:50:03 +00:00
9750fc3518
Merge "[Thread] add error code ERROR_UNKNOWN for forward compatibility" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-01-24 02:20:42 +00:00
649571ddf7
[Thread] create socket dev/socket/ot-daemon/thread-wpan.sock
Creates the /dev/socket/ot-daemon/thread-wpan.sock socket from the
service init file. This is required for communication between ot-ctl
and ot-daemon service

Bug: 320451788
Test: verified that ot-daemon can create socket
/dev/socket/ot-daemon/thread-wpan.sock

Change-Id: Ib2111d67d2ce6726158f02a2cb2310c7ba9bf270

Kangping Dong   commited 2024-01-22 01:20:36 +08:00
9e69c46395
Merge "Make ThreadNetworkController.setTestNetworkAsUpstream require NETWORK_SETTINGS permission" into main am: ba2480bb2e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2919546

Change-Id: Ib2c2e83d74de35266425e48c0c589bec1dfce964
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Handa Wang   authored and   Automerger Merge Worker   commited 2024-01-21 06:35:55 +00:00
428861c280
Make ThreadNetworkController.setTestNetworkAsUpstream require NETWORK_SETTINGS permission
This CL contains following enhancements:

- Enforce NETWORK_SETTINGS permission for ThreadNetworkController.setTestNetworkAsUpstream.
- Move the setTestNetworkAsUpstream in
  ThreadNetworkControllerService to make the order of methods more
logical.
- Update the test case name in BorderRoutingTest.

Bug: 295843010
Bug: 320842152

Change-Id: I82edac6c819dd637f4c98f31368a1b520338ce24

Handa Wang   commited 2024-01-19 08:15:58 +00:00
253b3fb6da
Ensure the Thread integration test only run on CuttleFish devices am: d5e2ac94d1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2911295

Change-Id: Idb744445222085450de94d0bf6d645fb905e8edc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Handa Wang   authored and   Automerger Merge Worker   commited 2024-01-18 06:07:44 +00:00
a7c471d9ec
Ensure the Thread integration test only run on CuttleFish devices
This is because the test case relies on **simulation** Thread radio, which is currently only available on CuttleFish.

Bug: 295843010
Test: atest android.net.thread.BorderRoutingTest

Change-Id: Icd29d91c9ec9912e27191e97fe7f58e9067c1d8c

Handa Wang   commited 2024-01-18 12:00:14 +08:00
d5e2ac94d1
Graduate ThreadNetworkIntegrationTests from postsubmit am: 7cc1c37c5f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2911490

Change-Id: Icdb0fae334ee4758d4a8e3dba5e5cbb4c09983c0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Handa Wang   authored and   Automerger Merge Worker   commited 2024-01-17 11:33:08 +00:00
445224c35b
Graduate ThreadNetworkIntegrationTests from postsubmit
Bug: 295843010

Change-Id: I47fe9f00dff804d5e9c112336c5972b6a80760cf

Handa Wang   commited 2024-01-17 09:00:16 +00:00
7cc1c37c5f
[Thread] add error code ERROR_UNKNOWN for forward compatibility
This is per the go/android-api-guidelines#return-error:
```
Make sure your chosen error handling option gives you the
flexibility to introduce new error types in the future. For
@IntDef, that means including an OTHER or UNKNOWN value - when
returning a new code, you can check the caller's targetSdkVersion
to avoid returning an error code the application doesn't know
about. For exceptions, have a common superclass that your
exceptions implement, so that any code that handles that type will
also catch and handle subtypes.
```

Bug: 320403080
Change-Id: I2ee663b75107dac6d84fa697f449fa0424128fde

Kangping Dong   commited 2024-01-16 16:07:53 +08:00
2c83e2fcc9
Merge "[Thread] add CTS test for registerNetworkCallback for Thread" into main am: ad93a191e7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2909780

Change-Id: Ibf10e9a24be6042752f518d5023bd8f11fc891c7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Kangping Dong   authored and   Automerger Merge Worker   commited 2024-01-16 02:24:00 +00:00
2f10a63abb
[Thread] add CTS test for registerNetworkCallback for Thread
To make sure that apps can register for Thread network by specifying
only TRANSPORT_THREAD.

This prevents regression given aosp/2873154 was considered a short-term
solution.

Bug: 313000440
Test: atest CtsThreadNetworkTestCases:android.net.thread.cts.ThreadNetworkControllerTest#threadNetworkCallback_deviceAttached_threadNetworkIsAvailable
Change-Id: I7860c50b092439f39e5d8c437de1863b0633b7a0

Kangping Dong   commited 2024-01-16 09:56:48 +08:00
b68cad4414
Merge "[Thread] define flag thread_user_restriction_enabled" into main am: e32111c8fc
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2897512

Change-Id: Ifa2ade992feb804e6e1c78b2d05483b7957d7ecb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2024-01-09 10:51:11 +00:00
3c97dd5e18
Merge "[Thread] define flag thread_user_restriction_enabled" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-01-09 10:15:51 +00:00
e32111c8fc
Merge "[Thread] add Android.bp for Thread flags" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-01-09 06:10:23 +00:00
e19a753182
[Thread] define flag thread_user_restriction_enabled
Define this flag for guarding UserManager#DISALLOW_THREAD_NETWORK

Bug: 307679182
Change-Id: I69c578d76f3aac250bb733aac74754c127ae453b

Kangping Dong   commited 2024-01-09 13:58:58 +08:00
856b7156d7
[Thread] add Android.bp for Thread flags
This is not required for code in the mainline module since the flag
infra is not supported for mainline. But we will need to write code
in UserManager and it needs to be guarded by new Thread flags.

Note that Merged-In is added to skip merging this CL into the
udc-mainline-prod branch because trunk stable flagging is not supported
there

Bug: 307679182
Test: m
Merged-In: I88c993680976d2e10d672bfdbf45119f2db13868
Change-Id: Id53fa3e7c9592b04f37f4cbd7dcd0499859e59ed

Kangping Dong   commited 2024-01-09 13:58:41 +08:00
a59a6e304b
Request Thread network at the initialize()
Currently requestThreadNetwork is called in registerThreadNetwork. This creates a new NetworkCallback for Thread every time when Thread is turned on. We'd better just use one callback to avoid potential issues.

Bug: 319179354

Change-Id: I96bad351f089b32a9acd919dea2e2b6b2aea68d2

Handa Wang   commited 2024-01-09 05:35:01 +00:00
90d2d0d0d9
Merge "[Thread] start / initialize Thread service early" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-01-08 12:55:02 +00:00
79e3b59358
[Thread] start / initialize Thread service early
We need to do initialization work and start OT daemon when
system_server boots. But the initialize() is called at the phase
PHASE_BOOT_COMPLETED which is too late as Apps (e.g. Google Play
Services) can be started before this phase.

This commit changes to start the Thread service earlier at the phase
PHASE_SYSTEM_SERVICES_READY. Other services such as Wi-Fi, Bluetooth,
Ethernet and Nearby all starts / initializes at this phase.

This commit resolves comment aosp/2737373/comment/d65b9446_8a08117c

Bug: 318787467
Test: atest CtsThreadNetworkTestCases
Change-Id: I7b7b8551b9114cbf07f995b64316c7b420d868b6

Kangping Dong   commited 2024-01-08 13:48:18 +08:00
56354a961e
[Thread] remove Thread.sleep from CTS tests
Test: atest CtsThreadNetworkTestCases
Change-Id: Id7c52532988048e4473591092ac60eb66b1b7bcb

Kangping Dong   commited 2024-01-04 18:12:41 +08:00
e828340016
Merge "[Thread] Add support for Thread persistent setting" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-01-03 13:01:53 +00:00
396cc5721e
[Thread] Add support for Thread persistent setting
The ThreadPersistentSetting class can be used to read/store key value
pairs in ThreadPersistentSetting.xml file.

Bug: 299243765

Test: atest ThreadNetworkUnitTests:com.android.server.thread.ThreadPersistentSettingTest
Change-Id: I564ce8373e6af8f5cdf066a579bec46bfffecb72

Yang Sun   commited 2024-01-03 19:09:47 +08:00
95f40d0c55
Merge "[Thread] add service unit test skeleton" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-01-03 10:06:47 +00:00
3deb5da6db
Add telephony country code to Thread country code sources
Bug: b/309357909
Test: Run `atest ThreadNetworkUnitTests`.
Change-Id: I51c297a5c30fb114a6e3fb8b54cdbfef142001b3

Zhanglong Xia   commited 2024-01-03 15:33:07 +08:00
a00bb3fad9
[Thread] add service unit test skeleton
Adds the Thread service unit test skeleton and make the services
testable.

Initially, a few trivial unit tests for existing APIs are added in
ThreadNetworkControllerServiceTest.java, and more tests will be added in
separate CLs later.

Bug: 317555104
Change-Id: I7b9e5f3663493d8da2448568de792e4272ee1df6

Kangping Dong   commited 2024-01-03 15:01:07 +08:00
276384042d
Add WiFi country code to Thread country code sources
Bug: b/309357909
Test: Run `atest ThreadNetworkUnitTests`.
Change-Id: I087cc0fc2b6c21fd9d3d4607f30c194214aeb37e

Zhanglong Xia   commited 2024-01-03 10:25:14 +08:00
69c370af8c
Add Thread resource overlay support
This CL adds resource overlay support to allow developers to
change the default configuration of using the location country code.

Bug: b/311324956
Test: Set the resource overlay in cuttlefish, check the default
      configuration via the command `dumpsys thread_network`.

Change-Id: Ide853975e8244f06a382b2eda4844e030539b95d

Zhanglong Xia   commited 2024-01-03 00:29:55 +08:00
125a43c12b
Set Thread Network country code from location country code
This CL selects the Thread country code from location country code.
If the location country code is not avaliable, the country code `WW`
will be selected as the default Thread country code.

This CL also adds Shell commands for developers to override the Thread
country code for testing.

Bug: b/309357909
Test: Run `atest ThreadNetworkUnitTests`.

Change-Id: Id87c293005f0e75922a72854b40c41837b74397f

Zhanglong Xia   commited 2024-01-03 00:27:50 +08:00
d385e7eec5
[Thread] use Context#enforceCallingOrSelfPermission
Context#enforceCallingPermission always throws SecurityException if we
are not processing a Binder IPC. This specifically doesn't work with
unit tests where the service APIs are called with mocked Binder
interfaces.

Bug: 317555104
Change-Id: I50be68487fb53907dbb1e3da7815fdf305047481

Kangping Dong   commited 2023-12-28 11:10:51 +08:00
5223a13c68
[Thread] make InfraInterfaceController mockable
It's generally discouraged to mock a static method, so this commit
changes InfraInterfaceController#createIcmp6Socket to non-static method
and inject InfraInterfaceController into ThreadNetworkControllerService
as an external dependency.

Bug: 317555104
Change-Id: I6f88c02858279223684c781dc065a9bf84ae15ab

Kangping Dong   commited 2023-12-27 22:21:04 +08:00
d5cee26211
Fix duplicate presubmit entries in thread/TEST_MAPPING
The duplicate entries make `CtsThreadNetworkTestCases` not included in presubmit. The `CtsThreadNetworkTestCases` was added in aosp/2804113 but was accidentally removed in aosp/2888526.

Bug: 317769267
Bug: 297729075

Test: presubmit

Change-Id: I184d21deddc0f0c247321a8d1afe5a8f8674f974

Handa Wang   commited 2023-12-26 13:41:01 +00:00
c3916a2c8f
implement Thread Border Router e2e integration test
This implements a basic border routing test case (ping) and demonstrates a
valid test environment for Thread Border Router test cases.

Later we can add more packet verifications and more test cases.

Bug: 295843010
Test: atest android.net.ThreadBorderRouterTest

Change-Id: Ifb9b6d45539143a227c2bc0ed69b5c3167ef9acd

Handa Wang   commited 2023-12-26 15:24:54 +08:00
806f5a1bec
Merge "add hidden method setTestNetworkAsUpstream" into main
Handa Wang   authored and   Gerrit Code Review   commited 2023-12-25 11:00:04 +00:00
fe1d851dd0
add hidden method setTestNetworkAsUpstream
`setTestNetworkAsUpstream` allows to specify a test network as the upstream of Thread network. This is going to be used in Thread integration tests. E.g. android.net.thread.BorderRoutingTest.

Bug: 295843010
Test: atest android.net.thread.BorderRoutingTest

Change-Id: I66474e2aa5b3434c4c66078a1d6bd6e522e32ae5

Handa Wang   commited 2023-12-25 16:47:23 +08:00
198a3d495a
[Thread] graduate ThreadNetworkUnitTests from postsubmit
Bug: 297729075
Change-Id: I164225791e176c13d124f6b63e1c3f1a3f3a0e34

Kangping Dong   commited 2023-12-21 23:52:15 +08:00
39420e95c9
Merge "[Thread] add demoapp for Thread network APIs" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2023-11-24 11:58:19 +00:00
a39db11899
[Thread] add demoapp for Thread network APIs
A screenshot of the demo app:
![](https://screenshot.googleplex.com/AsiYKPzG4nJpr6x.png)

Bug: 273227725
Change-Id: I8d9bcf00bb54d3f152c436b56df919d967c5b71b

Kangping Dong   commited 2023-11-24 12:01:06 +08:00
138b4b1c4c
Merge "Remove --show-annotation FlaggedApi from flagged-apis-droidstubs" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2023-11-22 14:22:04 +00:00
d3d41ac7a4
Remove --show-annotation FlaggedApi from flagged-apis-droidstubs
framework-connectivity-flagged-apis-droidstubs is used by
jarjar-rules-generator to avoid jarjaring flagged apis.
But, this usage of --show-annotation FlaggedApi in the flag is not
supported.
So this CL removes --show-annotation FlaggedApi.
As far as framework-connectivity-flagged-apis-droidstubs contains
flagged APIs, it's fine that this droidstubs also contains non-flagged
APIs.

Test: TH
Bug: 312408311
Change-Id: I2f1f5624d98873420c0c36ac6e31386102211045

Motomu Utsumi   commited 2023-11-22 19:05:48 +09:00
ba5dde84f1
[Thread] clear calling identity before invoking app-supplied callback
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

Kangping Dong   commited 2023-11-22 01:54:34 +00:00
98015f3373
update ThreadNetworkControllerService to support border routing
This CL lets ThreadNetworkControllerService calls the LocalNetworkConfig
API to set up border routing between Thread and infrastructure network.

Bug: 299552948
Bug: 305861411
Test: Verified on Cuttlefish that forwarding is set up.

Change-Id: I8b2f015d9d6248bfb1cd9ac806dc8664970a26d2

Handa Wang   commited 2023-11-17 14:25:28 +08:00
496f770dd8
Merge "Send localNetworkConfig when multicast routing config changes" into main
Yang Sun   authored and   Gerrit Code Review   commited 2023-11-17 05:50:11 +00:00
b923ad4f5d
Merge "[Thread] add missing guava dependency in tests" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2023-11-15 04:29:20 +00:00
ac0a50beb5
Merge "[Thread] add documentation for Delay Timer of Pending Dataset" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2023-11-15 04:29:03 +00:00
d9fe1c5eae
Send localNetworkConfig when multicast routing config changes
Bug: 306111568

Test: manual test with cuttlefish. Result: https://paste.googleplex.com/4794566388482048

Change-Id: I7990388a14edea2253ece68b2dca2628732f4878

Yang Sun   commited 2023-11-15 08:50:10 +08:00
f5904689c3
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