Merge "Fix network reload when config is restored" into jb-mr2-dev

This commit is contained in:
Irfan Sheriff
2013-04-26 16:52:51 +00:00
committed by Android (Google) Code Review
2 changed files with 8 additions and 3 deletions

View File

@@ -156,7 +156,7 @@ class WifiConfigStore {
* Fetch the list of configured networks
* and enable all stored networks in supplicant.
*/
void initialize() {
void loadAndEnableAllNetworks() {
if (DBG) log("Loading config and enabling all networks");
loadConfiguredNetworks();
enableAllNetworks();

View File

@@ -1111,6 +1111,7 @@ public class WifiStateMachine extends StateMachine {
pw.println("mUserWantsSuspendOpt " + mUserWantsSuspendOpt);
pw.println("mSuspendOptNeedsDisabled " + mSuspendOptNeedsDisabled);
pw.println("Supplicant status " + mWifiNative.status());
pw.println("mEnableBackgroundScan " + mEnableBackgroundScan);
pw.println();
mWifiConfigStore.dump(fd, pw, args);
}
@@ -2121,7 +2122,7 @@ public class WifiStateMachine extends StateMachine {
mLastSignalLevel = -1;
mWifiInfo.setMacAddress(mWifiNative.getMacAddress());
mWifiConfigStore.initialize();
mWifiConfigStore.loadAndEnableAllNetworks();
initializeWpsDetails();
sendSupplicantConnectionChangedBroadcast(true);
@@ -2657,9 +2658,13 @@ public class WifiStateMachine extends StateMachine {
public void exit() {
if (mLastOperationMode == SCAN_ONLY_WITH_WIFI_OFF_MODE) {
setWifiState(WIFI_STATE_ENABLED);
// Load and re-enable networks when going back to enabled state
// This is essential for networks to show up after restore
mWifiConfigStore.loadAndEnableAllNetworks();
mWifiP2pChannel.sendMessage(CMD_ENABLE_P2P);
} else {
mWifiConfigStore.enableAllNetworks();
}
mWifiConfigStore.enableAllNetworks();
mWifiNative.reconnect();
}
@Override