Bug 1167132 - Part 12: [NetworkManager] Move network information into a separate interface (discovery). r=jryans

This commit is contained in:
Jessica Jong 2015-07-29 02:13:00 -04:00
parent 808f2aba91
commit 065eaa1fdc

View File

@ -385,16 +385,16 @@ Discovery.prototype = {
if (topic !== "network-active-changed") {
return;
}
let activeNetwork = subject;
if (!activeNetwork) {
log("No active network");
let activeNetworkInfo = subject;
if (!activeNetworkInfo) {
log("No active network info");
return;
}
activeNetwork = activeNetwork.QueryInterface(Ci.nsINetworkInterface);
log("Active network changed to: " + activeNetwork.type);
activeNetworkInfo = activeNetworkInfo.QueryInterface(Ci.nsINetworkInfo);
log("Active network changed to: " + activeNetworkInfo.type);
// UDP sockets go down when the device goes offline, so we'll restart them
// when the active network goes back to WiFi.
if (activeNetwork.type === Ci.nsINetworkInterface.NETWORK_TYPE_WIFI) {
if (activeNetworkInfo.type === Ci.nsINetworkInfo.NETWORK_TYPE_WIFI) {
this._restartListening();
}
},