resolved conflicts for merge of f9360dbc to master

Change-Id: I2e468d83a7ce5200c59f63b4362e7bee10d0a2eb
This commit is contained in:
Fabrice Di Meglio
2014-06-12 15:46:41 -07:00
13 changed files with 195 additions and 86 deletions

View File

@@ -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) {