From 04675f6ae9769bd174a54097f3c802550e410a16 Mon Sep 17 00:00:00 2001 From: Vinit Deshapnde Date: Thu, 3 Oct 2013 16:18:56 -0700 Subject: [PATCH] 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 --- services/java/com/android/server/SystemServer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index ef50df722fe0a..0e0f15625823f 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -515,8 +515,9 @@ class ServerThread { 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); }