Bug 1145079 - Fix defect for calling isEmergencyOnly. r=hsinyi
authorSzu-Yu Chen [:aknow] <szchen@mozilla.com>
Thu, 26 Mar 2015 11:11:12 +0800
changeset 265964 7714372f2bf51845159d0f195a27e393eccb37ae
parent 265963 fb219b81f7d3ee9692b0890c7ae73884f065ef2f
child 265965 0eeea29840fdd782cd8dcf9b967850a340cd3499
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsinyi
bugs1145079
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1145079 - Fix defect for calling isEmergencyOnly. r=hsinyi
dom/telephony/gonk/TelephonyService.js
--- a/dom/telephony/gonk/TelephonyService.js
+++ b/dom/telephony/gonk/TelephonyService.js
@@ -557,17 +557,18 @@ TelephonyService.prototype = {
   },
 
   /**
    * Dial number. Perform call setup or SS procedure accordingly.
    *
    * @see 3GPP TS 22.030 Figure 3.5.3.2
    */
   dial: function(aClientId, aNumber, aIsDialEmergency, aCallback) {
-    if (DEBUG) debug("Dialing " + (aIsDialEmergency ? "emergency " : "") + aNumber);
+    if (DEBUG) debug("Dialing " + (aIsDialEmergency ? "emergency " : "")
+                     + aNumber + ", clientId: " + aClientId);
 
     // We don't try to be too clever here, as the phone is probably in the
     // locked state. Let's just check if it's a number without normalizing
     if (!aIsDialEmergency) {
       aNumber = gPhoneNumberUtils.normalize(aNumber);
     }
 
     // Validate the number.
@@ -686,17 +687,17 @@ TelephonyService.prototype = {
 
     if (!isEmergency) {
       if (!this._isRadioOn(aClientId)) {
         if (DEBUG) debug("Error: Dial a normal call when radio off. Drop");
         aCallback.notifyError(DIAL_ERROR_RADIO_NOT_AVAILABLE);
         return;
       }
 
-      if (this._isEmergencyOnly()) {
+      if (this._isEmergencyOnly(aClientId)) {
         if (DEBUG) debug("Error: Dial a normal call when emergencyCallsOnly. Drop");
         aCallback.notifyError(DIAL_ERROR_BAD_NUMBER);
         return;
       }
     }
 
     if (isEmergency) {
       // Automatically select a proper clientId for emergency call.