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
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);
}
/**
+ * 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.
*
* <p>This method will start the network stack either in the network stack process, or inside
*/
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