Bug 894281 - Process emergency call once network is really available. r=vicamo, a=leo+
authorAlexandre Lissy <lissyx@lissyx.dyndns.org>
Wed, 24 Jul 2013 15:06:45 +0200
changeset 119810 6eca769c41c8a411e86dc550bebeea23263ebd2e
parent 119809 91e7d386f7543dac4aa8e761e5e567c01ec5449e
child 119811 a9f1d82103c6d762474ac16ce6d8cdcb1bfd83a5
push id1006
push userryanvm@gmail.com
push dateFri, 26 Jul 2013 16:57:26 +0000
reviewersvicamo, leo
bugs894281
milestone18.1
Bug 894281 - Process emergency call once network is really available. r=vicamo, a=leo+
dom/system/gonk/ril_worker.js
--- a/dom/system/gonk/ril_worker.js
+++ b/dom/system/gonk/ril_worker.js
@@ -5764,34 +5764,37 @@ RIL[REQUEST_SIGNAL_STRENGTH] = function 
     obj.lteRSSNR = Buf.readUint32();
     // Channel Quality Indicator, valid values are 0 to 15.
     obj.lteCQI = Buf.readUint32();
   }
 
   if (DEBUG) debug("Signal strength " + JSON.stringify(obj));
   obj.rilMessageType = "signalstrengthchange";
   this.sendDOMMessage(obj);
-
-  if (this.cachedDialRequest && obj.gsmDBM && obj.gsmRelative) {
-    // Radio is ready for making the cached emergency call.
-    this.cachedDialRequest.callback();
-    this.cachedDialRequest = null;
-  }
 };
 RIL[REQUEST_VOICE_REGISTRATION_STATE] = function REQUEST_VOICE_REGISTRATION_STATE(length, options) {
   this._receivedNetworkInfo(NETWORK_INFO_VOICE_REGISTRATION_STATE);
 
   if (options.rilRequestError) {
     return;
   }
 
   let state = Buf.readStringList();
   if (DEBUG) debug("voice registration state: " + state);
 
   this._processVoiceRegistrationState(state);
+
+  if (this.cachedDialRequest &&
+       (this.voiceRegistrationState.emergencyCallsOnly ||
+        this.voiceRegistrationState.connected) &&
+      this.voiceRegistrationState.radioTech != NETWORK_CREG_TECH_UNKNOWN) {
+    // Radio is ready for making the cached emergency call.
+    this.cachedDialRequest.callback();
+    this.cachedDialRequest = null;
+  }
 };
 RIL[REQUEST_DATA_REGISTRATION_STATE] = function REQUEST_DATA_REGISTRATION_STATE(length, options) {
   this._receivedNetworkInfo(NETWORK_INFO_DATA_REGISTRATION_STATE);
 
   if (options.rilRequestError) {
     return;
   }