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
Родитель b20d292747
Коммит 27f7234a5c
1 изменённых файлов: 20 добавлений и 2 удалений

Просмотреть файл

@ -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) {