Bug 788191 - Exporting ICC SPN and MSISDN, r=vicamo, sr=sicking

SPN is Service Provider Name, MSISDN is Mobile Station ISDN Number (i.e.
user's phone number), and both can be useful to have, e.g., to be able
to display them in Gaia settings (as Android does).
This commit is contained in:
Alexandre Lissy 2012-10-23 14:54:51 +08:00
parent 0658c28103
commit 7e170b73a1
4 changed files with 22 additions and 3 deletions

View File

@ -374,7 +374,7 @@ interface nsIDOMMozMobileCellInfo: nsISupports
readonly attribute unsigned long gsmCellId;
};
[scriptable, uuid(8854ee5f-8ffa-45c1-84d6-e87d82de6ae8)]
[scriptable, uuid(a71c66ed-dfb0-4c33-9942-049e6f03dbed)]
interface nsIDOMMozMobileICCInfo : nsISupports
{
/**
@ -391,4 +391,15 @@ interface nsIDOMMozMobileICCInfo : nsISupports
* Mobile Network Code (MNC) of the subscriber's home network.
*/
readonly attribute unsigned short mnc;
/**
* Service Provider Name (SPN) of the subscriber's home network.
*/
readonly attribute DOMString spn;
/**
* Mobile Station ISDN Number (MSISDN) of the subscriber's, aka
* his phone number.
*/
readonly attribute DOMString msisdn;
};

View File

@ -17,6 +17,10 @@ is(connection.iccInfo.iccid, 89014103211118510720);
// See it here {B2G_HOME}/external/qemu/telephony/android_modem.c#L2465.
is(connection.iccInfo.mcc, 310);
is(connection.iccInfo.mnc, 260);
is(connection.iccInfo.spn, "Android");
// Phone number is hardcoded in MSISDN
// See {B2G_HOME}/external/qemu/telephony/sim_card.c, in asimcard_io()
is(connection.iccInfo.msisdn, "15555215554");
SpecialPowers.removePermission("mobileconnection", document);
finish();

View File

@ -111,7 +111,9 @@ MobileICCInfo.prototype = {
iccid: null,
mcc: 0,
mnc: 0
mnc: 0,
spn: null,
msisdn: null,
};
function MobileConnectionInfo() {}

View File

@ -1401,7 +1401,9 @@ RadioInterfaceLayer.prototype = {
let iccInfoChanged = !oldIcc ||
oldIcc.iccid != message.iccid ||
oldIcc.mcc != message.mcc ||
oldIcc.mnc != message.mnc;
oldIcc.mnc != message.mnc ||
oldIcc.spn != message.spn ||
oldIcc.msisdn != message.msisdn;
if (!iccInfoChanged) {
return;
}