WebAPI/WebTelephony/Multi-SIM: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
Line 121: Line 121:
**Send parcel to the correct rild: might need to modify ril_worker.js and rilproxy
**Send parcel to the correct rild: might need to modify ril_worker.js and rilproxy
**Get the number of sim slots
**Get the number of sim slots
== Discussion ==
Q: How do we know how many phone objects should be created in 'navigator.mozTelephonyManager' ?
A: Number of the sim slots
Q: How to know default phone?
A: Binded to a specified sim slot (per hardware design). We should reserve the flexibility that user has a chance to change the default phone at run-time, but note the 『default phone』 determination is another issue.
Q: How much memory increase if we use two instances to handle 2 SIMs?
A: According to the information from Bug 802446, the compartment of RadioInterface layer is about 3xx KBytes.  But, after removing some fixed size overhead, it is expected 2xxK-increase to add an instance for each SIM.  We expect it will add less than 200K for each instance after removing SMS and other stuffs out.

Revision as of 10:50, 22 October 2012

Proposal: WebTelephony API for Multi-SIM

interface nsIDOMTelephonyManager : nsIDOMEventTarget
{
attribute boolean muted; 
attribute boolean speakerEnabled;

readonly attribute jsval active;
readonly attribute jsval calls;
readonly attribute phoneState;  /* Ringing, Offhook, Idel */
readonly attribute jsval phones;
readonly attribute nsIDOMTelephony defaultPhone;

[implicit_jscontext] attribute jsval onincoming;
[implicit_jscontext] attribute jsval oncallschanged;
};
interface nsIDOMTelephony: nsIDOMEventTarget
{
nsIDOMTelephonyCall dial(in DOMString number);

// The call that is "active", i.e. receives microphone input and tones
// generated via startTone.
readonly attribute jsval active;

// Array of all calls that are currently connected.
readonly attribute jsval calls;

void startTone(in DOMString tone);
void stopTone();

attribute nsIDOMEventListener onincoming;
attribute nsIDOMEventListener oncallschanged;
};
interface nsIDOMTelephonyCall: nsIDOMEventTarget
{
readonly attribute DOMString number;

// "dialing", "alerting", "busy", "connecting", "connected", "disconnecting", 
// "disconnected", "incoming", "holding", "held", "resuming"
readonly attribute DOMString state;

readonly attribute nsIDOMDOMError error;
readonly attribute nsIDOMTelephony phone;

// functions to mediate a call.
void answer();  
void hangUp();
void hold(); 
void resume(); 

attribute nsIDOMEventListener onstatechange;

attribute nsIDOMEventListener ondialing;
attribute nsIDOMEventListener onalerting;
attribute nsIDOMEventListener onbusy;
attribute nsIDOMEventListener onconnecting;
attribute nsIDOMEventListener onconnected;
attribute nsIDOMEventListener ondisconnecting;
attribute nsIDOMEventListener ondisconnected;
attribute nsIDOMEventListener onincoming;
attribute nsIDOMEventListener onholding; 
attribute nsIDOMEventListener onheld; 
attribute nsIDOMEventListener onresuming; 
};

Use Case

Outgoing Call

  • Current B2G
 navigator.mozTelephony.dial(number)
  • Multi-SIM
 navigator.mozTelephonyManager.defaultPhone.dial()
 navigator.mozTelephonyManager.phones[index].dial()

Incoming Call

  • Current B2G
 Tel1 = navigator.mozTelephony;
  • Multi-SIM
 Tel1 = navigator.mozTelephonyManager.phones[index];

Once the telephony object is obtained, the following work remains the same.

Tel1.addEventListener('incoming');
Tel1.onincoming = function onincoming (evt) {
  incoming = evt.call; };
incoming.answer();

Implementation Details

WebTelephonyAPI multisim impl.png

Proposal: Architecture

Current Architecture

This is the current architecture supporting a single SIM card. B2G Architecture

Proposal for Multi-SIMs

Here is a proposal for multi-SIMs. Proposal: B2G Architecture for Multi-SIMs

  • Internal API - nsIRILContentHelper.idl: We might need to add 『index』, used for connecting a telephony object (phoneIndex) and a specific 『sim slot』.
  • Examples of modifiying the internal API:
void enumerateCalls(in short index,
                    in nsIRILTelephonyCallback callback);
void dial(in short index, in DOMString number);
readonly attribute jsval voicemailNumber; /* {index, number} */
  • Potential Issues
    • Array-ize RadioInterfaceLayer: one instance for one sim slot
    • Send parcel to the correct rild: might need to modify ril_worker.js and rilproxy
    • Get the number of sim slots

Discussion

Q: How do we know how many phone objects should be created in 'navigator.mozTelephonyManager' ? A: Number of the sim slots

Q: How to know default phone? A: Binded to a specified sim slot (per hardware design). We should reserve the flexibility that user has a chance to change the default phone at run-time, but note the 『default phone』 determination is another issue.

Q: How much memory increase if we use two instances to handle 2 SIMs? A: According to the information from Bug 802446, the compartment of RadioInterface layer is about 3xx KBytes. But, after removing some fixed size overhead, it is expected 2xxK-increase to add an instance for each SIM. We expect it will add less than 200K for each instance after removing SMS and other stuffs out.