resolved conflicts for merge of f9360dbc
to master
Change-Id: I2e468d83a7ce5200c59f63b4362e7bee10d0a2eb
This commit is contained in:
@@ -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) {
|
||||
|
@@ -136,8 +136,6 @@ public class WifiSettings extends RestrictedSettingsFragment
|
||||
private AccessPoint mDlgAccessPoint;
|
||||
private Bundle mAccessPointSavedState;
|
||||
|
||||
private SwitchBar mSwitchBar;
|
||||
|
||||
/** verbose logging flag. this flag is set thru developer debugging options
|
||||
* and used so as to assist with in-the-field WiFi connectivity debugging */
|
||||
public static int mVerboseLogging = 0;
|
||||
@@ -232,6 +230,15 @@ public class WifiSettings extends RestrictedSettingsFragment
|
||||
setHasOptionsMenu(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
|
||||
if (mWifiEnabler != null) {
|
||||
mWifiEnabler.teardownSwitchBar();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
|
Reference in New Issue
Block a user