Bug 773068 - Part 3: RIL implementation of SIM EF_MBDN. r=vicamo

This commit is contained in:
Marshall Culpepper 2012-07-20 20:19:38 -04:00
Родитель d6b7954475
Коммит 22ff1512da
4 изменённых файлов: 49 добавлений и 1 удалений

Просмотреть файл

@ -47,6 +47,7 @@ const RIL_IPC_MSG_NAMES = [
"RIL:SelectNetworkAuto",
"RIL:CallStateChanged",
"RIL:VoicemailNotification",
"RIL:VoicemailNumberChanged",
"RIL:CallError",
"RIL:GetCardLock:Return:OK",
"RIL:GetCardLock:Return:KO",
@ -349,6 +350,8 @@ RILContentHelper.prototype = {
_enumerateTelephonyCallbacks: null,
voicemailStatus: null,
voicemailNumber: null,
voicemailDisplayName: null,
registerCallback: function registerCallback(callbackType, callback) {
let callbacks = this[callbackType];
@ -557,6 +560,10 @@ RILContentHelper.prototype = {
case "RIL:VoicemailNotification":
this.handleVoicemailNotification(msg.json);
break;
case "RIL:VoicemailNumberChanged":
this.voicemailNumber = msg.json.number;
this.voicemailDisplayName = msg.json.alphaId;
break;
case "RIL:GetCardLock:Return:OK":
case "RIL:SetCardLock:Return:OK":
case "RIL:UnlockCardLock:Return:OK":

Просмотреть файл

@ -397,6 +397,9 @@ RadioInterfaceLayer.prototype = {
callback.receiveContactsList(message.contactType, message.contacts);
}
break;
case "iccmbdn":
ppmm.sendAsyncMessage("RIL:VoicemailNumberChanged", message);
break;
case "celllocationchanged":
this.rilContext.cell = message;
break;

Просмотреть файл

@ -63,7 +63,7 @@ interface nsIRILTelephonyCallback : nsISupports
in AString error);
};
[scriptable, uuid(3ac98987-a63c-4ebe-adbd-ff7a0348d804)]
[scriptable, uuid(521cfe4a-bf79-4134-a9fc-e2242164d657)]
interface nsIRILVoicemailCallback : nsISupports
{
/**
@ -163,6 +163,8 @@ interface nsIRILContentHelper : nsIMobileConnectionProvider
attribute bool speakerEnabled;
readonly attribute nsIDOMMozVoicemailStatus voicemailStatus;
readonly attribute DOMString voicemailNumber;
readonly attribute DOMString voicemailDisplayName;
};
[scriptable, uuid(fd9e8b38-b839-4d56-8482-3bf1f5c8f2ee)]

Просмотреть файл

@ -992,6 +992,7 @@ let RIL = {
this.getMSISDN();
this.getAD();
this.getUST();
this.getMBDN();
},
/**
@ -1294,6 +1295,41 @@ let RIL = {
});
},
/**
* Get ICC MBDN. (Mailbox Dialling Number)
*
* @see TS 131.102, clause 4.2.60
*/
getMBDN: function getMBDN() {
function callback(options) {
let parseCallback = function parseCallback(contact) {
if (DEBUG) {
debug("MBDN, alphaId="+contact.alphaId+" number="+contact.number);
}
if (this.iccInfo.mbdn != contact.number) {
this.iccInfo.mbdn = contact.number;
contact.type = "iccmbdn";
this.sendDOMMessage(contact);
}
};
this.parseDiallingNumber(options, parseCallback);
}
this.iccIO({
command: ICC_COMMAND_GET_RESPONSE,
fileId: ICC_EF_MBDN,
pathId: EF_PATH_MF_SIM + EF_PATH_DF_GSM,
p1: 0, // For GET_RESPONSE, p1 = 0
p2: 0, // For GET_RESPONSE, p2 = 0
p3: GET_RESPONSE_EF_SIZE_BYTES,
data: null,
pin2: null,
type: EF_TYPE_LINEAR_FIXED,
callback: callback,
});
},
decodeSimTlvs: function decodeSimTlvs(tlvsLen) {
let index = 0;
let tlvs = [];