Skip to content

Instantly share code, notes, and snippets.

@EragonJ
Created December 30, 2014 03:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EragonJ/9eab4a1eb44f4c15e29b to your computer and use it in GitHub Desktop.
Save EragonJ/9eab4a1eb44f4c15e29b to your computer and use it in GitHub Desktop.
diff --git a/dom/wifi/WifiWorker.js b/dom/wifi/WifiWorker.js
index 730acd0..c14bf22 100644
--- a/dom/wifi/WifiWorker.js
+++ b/dom/wifi/WifiWorker.js
@@ -3232,16 +3232,31 @@ WifiWorker.prototype = {
this.setWifiApEnabled(enabled, this.requestDone.bind(this));
}.bind(this));
- if (!enabled) {
- this.queueRequest({command: "setWifiEnabled", value: true}, function(data) {
- if (this.disconnectedByWifiTethering) {
- this.setWifiEnabled(true, this._setWifiEnabledCallback.bind(this));
- } else {
- this.requestDone();
+ let lock = gSettingsService.createLock();
+ let self = this;
+ lock.get("ril.ignore.mutex",
+ {
+ handle: function handle(aName, aResult) {
+ debug("mxm_airplaneMode.enabled aResult : " + aResult);
+ if (aResult) {
+ // do something here and remember to set ril.ignore.mutex back to false
+ };
+ },
+ handleError: function handleError(aErrorMessage) {
+ debug("mxm_airplaneMode.enabled aaErrorMessage : " + aErrorMessage);
}
- this.disconnectedByWifiTethering = false;
- }.bind(this));
- }
+ }
+ );
},
// nsIObserver implementation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment