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

Commit 80f84a15 authored by Irfan Sheriff's avatar Irfan Sheriff Committed by Android (Google) Code Review
Browse files

Merge "Fetch WifiManager instance at the time of use" into jb-dev

parents 665a376d 4f4f5166
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;
    }