Set P2p statemachine's network manager before starting Wifi
Wifi statemachine starts P2p statemachine; which uses network management
service to (i.e. netd) to start p2p0 interface. But it only gets a
reference to network management service in conenctivityServiceReady().
Calling that later means there's a chance of a race between this
thread's setting of the network manager, and P2p statemachine thread's
usage of the same.
Bug: 11048296
Change-Id: If151026ed5fbb12db57ee7f9bdd47c67dd7142e5
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index ef50df7..0e0f156 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -515,8 +515,9 @@
ServiceManager.addService(Context.CONNECTIVITY_SERVICE, connectivity);
networkStats.bindConnectivityManager(connectivity);
networkPolicy.bindConnectivityManager(connectivity);
- wifi.checkAndStartWifi();
+
wifiP2p.connectivityServiceReady();
+ wifi.checkAndStartWifi();
} catch (Throwable e) {
reportWtf("starting Connectivity Service", e);
}