WebAPI/WebIccManager/Multi-SIM: Difference between revisions
< WebAPI
Jump to navigation
Jump to search
Line 40: | Line 40: | ||
[implicit_jscontext] attribute jsval oniccremove; | [implicit_jscontext] attribute jsval oniccremove; | ||
} | } | ||
=== Use Case === | |||
==== Stk ==== | |||
*Current B2G: | |||
icc.onstkcommand = function (evt) { | |||
var command = evt.command; | |||
switch (command.typeOfCommand) { | |||
... | |||
} | |||
} | |||
* Multi-SIM: | |||
var icc = iccManager.getIccById(iccId); | |||
icc.onstkcommand = function (evt) { | |||
var command = evt.command; | |||
switch (command.typeOfCommand) { | |||
... | |||
} | |||
} |
Revision as of 11:11, 24 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.
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:
icc.onstkcommand = function (evt) { var command = evt.command; switch (command.typeOfCommand) { ... } }
- Multi-SIM:
var icc = iccManager.getIccById(iccId); icc.onstkcommand = function (evt) { var command = evt.command; switch (command.typeOfCommand) { ... } }