[Tether06] Migrate tether offload controller into module
The tether offload JNI library in this patch still have many dependencies
with internal libraries. Will have follow up changes to cut the
dependencies to let it be a unbundled library.
Bug: 136040414
Test: -build, flash, boot
-atest TetheringTests
-atest FrameworksNetTests
Change-Id: Iacf8e0b94135e35672de3ee77c474ee39a00c591
diff --git a/packages/Tethering/Android.bp b/packages/Tethering/Android.bp
index 998572f..61bfb92 100644
--- a/packages/Tethering/Android.bp
+++ b/packages/Tethering/Android.bp
@@ -27,6 +27,7 @@
"androidx.annotation_annotation",
"netd_aidl_interface-java",
"networkstack-aidl-interfaces-java",
+ "android.hardware.tetheroffload.control-V1.0-java",
"tethering-client",
],
manifest: "AndroidManifestBase.xml",
@@ -38,11 +39,39 @@
defaults: ["TetheringAndroidLibraryDefaults"],
}
+cc_library_shared {
+ name: "libtetheroffloadjni",
+ srcs: [
+ "jni/com_android_server_connectivity_tethering_OffloadHardwareInterface.cpp",
+ ],
+ shared_libs: [
+ "libnativehelper",
+ "libcutils",
+ "android.hardware.tetheroffload.config@1.0",
+ ],
+ static_libs: [
+ "liblog",
+ "libbase",
+ "libhidlbase",
+ "libutils",
+ ],
+
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wno-unused-parameter",
+ "-Wthread-safety",
+ ],
+}
+
// Common defaults for compiling the actual APK.
java_defaults {
name: "TetheringAppDefaults",
platform_apis: true,
privileged: true,
+ jni_libs: [
+ "libtetheroffloadjni",
+ ],
resource_dirs: [
"res",
],
@@ -71,6 +100,8 @@
name: "tethering-servicescore-srcs",
srcs: [
"src/com/android/server/connectivity/tethering/EntitlementManager.java",
+ "src/com/android/server/connectivity/tethering/OffloadController.java",
+ "src/com/android/server/connectivity/tethering/OffloadHardwareInterface.java",
"src/com/android/server/connectivity/tethering/TetheringConfiguration.java",
"src/com/android/server/connectivity/tethering/UpstreamNetworkMonitor.java",
],
@@ -88,3 +119,11 @@
"src/android/net/util/PrefixUtils.java",
],
}
+
+// This group would be removed when tethering migration is done.
+filegroup {
+ name: "tethering-jni-srcs",
+ srcs: [
+ "jni/com_android_server_connectivity_tethering_OffloadHardwareInterface.cpp",
+ ],
+}