Bug 997791 - 0001. Remove ignore settings flags. r=vchang
authorChuck Lee <chulee@mozilla.com>
Mon, 21 Apr 2014 20:06:24 +0800
changeset 198416 9cd74c2fa85715f6828a326da31fde742a8e2f53
parent 198415 56c769a1a173bda8faa9f78d80aa78d28d661d1f
child 198417 b44b035604b446f88f47e3615029ba70a28a9feb
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvchang
bugs997791
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 997791 - 0001. Remove ignore settings flags. r=vchang
dom/wifi/WifiWorker.js
--- a/dom/wifi/WifiWorker.js
+++ b/dom/wifi/WifiWorker.js
@@ -1826,32 +1826,30 @@ function WifiWorker() {
     } catch (e) {
       self._allowWpaEap = false;
     }
 
     // Notify everybody, even if they didn't ask us to come up.
     WifiManager.getMacAddress(function (mac) {
       self.macAddress = mac;
       debug("Got mac: " + mac);
-      self._ignoreNextWifiEnabledSetting = true;
       self._fireEvent("wifiUp", { macAddress: mac });
       self.requestDone();
     });
 
     if (WifiManager.state === "SCANNING")
       startScanStuckTimer();
   };
 
   WifiManager.onsupplicantlost = function() {
     WifiManager.enabled = WifiManager.supplicantStarted = false;
     WifiManager.state = "UNINITIALIZED";
     debug("Supplicant died!");
 
     // Notify everybody, even if they didn't ask us to come up.
-    self._ignoreNextWifiDisabledSetting = true;
     self._fireEvent("wifiDown", {});
     self.requestDone();
   };
 
   WifiManager.onpasswordmaybeincorrect = function() {
     WifiManager.authenticationFailuresCount++;
   };
 
@@ -2272,23 +2270,16 @@ WifiWorker.prototype = {
   disconnectedByWifi: false,
 
   disconnectedByWifiTethering: false,
 
   _wifiTetheringSettingsToRead: [],
 
   _oldWifiTetheringEnabledState: null,
 
-  // 930355: Workaround before bug 930355 is landed.
-  // Current system app will set settings value "wifi.enabled" after receiving
-  // wifi enable/disable event, this will cause infinite loop between gaia
-  // and gecko, so now use this variable to cut the loop.
-  _ignoreNextWifiDisabledSetting: false,
-  _ignoreNextWifiEnabledSetting: false,
-
   tetheringSettings: {},
 
   initTetheringSettings: function initTetheringSettings() {
     this.tetheringSettings[SETTINGS_WIFI_TETHERING_ENABLED] = null;
     this.tetheringSettings[SETTINGS_WIFI_SSID] = DEFAULT_WIFI_SSID;
     this.tetheringSettings[SETTINGS_WIFI_SECURITY_TYPE] = DEFAULT_WIFI_SECURITY_TYPE;
     this.tetheringSettings[SETTINGS_WIFI_SECURITY_PASSWORD] = DEFAULT_WIFI_SECURITY_PASSWORD;
     this.tetheringSettings[SETTINGS_WIFI_IP] = DEFAULT_WIFI_IP;
@@ -3226,24 +3217,16 @@ WifiWorker.prototype = {
     }
 
     this.handle(setting.key, setting.value);
   },
 
   handle: function handle(aName, aResult) {
     switch(aName) {
       case SETTINGS_WIFI_ENABLED:
-        if (this._ignoreNextWifiEnabledSetting && aResult) {
-          this._ignoreNextWifiEnabledSetting = false;
-          break;
-        }
-        if (this._ignoreNextWifiDisabledSetting && !aResult) {
-          this._ignoreNextWifiDisabledSetting = false;
-          break;
-        }
         this.handleWifiEnabled(aResult)
         break;
       case SETTINGS_WIFI_DEBUG_ENABLED:
         if (aResult === null)
           aResult = false;
         DEBUG = aResult;
         updateDebug();
         break;