mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-10 17:24:29 +00:00
Bug 742797 - Fix shutdown on ICS. r=cjones DONTBUILD
This commit is contained in:
parent
5e3fddb58d
commit
7e14680004
@ -164,6 +164,10 @@ var WifiManager = (function() {
|
||||
voidControlMessage("start_supplicant", callback);
|
||||
}
|
||||
|
||||
function terminateSupplicant(callback) {
|
||||
doBooleanCommand("TERMINATE", "OK", callback);
|
||||
}
|
||||
|
||||
function stopSupplicant(callback) {
|
||||
voidControlMessage("stop_supplicant", callback);
|
||||
}
|
||||
@ -895,15 +899,17 @@ var WifiManager = (function() {
|
||||
});
|
||||
});
|
||||
} else {
|
||||
stopSupplicant(function (status) {
|
||||
if (status < 0) {
|
||||
callback(-1);
|
||||
return;
|
||||
}
|
||||
|
||||
manager.state = "UNINITIALIZED";
|
||||
disableInterface(manager.ifname, function (ok) {
|
||||
unloadDriver(callback);
|
||||
// Note these following calls ignore errors. If we fail to kill the
|
||||
// supplicant gracefully, then we need to continue telling it to die
|
||||
// until it does.
|
||||
terminateSupplicant(function (ok) {
|
||||
stopSupplicant(function (status) {
|
||||
manager.state = "UNINITIALIZED";
|
||||
closeSupplicantConnection(function () {
|
||||
disableInterface(manager.ifname, function (ok) {
|
||||
unloadDriver(callback);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ let libhardware_legacy = (function () {
|
||||
connect_to_supplicant: library.declare("wifi_connect_to_supplicant", ctypes.default_abi, ctypes.int),
|
||||
|
||||
// Close connection to connection to the supplicant, 0 on success, < 0 on failure.
|
||||
close_supplicant_connection: library.declare("wifi_close_supplicant_connection", ctypes.default_abi, ctypes.int),
|
||||
close_supplicant_connection: library.declare("wifi_close_supplicant_connection", ctypes.default_abi, ctypes.void_t),
|
||||
|
||||
// Block until a wifi event is returned, buf is the buffer, len is the max length of the buffer.
|
||||
// Return value is number of bytes in buffer, or 0 if no event (no connection for instance), and < 0 on failure.
|
||||
|
@ -90,6 +90,10 @@ self.onmessage = function(e) {
|
||||
var ret = libcutils.property_set(data.key, data.value);
|
||||
postMessage({ id: id, status: ret });
|
||||
break;
|
||||
case "close_supplicant_connection":
|
||||
libhardware_legacy.close_supplicant_connection();
|
||||
postMessage({ id: id, status: ret });
|
||||
break;
|
||||
default:
|
||||
var f = libhardware_legacy[cmd] || libnetutils[cmd];
|
||||
var ret = f();
|
||||
|
Loading…
x
Reference in New Issue
Block a user