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:
Remi NGUYEN VAN
2020-10-23 17:57:31 +09:00
parent 26dbdc853b
commit dbbf7a3b4e
8 changed files with 18 additions and 28 deletions

View File

@@ -221,6 +221,8 @@ public final class SystemServer {
"com.android.server.companion.CompanionDeviceManagerService";
private static final String STATS_COMPANION_APEX_PATH =
"/apex/com.android.os.statsd/javalib/service-statsd.jar";
private static final String CONNECTIVITY_SERVICE_APEX_PATH =
"/apex/com.android.tethering/javalib/service-connectivity.jar";
private static final String STATS_COMPANION_LIFECYCLE_CLASS =
"com.android.server.stats.StatsCompanion$Lifecycle";
private static final String STATS_PULL_ATOM_SERVICE_CLASS =
@@ -1217,7 +1219,8 @@ public final class SystemServer {
}
t.traceBegin("IpConnectivityMetrics");
mSystemServiceManager.startService(IP_CONNECTIVITY_METRICS_CLASS);
mSystemServiceManager.startServiceFromJar(IP_CONNECTIVITY_METRICS_CLASS,
CONNECTIVITY_SERVICE_APEX_PATH);
t.traceEnd();
t.traceBegin("NetworkWatchlistService");
@@ -1558,8 +1561,8 @@ public final class SystemServer {
// This has to be called after NetworkManagementService, NetworkStatsService
// and NetworkPolicyManager because ConnectivityService needs to take these
// services to initialize.
// TODO: Dynamically load service-connectivity.jar by using startServiceFromJar.
mSystemServiceManager.startService(CONNECTIVITY_SERVICE_INITIALIZER_CLASS);
mSystemServiceManager.startServiceFromJar(CONNECTIVITY_SERVICE_INITIALIZER_CLASS,
CONNECTIVITY_SERVICE_APEX_PATH);
connectivity = IConnectivityManager.Stub.asInterface(
ServiceManager.getService(Context.CONNECTIVITY_SERVICE));
// TODO: Use ConnectivityManager instead of ConnectivityService.