mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1051660 - 0001. Fix minor bugs in API implementation. r=hchang
This commit is contained in:
parent
c5292293bc
commit
22d8a08a1f
@ -2898,24 +2898,28 @@ WifiWorker.prototype = {
|
||||
// No change.
|
||||
if (enabled === WifiManager.enabled) {
|
||||
this._sendMessage(message, true, true, msg);
|
||||
return;
|
||||
}
|
||||
|
||||
// Can't enable wifi while hotspot mode is enabled.
|
||||
if (enabled && (this.tetheringSettings[SETTINGS_WIFI_TETHERING_ENABLED] ||
|
||||
WifiManager.isWifiTetheringEnabled(WifiManager.tetheringState))) {
|
||||
self._sendMessage(message, false, "Can't enable Wifi while hotspot mode is enabled", msg);
|
||||
}
|
||||
|
||||
// Reply error to pending requests.
|
||||
if (!enabled) {
|
||||
this._clearPendingRequest();
|
||||
return;
|
||||
}
|
||||
|
||||
WifiManager.setWifiEnabled(enabled, function(ok) {
|
||||
if (ok === 0 || ok === "no change") {
|
||||
self._sendMessage(message, true, true, msg);
|
||||
|
||||
// Reply error to pending requests.
|
||||
if (!enabled) {
|
||||
self._clearPendingRequest();
|
||||
} else {
|
||||
WifiManager.start();
|
||||
}
|
||||
} else {
|
||||
self._sendMessage(message, false, "Set power saving mode failed", msg);
|
||||
self._sendMessage(message, false, "Set wifi enabled failed", msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user