diff options
author | Jason Monk <jmonk@google.com> | 2014-12-16 17:11:29 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-12-16 17:11:29 +0000 |
commit | 2e904fdd28263b9dc0015c46c99a1fd8030a7aed (patch) | |
tree | fb9dabe2022fad05a70d0cbdfb2128dcadc7f746 /src/com/android/settings/wifi | |
parent | 506c13fd306bf9b1275a2ae2a6c1197fd9caebde (diff) | |
parent | c0ecaeefe8d22c8dbd77c51090cb55e1c448b983 (diff) | |
download | packages_apps_Settings-2e904fdd28263b9dc0015c46c99a1fd8030a7aed.zip packages_apps_Settings-2e904fdd28263b9dc0015c46c99a1fd8030a7aed.tar.gz packages_apps_Settings-2e904fdd28263b9dc0015c46c99a1fd8030a7aed.tar.bz2 |
am c0ecaeef: am 5aaa4b63: am b0c8c393: Merge "Add a periodic check of the tethering provisioning" into lmp-mr1-dev
* commit 'c0ecaeefe8d22c8dbd77c51090cb55e1c448b983':
Add a periodic check of the tethering provisioning
Diffstat (limited to 'src/com/android/settings/wifi')
-rw-r--r-- | src/com/android/settings/wifi/WifiApEnabler.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/com/android/settings/wifi/WifiApEnabler.java b/src/com/android/settings/wifi/WifiApEnabler.java index 88bb9fa..6aecf1f 100644 --- a/src/com/android/settings/wifi/WifiApEnabler.java +++ b/src/com/android/settings/wifi/WifiApEnabler.java @@ -68,15 +68,16 @@ public class WifiApEnabler { } else if (Intent.ACTION_AIRPLANE_MODE_CHANGED.equals(action)) { enableWifiSwitch(); } - } }; public WifiApEnabler(Context context, SwitchPreference switchPreference) { mContext = context; mSwitch = switchPreference; - mOriginalSummary = switchPreference.getSummary(); - switchPreference.setPersistent(false); + mOriginalSummary = switchPreference != null ? switchPreference.getSummary() : ""; + if (switchPreference != null) { + switchPreference.setPersistent(false); + } mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); mCm = (ConnectivityManager)mContext.getSystemService(Context.CONNECTIVITY_SERVICE); @@ -121,10 +122,14 @@ public class WifiApEnabler { } if (mWifiManager.setWifiApEnabled(null, enable)) { - /* Disable here, enabled on receiving success broadcast */ - mSwitch.setEnabled(false); + if (mSwitch != null) { + /* Disable here, enabled on receiving success broadcast */ + mSwitch.setEnabled(false); + } } else { - mSwitch.setSummary(R.string.wifi_error); + if (mSwitch != null) { + mSwitch.setSummary(R.string.wifi_error); + } } /** |