summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/SystemServer.java
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2019-06-27 14:14:40 -0700
committerRemi NGUYEN VAN <reminv@google.com>2019-08-23 12:18:52 +0900
commitb51c428f41c4d09222edfc393e3b41b9dffd3bb2 (patch)
treeecddb9319e5281115e2f487e48c470b6cd736670 /services/java/com/android/server/SystemServer.java
parent68770715e3feb7d631c4af4b15db28ebd3419f41 (diff)
NetworkStackClient: Refactor network stack process interaction
Refactor NetworkStackClient class to move the module service binding & network stack process death monitoring to a separate class. This class will only instantiated in the SystemServer process. The new class |SystemServerToNetworkStackConnector| will be used from the client classes corresponding to each module running on the network stack process (NetworkStackClient, WifiStackClient, etc) This has 2 main advantages: a) Reduces code duplication (Otherwise the various Client classes need to replicate the service bindding & process death monitoring). b) Central crash recovery for the network stack process (Otherwise the various Client classes will trigger multiple recovery for a single network stack process crash). Bug: 135679762 Test: Device boots up & connects to wifi networks. Change-Id: I673581b0067b9a3f72dd68a3ab622c18183ebd2e Merged-In: I673581b0067b9a3f72dd68a3ab622c18183ebd2e (cherry picked from commit 7e6f5f5e080f2d2ae3ef0397c21bd666f5ce4d31)
Diffstat (limited to 'services/java/com/android/server/SystemServer.java')
-rw-r--r--services/java/com/android/server/SystemServer.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 656af982859e..e6ed2edba807 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -37,6 +37,8 @@ import android.content.res.Resources.Theme;
import android.database.sqlite.SQLiteCompatibilityWalFlags;
import android.database.sqlite.SQLiteGlobal;
import android.hardware.display.DisplayManagerInternal;
+import android.net.ConnectivityModuleConnector;
+import android.net.Network;
import android.net.NetworkStackClient;
import android.os.BaseBundle;
import android.os.Binder;
@@ -1269,6 +1271,14 @@ public final class SystemServer {
mSystemServiceManager.startService(CONTENT_SUGGESTIONS_SERVICE_CLASS);
traceEnd();
+ traceBeginAndSlog("InitConnectivityModuleConnector");
+ try {
+ ConnectivityModuleConnector.getInstance().init(context);
+ } catch (Throwable e) {
+ reportWtf("initializing ConnectivityModuleConnector", e);
+ }
+ traceEnd();
+
traceBeginAndSlog("InitNetworkStackClient");
try {
NetworkStackClient.getInstance().init();
@@ -2163,7 +2173,7 @@ public final class SystemServer {
// ActivityManagerService.mSystemReady and ActivityManagerService.mProcessesReady
// are set to true. Be careful if moving this to a different place in the
// startup sequence.
- NetworkStackClient.getInstance().start(context);
+ NetworkStackClient.getInstance().start();
} catch (Throwable e) {
reportWtf("starting Network Stack", e);
}