Commit graph android_packages_modules_Co.../thread/tests/unit/Android.bp
Message SHA1
Make java_sdk_library dependencies explicit
modules should specify the submodule of java_sdk_library that the module
actually depends on

Test: CI
Bug: 358613520
Change-Id: I0367068c901df98483f6cf95160d3e7801881b0a

Jihoon Kang   commited 2024-09-10 00:01:31 +00:00
8401b6a9f0
[Thread] run ThreadNetworkControllerServiceTest tests in a single thread
@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

Kangping Dong   commited 2024-05-23 03:04:59 +00:00
4d0afab8fe
[DON'T BLOCK] Test ownership migration rules
This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.

For more details please refer to the link below,
<add g3 doc link>

Bug: 304529413
Test: N/A
Change-Id: I243f17b3f0ad7af9ffa15ca242456e36688733f5
Merged-In: I243f17b3f0ad7af9ffa15ca242456e36688733f5

Aditya Choudhary   commited 2024-01-31 12:34:50 +00:00
01b5ede2b2
[Thread] add Thread tests to mts-tethering
Bug: 322142548
Change-Id: I71af1787b23be4c27d26b30498408631c2955012

Kangping Dong   commited 2024-01-25 18:05:10 +08:00
974d3ed761
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
[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] 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
[Thread] add missing guava dependency in tests
Change-Id: I383e4a0c78dc3b29fc1aa80d16204166f84ae61b

Kangping Dong   commited 2023-11-09 07:55:00 +00:00
26639b1aff
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] 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