WebAPI/WebMobileConnection: Difference between revisions

Jump to navigation Jump to search
Undo revision 438227 by Allstars.chh (talk)
(Undo revision 438227 by Allstars.chh (talk))
Line 1: Line 1:
This exposes information about the current mobile voice and data connection to (certain) HTML content. The primary use case for this is the status bar of the main phone UI. It typically shows the operator name, signal strength, data connection type, etc.
<p>This exposes information about the current mobile voice and data connection to (certain) HTML content. The primary use case for this is the status bar of the main phone UI. It typically shows the operator name, signal strength, data connection type, etc.
 
</p>
<h2> Status </h2>
<h2> Status </h2>
<p>Implemented in <span class="fck_mw_template">{{bug|729173}}</span>. <br />
<p>Implemented in <span class="fck_mw_template">{{bug|729173}}</span>.
ICC lock(PIN/PIN2/PUK/PUK2) is implemented in <span class="fck_mw_template">{{bug|731786}}</span>
</p>
</p>
 
<h2> Proposed API </h2>
== Proposed API ==
<pre class="_fck_mw_lspace"> interface MobileConnection&#160;: EventTarget
 
{
  interface MobileConnection : EventTarget
  /**
  {
    * Indicates the state of the device's ICC card.
    /**
    *
    * Indicates the state of the device's ICC card.
    * Possible values: 'unavailable', 'absent', 'pin_required', 'puk_required',
    *
    * 'network_locked', 'not_ready', 'ready'.
    * Possible values: 'unavailable', 'absent', 'pin_required', 'puk_required',
    */
    * 'network_locked', 'not_ready', 'ready'.
  readonly attribute string cardState;
    */
 
     readonly attribute string cardState;
  /**
    * Indicates whether the device is connected to a mobile network.
    */
  readonly attribute bool connected;
 
  /**
    * Indicates whether emergency calls are possible.
    *
    * This flag is only relevant when 'connected' is false.
    */
  readonly attribute bool emergencyCallsPossible;
 
  /**
    * Indicates whether the connection is going through a foreign operator
    * (roaming) or not.
    */
  readonly attribute bool roaming;
 
  /**
    * Operator name.
    */
  readonly attribute string operator?;
 
  /**
    * Type of connection.
    *
    * Possible values: 'gprs', 'edge', 'umts', 'hsdpa', 'evdo0', 'evdoa', 'evdob', etc.
     */
  readonly attribute string type?;
 
  /**
    * Signal strength, represented linearly as a number between 0 (weakest signal) and 1.0
    * (full signal).
    */
  readonly attribute float signalStrength?;
 
  /**
    * Signal strength in dBm, or null if no service is available.
    */
  readonly attribute short signalStrengthDbm?;
 
  /**
    * Search for available networks.
    *
    * If successful, the request result will be an array of operator names.
    */
  DOMRequest getNetworks();
 
  /**
    * The 'cardstatechange' event is notified when the 'cardState' attribute
    * changes value.
    */
  attribute EventListener oncardstatechange;
 
  /**
    * The 'connectionchange' event is notified whenever one of the 'connected',
    * 'roaming', 'operator', 'type' attributes change, since typically many or
    * all of them change together.
    */
  attribute EventListener onconnectionchange;
      
      
    /**
  /**
    * Indicates whether the device is connected to a mobile network.
     * The 'signalstrengthchange' event is notified whenever the signal strength
    */
    * changes value. The 'bars' attribute is updated accordingly.
    readonly attribute bool connected;
    */
   
  attribute EventListener onsignalstrengthchange;
    /**
 
    * Indicates whether emergency calls are possible.
};
    *
</pre>
    * This flag is only relevant when 'connected' is false.
<h2> Other radio-related functionality </h2>
    */
<p>The following radio/mobile connection related features will be exposed as settings in <a _fcknotitle="true" href="SettingsAPI">SettingsAPI</a>:
    readonly attribute bool emergencyCallsPossible;
</p>
   
<ul><li> radio on/off (e.g. for aeroplane mode)
    /**
</li><li> caller ID on/off/provider default (called "CLIR" in TS 27.007)
    * Indicates whether the connection is going through a foreign operator
</li><li> call forwarding preferences
    * (roaming) or not.
</li><li> manual override for operator selection
    */
</li></ul>
    readonly attribute bool roaming;
<p>There are also some more features of the radio that should be exposed to (privileged) content in some shape or form:
   
</p>
    /**
<ul><li> ICC-related (SIM/RUIM card)
    * Operator name.
<ul><li> own phone number and other ICC I/O related features
    */
</li><li> entering PIN, PIN2, PUK, PUK2 to unlock various states of the SIM card. Entering the PIN isn't *that* exotic, actually. Some carriers deliver their SIM cards with the PIN lock enabled, for instance.
    readonly attribute string operator?;
</li><li> changing the PIN (also serves as enabling/disabling the PIN lock.)
   
</li></ul>
    /**
</li><li> device-related
    * Type of connection.
<ul><li> get IMEI, IMEISV
    *
</li><li> depersonalize (remove network lock)
    * Possible values: 'gprs', 'edge', 'umts', 'hsdpa', 'evdo0', 'evdoa', 'evdob', etc.
</li><li> baseband-related information and features
    */
</li></ul>
    readonly attribute string type?;
</li></ul>
   
<p>The latter, device-related features seem to be more exotic than the ICC-related ones and hopefully also mostly unnecessary. The question remains where these APIs should live.
    /**
</p>
    * Signal strength, represented linearly as a number between 0 (weakest signal) and 1.0
    * (full signal).
    */
    readonly attribute float signalStrength?;
   
    /**
    * Signal strength in dBm, or null if no service is available.
    */
    readonly attribute short signalStrengthDbm?;
   
    /**
    * Search for available networks.
    *
    * If successful, the request result will be an array of operator names.
    */
    DOMRequest getNetworks();
   
    /**
    * The 'cardstatechange' event is notified when the 'cardState' attribute
    * changes value.
    */
    attribute EventListener oncardstatechange;
   
    /**
    * The 'connectionchange' event is notified whenever one of the 'connected',
    * 'roaming', 'operator', 'type' attributes change, since typically many or
    * all of them change together.
    */
    attribute EventListener onconnectionchange;
   
     /**
    * The 'signalstrengthchange' event is notified whenever the signal strength
    * changes value. The 'bars' attribute is updated accordingly.
    */
    attribute EventListener onsignalstrengthchange;
   
  };
 
== Other radio-related functionality ==
 
The following radio/mobile connection related features will be exposed as settings in [[SettingsAPI]]:
 
* radio on/off (e.g. for aeroplane mode)
* caller ID on/off/provider default (called "CLIR" in TS 27.007)
* call forwarding preferences
* manual override for operator selection
 
There are also some more features of the radio that should be exposed to (privileged) content in some shape or form:
 
* ICC-related (SIM/RUIM card)
** own phone number and other ICC I/O related features
** entering PIN, PIN2, PUK, PUK2 to unlock various states of the SIM card. Entering the PIN isn't *that* exotic, actually. Some carriers deliver their SIM cards with the PIN lock enabled, for instance.
** changing the PIN (also serves as enabling/disabling the PIN lock.)
* device-related
** get IMEI, IMEISV
** depersonalize (remove network lock)
** baseband-related information and features
 
The latter, device-related features seem to be more exotic than the ICC-related ones and hopefully also mostly unnecessary. The question remains where these APIs should live.
Confirmed users
266

edits

Navigation menu