Bug 981519 - Number and name presentation - part 4 - ril impl. r=vicamo, a=lmandel
authorHsin-Yi Tsai <htsai@mozilla.com>
Wed, 16 Apr 2014 19:43:08 +0800
changeset 209062 9b97219e07313c430373fc3f277678000d7c7809
parent 209061 40c662631eba9a15b8df108f50bb147c518facb9
child 209063 78de1ef8227512642ccea70cfa604e241d5267e7
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvicamo, lmandel
bugs981519
milestone32.0a2
Bug 981519 - Number and name presentation - part 4 - ril impl. r=vicamo, a=lmandel
dom/system/gonk/RadioInterfaceLayer.js
dom/system/gonk/ril_worker.js
dom/telephony/gonk/TelephonyService.js
--- a/dom/system/gonk/RadioInterfaceLayer.js
+++ b/dom/system/gonk/RadioInterfaceLayer.js
@@ -2070,17 +2070,17 @@ RadioInterface.prototype = {
         break;
       case "callDisconnected":
         gTelephonyService.notifyCallDisconnected(this.clientId, message.call);
         break;
       case "conferenceCallStateChanged":
         gTelephonyService.notifyConferenceCallStateChanged(message.state);
         break;
       case "cdmaCallWaiting":
-        gTelephonyService.notifyCdmaCallWaiting(this.clientId, message.number);
+        gTelephonyService.notifyCdmaCallWaiting(this.clientId, message.waitingCall);
         break;
       case "suppSvcNotification":
         gTelephonyService.notifySupplementaryService(this.clientId,
                                                       message.callIndex,
                                                       message.notification);
         break;
       case "datacallerror":
         connHandler.handleDataCallError(message);
--- a/dom/system/gonk/ril_worker.js
+++ b/dom/system/gonk/ril_worker.js
@@ -5506,17 +5506,17 @@ RilObject.prototype[REQUEST_GET_CURRENT_
     call.isMpty         = Boolean(Buf.readInt32());
     call.isMT           = Boolean(Buf.readInt32());
     call.als            = Buf.readInt32();
     call.isVoice        = Boolean(Buf.readInt32());
     call.isVoicePrivacy = Boolean(Buf.readInt32());
     if (RILQUIRKS_CALLSTATE_EXTRA_UINT32) {
       Buf.readInt32();
     }
-    call.number             = Buf.readString(); //TODO munge with TOA
+    call.number             = Buf.readString();
     call.numberPresentation = Buf.readInt32(); // CALL_PRESENTATION_*
     call.name               = Buf.readString();
     call.namePresentation   = Buf.readInt32();
 
     call.uusInfo = null;
     let uusInfoPresent = Buf.readInt32();
     if (uusInfoPresent == 1) {
       call.uusInfo = {
@@ -6832,17 +6832,17 @@ RilObject.prototype[UNSOLICITED_CDMA_CAL
   call.numberPresentation  = Buf.readInt32();
   call.name                = Buf.readString();
   call.namePresentation    = Buf.readInt32();
   call.isPresent           = Buf.readInt32();
   call.signalType          = Buf.readInt32();
   call.alertPitch          = Buf.readInt32();
   call.signal              = Buf.readInt32();
   this.sendChromeMessage({rilMessageType: "cdmaCallWaiting",
-                          number: call.number});
+                          waitingCall: call});
 };
 RilObject.prototype[UNSOLICITED_CDMA_OTA_PROVISION_STATUS] = function UNSOLICITED_CDMA_OTA_PROVISION_STATUS() {
   let status = this.context.Buf.readInt32List()[0];
   this.sendChromeMessage({rilMessageType: "otastatuschange",
                           status: status});
 };
 RilObject.prototype[UNSOLICITED_CDMA_INFO_REC] = function UNSOLICITED_CDMA_INFO_REC(length) {
   let record = this.context.CdmaPDUHelper.decodeInformationRecord();
--- a/dom/telephony/gonk/TelephonyService.js
+++ b/dom/telephony/gonk/TelephonyService.js
@@ -356,17 +356,19 @@ TelephonyService.prototype = {
     for (let cid = 0; cid < this._numClients; ++cid) {
       let calls = this._currentCalls[cid];
       if (!calls) {
         continue;
       }
       for (let i = 0, indexes = Object.keys(calls); i < indexes.length; ++i) {
         let call = calls[indexes[i]];
         aListener.enumerateCallState(call.clientId, call.callIndex,
-                                     call.state, call.number, call.isOutgoing,
+                                     call.state, call.number,
+                                     call.numberPresentation, call.name,
+                                     call.namePresentation, call.isOutgoing,
                                      call.isEmergency, call.isConference,
                                      call.isSwitchable, call.isMergeable);
       }
     }
     aListener.enumerateCallStateComplete();
   },
 
   isDialing: false,
@@ -716,16 +718,19 @@ TelephonyService.prototype = {
     this._updateActiveCall(aCall);
 
     if (!aCall.failCause ||
         aCall.failCause === RIL.GECKO_CALL_ERROR_NORMAL_CALL_CLEARING) {
       this._notifyAllListeners("callStateChanged", [aClientId,
                                                     aCall.callIndex,
                                                     aCall.state,
                                                     aCall.number,
+                                                    aCall.numberPresentation,
+                                                    aCall.name,
+                                                    aCall.namePresentation,
                                                     aCall.isOutgoing,
                                                     aCall.isEmergency,
                                                     aCall.isConference,
                                                     aCall.isSwitchable,
                                                     aCall.isMergeable]);
     } else {
       this._notifyAllListeners("notifyError",
                                [aClientId, aCall.callIndex, aCall.failCause]);
@@ -780,42 +785,56 @@ TelephonyService.prototype = {
                          aCall.isMergeable : call.isMergeable;
     } else {
       call = aCall;
       call.isSwitchable = aCall.isSwitchable != null ?
                           aCall.isSwitchable : true;
       call.isMergeable = aCall.isMergeable != null ?
                          aCall.isMergeable : true;
 
+      call.numberPresentation = aCall.numberPresentation != null ?
+                                aCall.numberPresentation : nsITelephonyService.CALL_PRESENTATION_ALLOWED;
+      call.name = aCall.name != null ?
+                  aCall.name : "";
+      call.namePresentation = aCall.namePresentation != null ?
+                              aCall.namePresentation : nsITelephonyService.CALL_PRESENTATION_ALLOWED;
+
       this._currentCalls[aClientId][aCall.callIndex] = call;
     }
 
     this._notifyAllListeners("callStateChanged", [aClientId,
                                                   call.callIndex,
                                                   call.state,
                                                   call.number,
+                                                  call.numberPresentation,
+                                                  call.name,
+                                                  call.namePresentation,
                                                   call.isOutgoing,
                                                   call.isEmergency,
                                                   call.isConference,
                                                   call.isSwitchable,
                                                   call.isMergeable]);
   },
 
-  notifyCdmaCallWaiting: function(aClientId, aNumber) {
+  notifyCdmaCallWaiting: function(aClientId, aCall) {
     // We need to acquire a CPU wake lock to avoid the system falling into
     // the sleep mode when the RIL handles the incoming call.
     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._notifyAllListeners("notifyCdmaCallWaiting", [aClientId, aNumber]);
+    this._notifyAllListeners("notifyCdmaCallWaiting", [aClientId,
+                                                       aCall.number,
+                                                       aCall.numberPresentation,
+                                                       aCall.name,
+                                                       aCall.namePresentation]);
   },
 
   notifySupplementaryService: function(aClientId, aCallIndex, aNotification) {
     let notification = this._convertRILSuppSvcNotification(aNotification);
     this._notifyAllListeners("supplementaryServiceNotification",
                              [aClientId, aCallIndex, notification]);
   },