From 4a90a7d5979b5da18c331aa320fcd1197e0374a9 Mon Sep 17 00:00:00 2001 From: Edgar Chen Date: Fri, 13 Feb 2015 16:03:49 +0800 Subject: [PATCH] Bug 1166274 - Part 1: Handle the callback and IPC message of setStaticIpMode correctly. r=vchang --- dom/wifi/WifiWorker.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dom/wifi/WifiWorker.js b/dom/wifi/WifiWorker.js index ad2d55cda409..22b989cbf8cd 100644 --- a/dom/wifi/WifiWorker.js +++ b/dom/wifi/WifiWorker.js @@ -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 @@ -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); }); } @@ -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;