Initialize the NetworkStack before WiFi
The NetworkStack needs to be marked as start requested before any client can use it from the system server, so it knows to queue requests until it actually comes up. This fixes a bug introduced in commit: I93315ad31925bd436e21d1eabb21d5967e6aae60 where a client trying to use the network stack in the system server before ActivityManager.systemReady() could block and eventually timeout, resulting in a null INetworkStackConnector. Test: booted, WiFi working Bug: 128620654 Change-Id: Ieca2657373eba78195b387fb266fa0424fce8ada
This commit is contained in:
@@ -1118,6 +1118,14 @@ public final class SystemServer {
|
||||
mSystemServiceManager.startService(ClipboardService.class);
|
||||
traceEnd();
|
||||
|
||||
traceBeginAndSlog("InitNetworkStackClient");
|
||||
try {
|
||||
NetworkStackClient.getInstance().init();
|
||||
} catch (Throwable e) {
|
||||
reportWtf("initializing NetworkStackClient", e);
|
||||
}
|
||||
traceEnd();
|
||||
|
||||
traceBeginAndSlog("StartNetworkManagementService");
|
||||
try {
|
||||
networkManagement = NetworkManagementService.create(context);
|
||||
|
||||
@@ -164,6 +164,15 @@ public class NetworkStackClient {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the network stack. Should be called only once on device startup, before any
|
||||
* client attempts to use the network stack.
|
||||
*/
|
||||
public void init() {
|
||||
log("Network stack init");
|
||||
mNetworkStackStartRequested = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the network stack. Should be called only once on device startup.
|
||||
*
|
||||
@@ -174,8 +183,6 @@ public class NetworkStackClient {
|
||||
*/
|
||||
public void start(Context context) {
|
||||
log("Starting network stack");
|
||||
mNetworkStackStartRequested = true;
|
||||
|
||||
final PackageManager pm = context.getPackageManager();
|
||||
|
||||
// Try to bind in-process if the device was shipped with an in-process version
|
||||
|
||||
Reference in New Issue
Block a user