WebAPI/WebMobileConnection/Multi-SIM: Difference between revisions

no edit summary
No edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 3: Line 3:


=== Web API ===
=== Web API ===
The change is quite simple, navigator.mozMobileConnection becomes an array of nsIDOMMozMobileConnection obect. API users can use 'serviceId' as an index to access corresponding service object.
The change is quite simple -- navigator.mozMobileConnection becomes an array of nsIDOMMozMobileConnection obect, i.e. navigator.mozMobileConnections. The length of the array is actually the number of services provided on a device. And the index of the array is used as 'serviceId.'


We don't modify the existed interface, like nsIDOMMozMobileConnection, nsIDOMMozMobileConnectionInfo ...etc, to minimize the coding effort of gaia.
We don't modify the existing interface, like nsIDOMMozMobileConnection, nsIDOMMozMobileConnectionInfo ...etc, to minimize the coding effort of gaia.


interface nsIMozNavigatorMobileConnectionManager: nsISupports
{
  // An array of nsIDOMMozMobileConnection.
  readonly attribute jsval mozMobileConnections;
};
  interface nsIDOMMozMobileConnection : nsIDOMEventTarget
  interface nsIDOMMozMobileConnection : nsIDOMEventTarget
  {
  {
Line 54: Line 60:
   [implicit_jscontext] attribute jsval onemergencycbmodechange;
   [implicit_jscontext] attribute jsval onemergencycbmodechange;
   [implicit_jscontext] attribute jsval onotastatuschange;
   [implicit_jscontext] attribute jsval onotastatuschange;
   [implicit_jscontext] attribute jsval onicccardchange; // Icc card is inserted or removed.
   [implicit_jscontext] attribute jsval oniccchange; // Icc card is inserted or removed.
  };
  };


Line 100: Line 106:
       var numberOfServices = window.navigator.mozMobileConnections.length;
       var numberOfServices = window.navigator.mozMobileConnections.length;


=== Implementation ===
=== Internal API and Implementation ===
mozMobileConnection becomes an array of nsIDOMMozMobileConnection in nsINavigatorMobileConnection.idl
 
interface nsIMozNavigatorMobileConnectionManager: nsISupports
{
  // An array of nsIDOMMozMobileConnection.
  readonly attribute jsval mozMobileConnections;
};
 
Add clientId in the interface of nsIMobileConnectionProvider.idl and change the implementation of getVoiceConnectionInfo, getDataConnectionInfo, and getNetworkSelectionMode.
Add clientId in the interface of nsIMobileConnectionProvider.idl and change the implementation of getVoiceConnectionInfo, getDataConnectionInfo, and getNetworkSelectionMode.


Line 120: Line 118:
   void notifyEmergencyCbModeChanged(in boolean active, in unsigned long timeoutMs);
   void notifyEmergencyCbModeChanged(in boolean active, in unsigned long timeoutMs);
   void notifyOtaStatusChanged(in DOMString status);
   void notifyOtaStatusChanged(in DOMString status);
   void notifyIccCardChanged();
   void notifyIccChanged();
  };
  };


Line 188: Line 186:


== Status ==
== Status ==
* [https://bugzilla.mozilla.org/show_bug.cgi?id=814629 bug 814629] for WebMobileConnection API. (Ongoing)
* [https://bugzilla.mozilla.org/show_bug.cgi?id=814629 bug 814629] for WebMobileConnection API. (Landed)
* [https://bugzilla.mozilla.org/show_bug.cgi?id=818353 bug 818353] for adding subscriptId in backend implementation. (Ongoing)
* [https://bugzilla.mozilla.org/show_bug.cgi?id=818353 bug 818353] for adding subscriptId in backend implementation. (Landed)
 
[[Category:Web APIs]]
Confirmed users
1,340

edits