No bug: Fix new uses of getLock that crept in. irc-r=mrbkap
authorChris Jones <jones.chris.g@gmail.com>
Fri, 07 Sep 2012 11:05:08 -0700
changeset 104584 b29dca65085ae9bef7da81e95f5046873f700b87
parent 104583 175c768112a416f7c3ee47087b86f8a8ed2e4163
child 104585 e1e9a9400f07bc101dbf460f65efe18c9f4a31d3
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
milestone18.0a1
No bug: Fix new uses of getLock that crept in. irc-r=mrbkap
dom/system/gonk/RadioInterfaceLayer.js
--- a/dom/system/gonk/RadioInterfaceLayer.js
+++ b/dom/system/gonk/RadioInterfaceLayer.js
@@ -180,36 +180,37 @@ function RadioInterfaceLayer() {
                      signalStrength: null,
                      relSignalStrength: null},
   };
 
   this.callWaitingStatus = null;
 
   // Read the 'ril.radio.disabled' setting in order to start with a known
   // value at boot time.
-  gSettingsService.createLock().get("ril.radio.disabled", this);
+  let lock = gSettingsService.createLock();
+  lock.get("ril.radio.disabled", this);
 
   // Read the APN data form the setting DB.
-  gSettingsService.createLock().get("ril.data.apn", this);
-  gSettingsService.createLock().get("ril.data.user", this);
-  gSettingsService.createLock().get("ril.data.passwd", this);
-  gSettingsService.createLock().get("ril.data.httpProxyHost", this);
-  gSettingsService.createLock().get("ril.data.httpProxyPort", this);
-  gSettingsService.createLock().get("ril.data.roaming_enabled", this);
-  gSettingsService.createLock().get("ril.data.enabled", this);
+  lock.get("ril.data.apn", this);
+  lock.get("ril.data.user", this);
+  lock.get("ril.data.passwd", this);
+  lock.get("ril.data.httpProxyHost", this);
+  lock.get("ril.data.httpProxyPort", this);
+  lock.get("ril.data.roaming_enabled", this);
+  lock.get("ril.data.enabled", this);
   this._dataCallSettingsToRead = ["ril.data.enabled",
                                   "ril.data.roaming_enabled",
                                   "ril.data.apn",
                                   "ril.data.user",
                                   "ril.data.passwd",
                                   "ril.data.httpProxyHost",
                                   "ril.data.httpProxyPort"];
 
   // Read the desired setting of call waiting from the settings DB.
-  gSettingsService.getLock().get("ril.callwaiting.enabled", this);
+  lock.get("ril.callwaiting.enabled", this);
 
   this._messageManagerByRequest = {};
 
   for each (let msgname in RIL_IPC_MSG_NAMES) {
     ppmm.addMessageListener(msgname, this);
   }
   Services.obs.addObserver(this, "xpcom-shutdown", false);
   Services.obs.addObserver(this, kMozSettingsChangedObserverTopic, false);
@@ -696,19 +697,18 @@ RadioInterfaceLayer.prototype = {
 
   handleCallWaitingStatusChange: function handleCallWaitingStatusChange(message) {
     let newStatus = message.enabled;
 
     // RIL fails in setting call waiting status. Reset "ril.callwaiting.enabled"
     // in the settings DB.
     if (!message.success) {
       newStatus = !newStatus;
-      gSettingsService.getLock().set("ril.callwaiting.enabled",
-                                     newStatus,
-                                     null);
+      let lock = gSettingsService.createLock();
+      lock.set("ril.callwaiting.enabled", newStatus, null);
       return;
     }
 
     this.callWaitingStatus = newStatus;
   },
 
   setCallWaitingEnabled: function setCallWaitingEnabled(value) {
     debug("Current call waiting status is " + this.callWaitingStatus +