Merge "Fix network reload when config is restored" into jb-mr2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
4d9431ab35
@@ -156,7 +156,7 @@ class WifiConfigStore {
|
|||||||
* Fetch the list of configured networks
|
* Fetch the list of configured networks
|
||||||
* and enable all stored networks in supplicant.
|
* and enable all stored networks in supplicant.
|
||||||
*/
|
*/
|
||||||
void initialize() {
|
void loadAndEnableAllNetworks() {
|
||||||
if (DBG) log("Loading config and enabling all networks");
|
if (DBG) log("Loading config and enabling all networks");
|
||||||
loadConfiguredNetworks();
|
loadConfiguredNetworks();
|
||||||
enableAllNetworks();
|
enableAllNetworks();
|
||||||
|
|||||||
@@ -1111,6 +1111,7 @@ public class WifiStateMachine extends StateMachine {
|
|||||||
pw.println("mUserWantsSuspendOpt " + mUserWantsSuspendOpt);
|
pw.println("mUserWantsSuspendOpt " + mUserWantsSuspendOpt);
|
||||||
pw.println("mSuspendOptNeedsDisabled " + mSuspendOptNeedsDisabled);
|
pw.println("mSuspendOptNeedsDisabled " + mSuspendOptNeedsDisabled);
|
||||||
pw.println("Supplicant status " + mWifiNative.status());
|
pw.println("Supplicant status " + mWifiNative.status());
|
||||||
|
pw.println("mEnableBackgroundScan " + mEnableBackgroundScan);
|
||||||
pw.println();
|
pw.println();
|
||||||
mWifiConfigStore.dump(fd, pw, args);
|
mWifiConfigStore.dump(fd, pw, args);
|
||||||
}
|
}
|
||||||
@@ -2121,7 +2122,7 @@ public class WifiStateMachine extends StateMachine {
|
|||||||
mLastSignalLevel = -1;
|
mLastSignalLevel = -1;
|
||||||
|
|
||||||
mWifiInfo.setMacAddress(mWifiNative.getMacAddress());
|
mWifiInfo.setMacAddress(mWifiNative.getMacAddress());
|
||||||
mWifiConfigStore.initialize();
|
mWifiConfigStore.loadAndEnableAllNetworks();
|
||||||
initializeWpsDetails();
|
initializeWpsDetails();
|
||||||
|
|
||||||
sendSupplicantConnectionChangedBroadcast(true);
|
sendSupplicantConnectionChangedBroadcast(true);
|
||||||
@@ -2657,9 +2658,13 @@ public class WifiStateMachine extends StateMachine {
|
|||||||
public void exit() {
|
public void exit() {
|
||||||
if (mLastOperationMode == SCAN_ONLY_WITH_WIFI_OFF_MODE) {
|
if (mLastOperationMode == SCAN_ONLY_WITH_WIFI_OFF_MODE) {
|
||||||
setWifiState(WIFI_STATE_ENABLED);
|
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);
|
mWifiP2pChannel.sendMessage(CMD_ENABLE_P2P);
|
||||||
}
|
} else {
|
||||||
mWifiConfigStore.enableAllNetworks();
|
mWifiConfigStore.enableAllNetworks();
|
||||||
|
}
|
||||||
mWifiNative.reconnect();
|
mWifiNative.reconnect();
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user