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

Commit ba5d8db2 authored by Irfan Sheriff's avatar Irfan Sheriff Committed by Android Git Automerger
Browse files

am 80f84a15: Merge "Fetch WifiManager instance at the time of use" into jb-dev

* commit '80f84a15':
  Fetch WifiManager instance at the time of use
parents 674c6ef1 80f84a15
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -681,10 +681,15 @@ public class SettingsBackupAgent extends BackupAgentHelper {
    }

    private int enableWifi(boolean enable) {
        if (mWfm == null) {
            mWfm = (WifiManager) getSystemService(Context.WIFI_SERVICE);
        }
        if (mWfm != null) {
            int state = mWfm.getWifiState();
            mWfm.setWifiEnabled(enable);
            return state;
        } else {
            Log.e(TAG, "Failed to fetch WifiManager instance");
        }
        return WifiManager.WIFI_STATE_UNKNOWN;
    }