Bug 981519 - number and name presentation - part 4 - ril impl. r=vicamo
--- 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
@@ -5524,17 +5524,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 = {
@@ -6855,17 +6855,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,
@@ -724,16 +726,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]);
@@ -788,42 +793,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 : nsITelephonyProvider.CALL_PRESENTATION_ALLOWED;
+ call.name = aCall.name != null ?
+ aCall.name : "";
+ call.namePresentation = aCall.namePresentation != null ?
+ aCall.namePresentation : nsITelephonyProvider.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]);
},