WebAPI/WebMobileConnection/Multi-SIM: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
Line 76: Line 76:
* Please refer to [https://wiki.mozilla.org/WebAPI/WebTelephony/Multi-SIM WebTelephony/Multi-SIM RIL implementation ].
* Please refer to [https://wiki.mozilla.org/WebAPI/WebTelephony/Multi-SIM WebTelephony/Multi-SIM RIL implementation ].


== Proposal: Architecture ==
== Discussion ==
== Discussion ==

Revision as of 06:27, 15 November 2012

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 'nsIDOMMozMobileConnectionManager' to manage several nsIDOMMozMobileConnection objects. One 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

Discussion