WebAPI/WebMobileConnection/Multi-SIM: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
== Proposal: WebMobileConnectionManager API for Multi-SIM  ==
== Proposal: WebMobileConnectionManager 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.
Currently B2G supports a single SIM architecture. This proposal wants to extend it for supporting multi-SIMs. In multi-SIM device, each service is independent and has it own status and information. Here we introduce multiple nsIDOMMozMobileConnection objects architecture. One nsIDOMMozMobileConnection object is binded to a service. You can use serviceId as index to get corresponding service object.
 
nsIDOMMozMobileConnectionManager will handle the interactive and synchronizing 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 ===
=== Web API ===
Following are what we create for nsIDOMMozMobileConnectionManager.
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.
 
interface nsIDOMMozMobileConnectionManager : nsISupports
{
  readonly attribute jsval mobileConnections;
  readonly attribute nsIDOMMozMobileConnection defaultMobileConnection;
};


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


*Multi-SIMs
*Multi-SIMs
       // Listen connection status of default SIM slot
       // Listen connection status for specific service
      var conn = window.navigator.mozMobileConnectionManager.defaultMobileConnection;
       var conn = window.navigator.mozMobileConnection[serviceId];
 
      // Listen connection status of specific SIM slot
       var conn = window.navigator.mozMobileConnectionManager.MobileConnections[index];


Once the mobile connection object is obtained, the follow work is the same. We can get notification when voice/data connection change occurs in specific SIM.
Once the mobile connection object is obtained, the follow work is the same. We can get notification when voice/data connection change occurs in specific SIM.
Line 96: Line 85:
         }
         }
       }
       }
And also you can get total number of service via
      var numberOfServices = window.navigator.mozMobileConnection.length;


==== Get ICC Lock Status  ====
==== Get ICC Lock Status  ====
Confirmed users
258

edits

Navigation menu