mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 20:30:41 +00:00
Bug 1210370 - Close wpa_supplicant before we shutdown nsIWifiProxyService. r=mrbkap
This commit is contained in:
parent
a7f6bfabe9
commit
ea75f93420
@ -248,6 +248,10 @@ WifiProxyService::SendCommand(JS::Handle<JS::Value> aOptions,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (!mControlThread) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// Dispatch the command to the control thread.
|
||||
CommandOptions commandOptions(options);
|
||||
nsCOMPtr<nsIRunnable> runnable = new ControlRunnable(commandOptions, aInterface);
|
||||
@ -293,8 +297,10 @@ WifiProxyService::DispatchWifiResult(const WifiResultOptions& aOptions, const ns
|
||||
return;
|
||||
}
|
||||
|
||||
// Call the listener with a JS value.
|
||||
mListener->OnCommand(val, aInterface);
|
||||
if (mListener) {
|
||||
// Call the listener with a JS value.
|
||||
mListener->OnCommand(val, aInterface);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1432,6 +1432,14 @@ var WifiManager = (function() {
|
||||
? wifiCommand.getConnectionInfoICS
|
||||
: wifiCommand.getConnectionInfoGB;
|
||||
|
||||
manager.ensureSupplicantDetached = aCallback => {
|
||||
if (!manager.enabled) {
|
||||
aCallback();
|
||||
return;
|
||||
}
|
||||
wifiCommand.closeSupplicantConnection(aCallback);
|
||||
};
|
||||
|
||||
manager.isHandShakeState = function(state) {
|
||||
switch (state) {
|
||||
case "AUTHENTICATING":
|
||||
@ -3820,10 +3828,14 @@ WifiWorker.prototype = {
|
||||
break;
|
||||
|
||||
case "xpcom-shutdown":
|
||||
let wifiService = Cc["@mozilla.org/wifi/service;1"].getService(Ci.nsIWifiProxyService);
|
||||
wifiService.shutdown();
|
||||
let wifiCertService = Cc["@mozilla.org/wifi/certservice;1"].getService(Ci.nsIWifiCertService);
|
||||
wifiCertService.shutdown();
|
||||
// Ensure the supplicant is detached from B2G to avoid XPCOM shutdown
|
||||
// blocks forever.
|
||||
WifiManager.ensureSupplicantDetached(() => {
|
||||
let wifiService = Cc["@mozilla.org/wifi/service;1"].getService(Ci.nsIWifiProxyService);
|
||||
wifiService.shutdown();
|
||||
let wifiCertService = Cc["@mozilla.org/wifi/certservice;1"].getService(Ci.nsIWifiCertService);
|
||||
wifiCertService.shutdown();
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user