[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
diff --git a/service/Android.bp b/service/Android.bp
index 15ae501..38c0110 100644
--- a/service/Android.bp
+++ b/service/Android.bp
@@ -107,11 +107,16 @@
"-Werror",
"-Wno-unused-parameter",
"-Wthread-safety",
+
+ // AServiceManager_waitForService is available on only 31+, but it's still safe for Thread
+ // service because it's enabled on only 34+
+ "-Wno-unguarded-availability",
],
srcs: [
":services.connectivity-netstats-jni-sources",
"jni/com_android_server_BpfNetMaps.cpp",
"jni/com_android_server_connectivity_ClatCoordinator.cpp",
+ "jni/com_android_server_ServiceManagerWrapper.cpp",
"jni/com_android_server_TestNetworkService.cpp",
"jni/onload.cpp",
],
@@ -128,6 +133,7 @@
],
shared_libs: [
"libbase",
+ "libbinder_ndk",
"libcutils",
"libnetdutils",
"liblog",
@@ -203,6 +209,8 @@
visibility: [
"//packages/modules/Connectivity/service-t",
"//packages/modules/Connectivity/tests:__subpackages__",
+ "//packages/modules/Connectivity/thread/service:__subpackages__",
+ "//packages/modules/Connectivity/thread/tests:__subpackages__",
],
}