summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/wifi/WifiEnabler.java
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2014-06-12 15:46:41 -0700
committerFabrice Di Meglio <fdimeglio@google.com>2014-06-12 15:46:41 -0700
commit204521626f63bef4a8ac2d76334b94dbb0f3aa3b (patch)
treec3e6b3dc0d76ba02cdec23a8ce57d8f6e6a1cba0 /src/com/android/settings/wifi/WifiEnabler.java
parent524a63b493c2c9692dd09669173c96e69e09297c (diff)
parentf9360dbcef1ac3355036724a74e9ca29e6475b37 (diff)
downloadpackages_apps_Settings-204521626f63bef4a8ac2d76334b94dbb0f3aa3b.tar.gz
packages_apps_Settings-204521626f63bef4a8ac2d76334b94dbb0f3aa3b.tar.bz2
packages_apps_Settings-204521626f63bef4a8ac2d76334b94dbb0f3aa3b.zip
resolved conflicts for merge of f9360dbc to master
Change-Id: I2e468d83a7ce5200c59f63b4362e7bee10d0a2eb
Diffstat (limited to 'src/com/android/settings/wifi/WifiEnabler.java')
-rw-r--r--src/com/android/settings/wifi/WifiEnabler.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/com/android/settings/wifi/WifiEnabler.java b/src/com/android/settings/wifi/WifiEnabler.java
index d19004507..dc3974e30 100644
--- a/src/com/android/settings/wifi/WifiEnabler.java
+++ b/src/com/android/settings/wifi/WifiEnabler.java
@@ -100,20 +100,27 @@ public class WifiEnabler implements SwitchBar.OnSwitchChangeListener {
// The order matters! We really should not depend on this. :(
mIntentFilter.addAction(WifiManager.SUPPLICANT_STATE_CHANGED_ACTION);
mIntentFilter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
+ setupSwitchBar();
+ }
+
+ public void setupSwitchBar() {
+ mSwitchBar.addOnSwitchChangeListener(this);
+ mSwitchBar.show();
+ }
+
+ public void teardownSwitchBar() {
+ mSwitchBar.removeOnSwitchChangeListener(this);
+ mSwitchBar.hide();
}
public void resume(Context context) {
mContext = context;
// Wi-Fi state is sticky, so just let the receiver update UI
mContext.registerReceiver(mReceiver, mIntentFilter);
- mSwitchBar.addOnSwitchChangeListener(this);
- mSwitchBar.show();
}
public void pause() {
mContext.unregisterReceiver(mReceiver);
- mSwitchBar.removeOnSwitchChangeListener(this);
- mSwitchBar.hide();
}
private void handleWifiStateChanged(int state) {