Toggling off and on the Wifi Checkbox will not scan wifi networks anymore (bug 774876, r=gal).

This commit is contained in:
Blake Kaplan 2012-07-23 14:41:29 -07:00
parent 35181411e8
commit 5798bd9c6f

View File

@ -126,12 +126,30 @@ var WifiManager = (function() {
});
}
var driverLoaded = false;
function loadDriver(callback) {
voidControlMessage("load_driver", callback);
if (driverLoaded) {
callback(0);
return;
}
voidControlMessage("load_driver", function(status) {
driverLoaded = (status >= 0);
callback(status)
});
}
function unloadDriver(callback) {
voidControlMessage("unload_driver", callback);
// Otoro ICS can't unload and then load the driver, so never unload it.
if (device === "otoro") {
callback(0);
return;
}
voidControlMessage("unload_driver", function(status) {
driverLoaded = (status < 0);
callback(status);
});
}
function startSupplicant(callback) {