Bug 1029721 - add secondNumber in telephony-call-ended message. r=hsinyi
authorTamara Hills <thills@mozilla.com>
Thu, 17 Jul 2014 19:18:28 +0800
changeset 215430 88ad2e93bce6268af0f64ec35e73f6c630c82bdc
parent 215429 5ed0d1e11971c047408bdbdaa930cc1b6c1b955e
child 215431 7ee1774b1703b83a840fd63b6360872fdcbdad59
push id3857
push userraliiev@mozilla.com
push dateTue, 02 Sep 2014 16:39:23 +0000
treeherdermozilla-beta@5638b907b505 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsinyi
bugs1029721
milestone33.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 1029721 - add secondNumber in telephony-call-ended message. r=hsinyi
dom/telephony/gonk/TelephonyService.js
--- a/dom/telephony/gonk/TelephonyService.js
+++ b/dom/telephony/gonk/TelephonyService.js
@@ -104,16 +104,18 @@ XPCOMUtils.defineLazyGetter(this, "gPhon
   return ns.PhoneNumberUtils;
 });
 
 function TelephonyService() {
   this._numClients = gRadioInterfaceLayer.numRadioInterfaces;
   this._listeners = [];
   this._currentCalls = {};
 
+  this._cdmaCallWaitingNumber = null;
+
   // _isActiveCall[clientId][callIndex] shows the active status of the call.
   this._isActiveCall = {};
   this._numActiveCall = 0;
 
   this._updateDebugFlag();
   this.defaultServiceId = this._getDefaultServiceId();
 
   Services.prefs.addObserver(kPrefRilDebuggingEnabled, this, false);
@@ -725,16 +727,22 @@ TelephonyService.prototype = {
       new Date().getTime() - aCall.started : 0;
     let data = {
       number: aCall.number,
       serviceId: aClientId,
       emergency: aCall.isEmergency,
       duration: duration,
       direction: aCall.isOutgoing ? "outgoing" : "incoming"
     };
+
+    if(this._cdmaCallWaitingNumber != null) {
+      data.secondNumber = this._cdmaCallWaitingNumber;
+      this._cdmaCallWaitingNumber = null;
+    }
+
     gSystemMessenger.broadcastMessage("telephony-call-ended", data);
 
     let manualConfStateChange = false;
     let childId = this._currentCalls[aClientId][aCall.callIndex].childId;
     if (childId) {
       // Child cannot live without parent.
       let childCall = this._currentCalls[aClientId][childId];
       this.notifyCallDisconnected(aClientId, childCall);
@@ -862,16 +870,19 @@ TelephonyService.prototype = {
     this._acquireCallRingWakeLock();
 
     let call = this._currentCalls[aClientId][CDMA_SECOND_CALL_INDEX];
     if (call) {
       // TODO: Bug 977503 - B2G RIL: [CDMA] update callNumber when a waiting
       // call comes after a 3way call.
       this.notifyCallDisconnected(aClientId, call);
     }
+
+    this._cdmaCallWaitingNumber = aCall.number;
+
     this._notifyAllListeners("notifyCdmaCallWaiting", [aClientId,
                                                        aCall.number,
                                                        aCall.numberPresentation,
                                                        aCall.name,
                                                        aCall.namePresentation]);
   },
 
   notifySupplementaryService: function(aClientId, aCallIndex, aNotification) {