WebAPI/WebIccManager/Multi-SIM: Difference between revisions
< WebAPI
Jump to navigation
Jump to search
(→Stk) |
|||
| Line 1: | Line 1: | ||
== Proposal: WebIccManager API for Multi-SIM == | == Proposal: WebIccManager API for Multi-SIM == | ||
Currently B2G supports a single SIM architecture. This proposal wants to extend WebIccManager to support multi-SIMs. In multi-SIM device, each SIM card is independent and has it own information and operation. Here we introduce multiple nsIDOMMozIcc objects, each instance represents a icc card, you can use iccId as index to get corresponding icc object. | Currently B2G supports a single SIM architecture. This proposal wants to extend WebIccManager to support multi-SIMs. In multi-SIM device, each SIM card is independent and has it own information and operation. Here we introduce multiple nsIDOMMozIcc objects, each instance represents a icc card, you can use iccId as index to get corresponding icc object from nsIDOMMozIccManager. | ||
=== Web API === | === Web API === | ||
Revision as of 03:22, 25 September 2013
Proposal: WebIccManager API for Multi-SIM
Currently B2G supports a single SIM architecture. This proposal wants to extend WebIccManager to support multi-SIMs. In multi-SIM device, each SIM card is independent and has it own information and operation. Here we introduce multiple nsIDOMMozIcc objects, each instance represents a icc card, you can use iccId as index to get corresponding icc object from nsIDOMMozIccManager.
Web API
interface nsIDOMMozIcc : nsIDOMEventTarget
{
readonly attribute nsIDOMMozMobileICCInfo iccInfo;
readonly attribute DOMString cardState;
readonly attribute long retryCount;
nsIDOMDOMRequest getCardLock(in DOMString lockType);
nsIDOMDOMRequest unlockCardLock(in jsval info);
nsIDOMDOMRequest setCardLock(in jsval info);
void sendStkResponse(in jsval command, in jsval response);
void sendStkMenuSelection(in unsigned short itemIdentifier, in boolean helpRequested);
void sendStkTimerExpiration(in jsval timer);
void sendStkEventDownload(in jsval event);
nsIDOMDOMRequest readContacts(in DOMString contactType);
nsIDOMDOMRequest updateContact(in DOMString contactType, in nsIDOMContact contact, [optional] in DOMString pin2);
nsIDOMDOMRequest iccOpenChannel(in DOMString aid);
nsIDOMDOMRequest iccExchangeAPDU(in long channel, in jsval apdu);
nsIDOMDOMRequest iccCloseChannel(in long channe);
[implicit_jscontext] attribute jsval onstkcommand;
[implicit_jscontext] attribute jsval onstksessionend;
[implicit_jscontext] attribute jsval onicccardlockerror;
[implicit_jscontext] attribute jsval oniccinfochange;
[implicit_jscontext] attribute jsval oncardstatechange;
}
interface nsIDOMMozIccManager : nsIDOMEventTarget
{
readonly attribute jsval iccIds;
nsIDOMMozIcc getIccById(in DOMString iccId);
[implicit_jscontext] attribute jsval oniccadd;
[implicit_jscontext] attribute jsval oniccremove;
}
Use Case
Stk
- Current B2G:
var icc = navigator.mozMobileConnection.icc;
icc.onstkcommand = function (evt) {
var command = evt.command;
switch (command.typeOfCommand) {
...
}
}
icc.sendStkResponse(command, response);
- Multi-SIM:
var iccManager = navigator.mozIccManager;
var icc = iccManager.getIccById(iccId);
icc.onstkcommand = function (evt) {
var command = evt.command;
switch (command.typeOfCommand) {
...
}
}
icc.sendStkResponse(command, response);
Enumerate icc cards inserted in device
- iccIds:
var iccIds = navigator.mozIccManager.iccIds;
for (let iccId in iccIds) {
var icc = navigator.mozIccManager.getIccById(iccId);
....
}
- Nmber of icc cards which is inserted in device:
var numberOfIcc = navigator.mozIccManager.iccIds.length;