Move service-connectivity to the tethering APEX
As part of modularization of ConnectivityService and expansion of the Tethering module scope, move service-connectivity.jar into the tethering APEX, and load it from there. Bug: 171540887 Test: m, device boots and connectivity Change-Id: Id7b6a4664ae73224b9ab219c94f56d603a62ee5a
This commit is contained in:
@@ -14,8 +14,8 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
|
|
||||||
cc_defaults {
|
cc_library_shared {
|
||||||
name: "libservice-connectivity-defaults",
|
name: "libservice-connectivity",
|
||||||
// TODO: build against the NDK (sdk_version: "30" for example)
|
// TODO: build against the NDK (sdk_version: "30" for example)
|
||||||
cflags: [
|
cflags: [
|
||||||
"-Wall",
|
"-Wall",
|
||||||
@@ -26,6 +26,7 @@ cc_defaults {
|
|||||||
srcs: [
|
srcs: [
|
||||||
"jni/com_android_server_TestNetworkService.cpp",
|
"jni/com_android_server_TestNetworkService.cpp",
|
||||||
"jni/com_android_server_connectivity_Vpn.cpp",
|
"jni/com_android_server_connectivity_Vpn.cpp",
|
||||||
|
"jni/onload.cpp",
|
||||||
],
|
],
|
||||||
shared_libs: [
|
shared_libs: [
|
||||||
"libbase",
|
"libbase",
|
||||||
@@ -35,27 +36,11 @@ cc_defaults {
|
|||||||
// addresses, and remove dependency on libnetutils.
|
// addresses, and remove dependency on libnetutils.
|
||||||
"libnetutils",
|
"libnetutils",
|
||||||
],
|
],
|
||||||
}
|
|
||||||
|
|
||||||
cc_library_shared {
|
|
||||||
name: "libservice-connectivity",
|
|
||||||
defaults: ["libservice-connectivity-defaults"],
|
|
||||||
srcs: [
|
|
||||||
"jni/onload.cpp",
|
|
||||||
],
|
|
||||||
apex_available: [
|
apex_available: [
|
||||||
// TODO: move this library to the tethering APEX and remove libservice-connectivity-static
|
"com.android.tethering",
|
||||||
// "com.android.tethering",
|
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
// Static library linked into libservices.core until libservice-connectivity can be loaded from
|
|
||||||
// the tethering APEX instead.
|
|
||||||
cc_library_static {
|
|
||||||
name: "libservice-connectivity-static",
|
|
||||||
defaults: ["libservice-connectivity-defaults"],
|
|
||||||
}
|
|
||||||
|
|
||||||
java_library {
|
java_library {
|
||||||
name: "service-connectivity",
|
name: "service-connectivity",
|
||||||
srcs: [
|
srcs: [
|
||||||
@@ -75,5 +60,6 @@ java_library {
|
|||||||
],
|
],
|
||||||
apex_available: [
|
apex_available: [
|
||||||
"//apex_available:platform",
|
"//apex_available:platform",
|
||||||
|
"com.android.tethering",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ public final class ConnectivityServiceInitializer extends SystemService {
|
|||||||
|
|
||||||
public ConnectivityServiceInitializer(Context context) {
|
public ConnectivityServiceInitializer(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
|
// Load JNI libraries used by ConnectivityService and its dependencies
|
||||||
|
System.loadLibrary("service-connectivity");
|
||||||
// TODO: Define formal APIs to get the needed services.
|
// TODO: Define formal APIs to get the needed services.
|
||||||
mConnectivity = new ConnectivityService(context, getNetworkManagementService(),
|
mConnectivity = new ConnectivityService(context, getNetworkManagementService(),
|
||||||
getNetworkStatsService(), getNetworkPolicyManager());
|
getNetworkStatsService(), getNetworkPolicyManager());
|
||||||
|
|||||||
@@ -70,4 +70,7 @@ android_test {
|
|||||||
"android.test.base",
|
"android.test.base",
|
||||||
"android.test.mock",
|
"android.test.mock",
|
||||||
],
|
],
|
||||||
|
jni_libs: [
|
||||||
|
"libservice-connectivity",
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user