diff options
author | Fabrice Di Meglio <fdimeglio@google.com> | 2014-06-12 15:46:41 -0700 |
---|---|---|
committer | Fabrice Di Meglio <fdimeglio@google.com> | 2014-06-12 15:46:41 -0700 |
commit | 204521626f63bef4a8ac2d76334b94dbb0f3aa3b (patch) | |
tree | c3e6b3dc0d76ba02cdec23a8ce57d8f6e6a1cba0 /src/com/android/settings/wifi/WifiEnabler.java | |
parent | 524a63b493c2c9692dd09669173c96e69e09297c (diff) | |
parent | f9360dbcef1ac3355036724a74e9ca29e6475b37 (diff) | |
download | packages_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.java | 15 |
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) { |