Bug 1000518 - [B2G][Settings] Wifi cannot obtain IP address or forget network. r=chulee a=1.3t+
authorVincent Chang <vchang@mozilla.com>
Fri, 25 Apr 2014 11:57:50 +0800
changeset 171882 6d4d970ee0e3f7e6018539676c3124aadaf69213
parent 171881 eb6892940eb16aa95e4bbe12a8a14bf8199ad0ad
child 171883 230e22af95ec2ea01cd349ffceaee6b7f607d7a0
push id429
push userfdesre@mozilla.com
push dateMon, 05 May 2014 20:59:19 +0000
reviewerschulee, 1.3t
bugs1000518
milestone28.1
Bug 1000518 - [B2G][Settings] Wifi cannot obtain IP address or forget network. r=chulee a=1.3t+
dom/wifi/WifiWorker.js
--- a/dom/wifi/WifiWorker.js
+++ b/dom/wifi/WifiWorker.js
@@ -911,16 +911,20 @@ var WifiManager = (function() {
               cancelWaitForDriverReadyTimer();
 
               if (!manager.connectToSupplicant) {
                 startSupplicantInternal();
                 return;
               }
               wifiCommand.closeSupplicantConnection(function () {
                 manager.connectToSupplicant = false;
+                // closeSupplicantConnection() will trigger onsupplicantlost
+                // and set manager.state to "UNINITIALIZED", we have to
+                // restore it here.
+                manager.state = "INITIALIZING";
                 startSupplicantInternal();
               });
             }
             // Driver startup on certain platforms takes longer than it takes for us
             // to return from loadDriver, so wait 2 seconds before starting
             // the supplicant to give it a chance to start.
             if (manager.driverDelay > 0) {
               createWaitForDriverReadyTimer(doStartSupplicant);