Skip to content

Commit

Permalink
Bug 1166274 - Part 1: Handle the callback and IPC message of setStati…
Browse files Browse the repository at this point in the history
…cIpMode correctly. r=vchang
  • Loading branch information
EdgarChen committed Feb 13, 2015
1 parent 6cb8084 commit 4a90a7d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions dom/wifi/WifiWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ var WifiManager = (function() {
let currentNetwork = Object.create(null);
currentNetwork.netId = manager.connectionInfo.id;

manager.getNetworkConfiguration(currentNetwork, function (){
manager.getNetworkConfiguration(currentNetwork, function () {
curNetworkKey = getNetworkKey(currentNetwork);

// Add additional information to static ip configuration
Expand All @@ -435,15 +435,19 @@ var WifiManager = (function() {
// If the ssid of current connection is the same as configured ssid
// It means we need update current connection to use static IP address.
if (setNetworkKey == curNetworkKey) {
// Use configureInterface directly doesn't work, the network iterface
// Use configureInterface directly doesn't work, the network interface
// and routing table is changed but still cannot connect to network
// so the workaround here is disable interface the enable again to
// trigger network reconnect with static ip.
gNetworkService.disableInterface(manager.ifname, function (ok) {
gNetworkService.enableInterface(manager.ifname, function (ok) {
callback(ok);
});
});
return;
}

callback(true);
});
}

Expand Down Expand Up @@ -3494,7 +3498,7 @@ WifiWorker.prototype = {
},

setStaticIpMode: function(msg) {
const message = "WifiManager:setStaticMode:Return";
const message = "WifiManager:setStaticIpMode:Return";
let self = this;
let network = msg.data.network;
let info = msg.data.info;
Expand Down

0 comments on commit 4a90a7d

Please sign in to comment.