Changes

Jump to: navigation, search

WebAPI/WebMobileConnection/Multi-SIM

2,236 bytes added, 06:26, 15 November 2012
Proposal: WebMobileConnection API for Multi-SIM
== Proposal: WebMobileConnection API for Multi-SIM ==
Currently B2G supports a single SIM architecture. This proposal wants to extend it for supporting multi-SIMs. Here, we introduce a central 'nsIDOMMobileConnectionManagernsIDOMMozMobileConnectionManager' to manage several DOMMobileConnection nsIDOMMozMobileConnection objects. One DOMMobileConnection nsIDOMMozMobileConnection object is binded to a physical SIM slot. nsIDOMMozMobileConnectionManager will control the interaction functions between nsIDOMMozMobileConnection objects in the future. For example, when data connection via SIM1 is no longer available, nsIDOMMobileConnectionManager will establish data connection via SIM2 for upper layers. === Web API ===Following are what we add for nsIDOMMozMobileConnectionManager. interface nsIDOMMozMobileConnectionManager : nsIDOMEventTarget{ readonly attribute jsval mobileConnections;  readonly attribute nsIDOMMozMobileConnection defaultMobileConnection; }; We don't modify the interface of nsIDOMMozMobileConnectionInfo to minimize the coding effort of gaia. interface nsIDOMMozMobileConnectionInfo : nsISupports{ readonly attribute DOMString state; readonly attribute bool connected; readonly attribute bool emergencyCallsOnly; readonly attribute bool roaming; readonly attribute nsIDOMMozMobileNetworkInfo network; readonly attribute DOMString type; readonly attribute jsval signalStrength; readonly attribute jsval relSignalStrength; readonly attribute nsIDOMMozMobileCellInfo cell;}; === Use Case === ==== Listen Connection Status ==== *Current B2G (Single SIM)  ... var conn = window.navigator.mozMobileConnection; if (conn) { conn.addEventListener('voicechange', this); conn.addEventListener('datachange', this); ... *Multi-SIMs  ... var conn = window.navigator.mozMobileConnectionManager.defaultMobileConnection; if (conn) { conn.addEventListener('voicechange', this); conn.addEventListener('datachange', this); ... ==== Get ICC Status ==== *Current B2G (Single SIM)  ... var mobileConnection=window.navigator.mozMobileConnection; var req = mobileConnection.getCardLock('pin'); ... *Multi-SIMs  ... var mobileConnection= window.navigator.mozMobileConnectionManager.defaultMobileConnection; var req = mobileConnection.getCardLock('pin'); ... == Proposal: Architecture == === MobileConnectionManager === === RIL Implementation === * Please refer to [https://wiki.mozilla.org/WebAPI/WebTelephony/Multi-SIM WebTelephony/Multi-SIM RIL implementation ].
== Proposal: Architecture ==
== Discussion ==
Confirm
489
edits

Navigation menu