diff options
author | Irfan Sheriff <isheriff@google.com> | 2012-04-27 14:42:42 -0700 |
---|---|---|
committer | Irfan Sheriff <isheriff@google.com> | 2012-04-27 14:42:42 -0700 |
commit | 4f4f5166c9379a646de887c4d9ae58fc94afb6ed (patch) | |
tree | f2dc9c129ff675afeb26e575e21c72caac97cf36 /packages/SettingsProvider | |
parent | ca7086f5bdbc404b01863770b6023d069f4ab720 (diff) | |
download | frameworks_base-4f4f5166c9379a646de887c4d9ae58fc94afb6ed.zip frameworks_base-4f4f5166c9379a646de887c4d9ae58fc94afb6ed.tar.gz frameworks_base-4f4f5166c9379a646de887c4d9ae58fc94afb6ed.tar.bz2 |
Fetch WifiManager instance at the time of use
Bug: 5340393
Change-Id: Idb0a6dbe969bc3c7955134df43b86f28208c73c3
Diffstat (limited to 'packages/SettingsProvider')
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java index 2444829..50aaa9a 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java @@ -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; } |