Bug 786283 backout - this doesn't work the way it should (android doesn't send failure back for failed scans). r=backout
authorBlake Kaplan <mrbkap@gmail.com>
Tue, 28 Aug 2012 17:36:22 -0300
changeset 105680 9e267fbca9fb42fe17e199bc83c44f79b1333107
parent 105679 61faabceedd4d18ac34178fca4f5e4fd16b4f26e
child 105728 0b4bc3760d51cbb235f01b737c67efd9728a9dd7
child 105745 2464ccbf691f1dc08f219ff83ea392eaaeecb6e7
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewersbackout
bugs786283
milestone18.0a1
Bug 786283 backout - this doesn't work the way it should (android doesn't send failure back for failed scans). r=backout
dom/wifi/WifiWorker.js
--- a/dom/wifi/WifiWorker.js
+++ b/dom/wifi/WifiWorker.js
@@ -2021,33 +2021,20 @@ WifiWorker.prototype = {
 
   getNetworks: function(msg) {
     const message = "WifiManager:getNetworks:Return";
     if (!WifiManager.enabled) {
       this._sendMessage(message, false, "Wifi is disabled", msg);
       return;
     }
 
-    let callback = (function (networks) {
+    this.waitForScan((function (networks) {
       this._sendMessage(message, networks !== null, networks, msg);
-    }).bind(this);
-    this.waitForScan(callback);
-
-    WifiManager.scan(true, (function(ok) {
-      // If the scan command succeeded, we're done.
-      if (ok)
-        return;
-
-      // Avoid sending multiple responses.
-      this.wantScanResults.splice(this.wantScanResults.indexOf(callback), 1);
-
-      // Otherwise, let the client know that it failed, it's responsible for
-      // trying again in a few seconds.
-      this._sendMessage(message, false, "ScanFailed", msg);
     }).bind(this));
+    WifiManager.scan(true, function() {});
   },
 
   _notifyAfterStateChange: function(success, newState) {
     // First, notify all of the requests that were trying to make this change.
     let state = this._stateRequests[0].enabled;
 
     // If the new state is not the same as state, then we weren't processing
     // the first request (we were racing somehow) so don't notify.