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

Commit d3fd3338 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "P2P : Adding debug information for null pointer exception in p2p"

parents c2c1fe68 d6b1e271
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -560,7 +560,11 @@ class ServerThread {
                       networkStats.bindConnectivityManager(connectivity);
                       networkPolicy.bindConnectivityManager(connectivity);
                       wifi.checkAndStartWifi();
                       try {
                           wifiP2p.connectivityServiceReady();
                       } catch (NullPointerException np){
                          Slog.i(TAG,"Exception while initialsing connectivity service ",np);
                       }
                   }
               } catch (Throwable e) {
                   reportWtf("starting Connectivity Service", e);
+1 −0
Original line number Diff line number Diff line
@@ -3083,6 +3083,7 @@ public class WifiStateMachine extends StateMachine {

            if (mP2pSupported) {
                if (mOperationalMode == CONNECT_MODE) {
                    log("enabling p2p from driver started state");
                    mWifiP2pChannel.sendMessage(WifiStateMachine.CMD_ENABLE_P2P);
                } else {
                    // P2P statemachine starts in disabled state, and is not enabled until
+7 −0
Original line number Diff line number Diff line
@@ -329,8 +329,13 @@ public class WifiP2pService extends IWifiP2pManager.Stub {
    }

    public void connectivityServiceReady() {
        Slog.d(TAG,"Initialising NetworkManagement Service");
        IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE);
        mNwService = INetworkManagementService.Stub.asInterface(b);
        if (mNwService==null) {
           throw new NullPointerException(
           "Failed to intialise NetwrokManagement service from Binder interface");
        }
    }

    private void enforceAccessPermission() {
@@ -811,6 +816,8 @@ public class WifiP2pService extends IWifiP2pManager.Stub {
            switch (message.what) {
                case WifiStateMachine.CMD_ENABLE_P2P:
                    try {
                        if(mNwService == null)
                           loge("NetworkManagement service is null");
                        mNwService.setInterfaceUp(mInterface);
                    } catch (RemoteException re) {
                        loge("Unable to change interface settings: " + re);