Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 04675f6a authored by Vinit Deshapnde's avatar Vinit Deshapnde
Browse files

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
parent 46507f4b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);
                }