Bug 944589 - [Voice Channel][Dialer][Airplane Mode] If you switch to airplane mode when talking, voice channel will not recover. r=vicamo
authorHsin-Yi Tsai <htsai@mozilla.com>
Mon, 02 Dec 2013 18:51:54 +0800
changeset 174563 bf43134b83958c469ae3a58c91e6c126feb91b8a
parent 174562 954aa0768ac6581873f33eaf53bd7c938ff521a5
child 174564 7cfb12b2785d3b3103f633dfe7ed6161efcfc191
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvicamo
bugs944589
milestone28.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 944589 - [Voice Channel][Dialer][Airplane Mode] If you switch to airplane mode when talking, voice channel will not recover. r=vicamo
dom/system/gonk/ril_worker.js
dom/telephony/gonk/TelephonyProvider.js
--- a/dom/system/gonk/ril_worker.js
+++ b/dom/system/gonk/ril_worker.js
@@ -4985,18 +4985,18 @@ RIL[REQUEST_GET_CURRENT_CALLS] = functio
     calls[call.callIndex] = call;
   }
   this._processCalls(calls);
 };
 RIL[REQUEST_DIAL] = function REQUEST_DIAL(length, options) {
   if (options.rilRequestError) {
     // The connection is not established yet.
     options.callIndex = -1;
-    this.getFailCauseCode(options);
-    return;
+    this._sendCallError(options.callIndex,
+                        RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError]);
   }
 };
 RIL[REQUEST_GET_IMSI] = function REQUEST_GET_IMSI(length, options) {
   if (options.rilRequestError) {
     return;
   }
 
   this.iccInfoPrivate.imsi = Buf.readString();
@@ -5065,25 +5065,18 @@ RIL[REQUEST_LAST_CALL_FAIL_CAUSE] = func
   if (!num) {
     // No response of REQUEST_LAST_CALL_FAIL_CAUSE. Change the call state into
     // 'disconnected' directly.
     this._handleDisconnectedCall(options);
     return;
   }
 
   let failCause = Buf.readInt32();
-  switch (failCause) {
-    case CALL_FAIL_NORMAL:
-      this._handleDisconnectedCall(options);
-      break;
-    default:
-      this._sendCallError(options.callIndex,
-                          RIL_CALL_FAILCAUSE_TO_GECKO_CALL_ERROR[failCause]);
-      break;
-  }
+  options.failCause = RIL_CALL_FAILCAUSE_TO_GECKO_CALL_ERROR[failCause];
+  this._handleDisconnectedCall(options);
 };
 RIL[REQUEST_SIGNAL_STRENGTH] = function REQUEST_SIGNAL_STRENGTH(length, options) {
   this._receivedNetworkInfo(NETWORK_INFO_SIGNAL);
 
   if (options.rilRequestError) {
     return;
   }
 
--- a/dom/telephony/gonk/TelephonyProvider.js
+++ b/dom/telephony/gonk/TelephonyProvider.js
@@ -491,24 +491,30 @@ TelephonyProvider.prototype = {
       number: aCall.number,
       duration: duration,
       direction: aCall.isOutgoing ? "outgoing" : "incoming"
     };
     gSystemMessenger.broadcastMessage("telephony-call-ended", data);
 
     this._updateCallAudioState(aCall, null);
 
-    this._notifyAllListeners("callStateChanged", [aClientId,
-                                                  aCall.callIndex,
-                                                  aCall.state,
-                                                  aCall.number,
-                                                  aCall.isActive,
-                                                  aCall.isOutgoing,
-                                                  aCall.isEmergency,
-                                                  aCall.isConference]);
+    if (!aCall.failCause ||
+        aCall.failCause === RIL.GECKO_CALL_ERROR_NORMAL_CALL_CLEARING) {
+      this._notifyAllListeners("callStateChanged", [aClientId,
+                                                    aCall.callIndex,
+                                                    aCall.state,
+                                                    aCall.number,
+                                                    aCall.isActive,
+                                                    aCall.isOutgoing,
+                                                    aCall.isEmergency,
+                                                    aCall.isConference]);
+      return;
+    }
+
+    this.notifyCallError(aClientId, aCall.callIndex, aCall.failCause);
   },
 
   /**
    * Handle call error.
    */
   notifyCallError: function notifyCallError(aClientId, aCallIndex, aErrorMsg) {
     this._notifyAllListeners("notifyError", [aClientId, aCallIndex, aErrorMsg]);
   },