WebAPI/WebMobileConnection: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Undo revision 438228 by Allstars.chh (talk))
No edit summary
Line 1: Line 1:
<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.
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>
== Status ==
<p>Implemented in <span class="fck_mw_template"><span class="fck_mw_template">{{bug|729173}}</span></span>. <br />
 
ICC lock(PIN/PIN2/PUK/PUK2) is implemented in <span class="fck_mw_template"><span class="fck_mw_template">{{bug|731786}}</span></span>
Implemented in {{bug|729173}}.
</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;
      
      
  /**
    /**
     * The 'signalstrengthchange' event is notified whenever the signal strength
    * Indicates whether the device is connected to a mobile network.
    * changes value. The 'bars' attribute is updated accordingly.
    */
    */
    readonly attribute bool connected;
  attribute EventListener onsignalstrengthchange;
   
 
    /**
};
    * Indicates whether emergency calls are possible.
</pre>
    *
<h2> Other radio-related functionality </h2>
    * This flag is only relevant when 'connected' is false.
<p>The following radio/mobile connection related features will be exposed as settings in <a _fcknotitle="true" href="SettingsAPI">SettingsAPI</a>:
    */
</p>
    readonly attribute bool emergencyCallsPossible;
<ul><li> radio on/off (e.g. for aeroplane mode)
   
</li><li> caller ID on/off/provider default (called "CLIR" in TS 27.007)
    /**
</li><li> call forwarding preferences
    * Indicates whether the connection is going through a foreign operator
</li><li> manual override for operator selection
    * (roaming) or not.
</li></ul>
    */
<p>There are also some more features of the radio that should be exposed to (privileged) content in some shape or form:
    readonly attribute bool roaming;
</p>
   
<ul><li> ICC-related (SIM/RUIM card)
    /**
<ul><li> own phone number and other ICC I/O related features
    * Operator name.
</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.
    */
</li><li> changing the PIN (also serves as enabling/disabling the PIN lock.)
    readonly attribute string operator?;
</li></ul>
   
</li><li> device-related
    /**
<ul><li> get IMEI, IMEISV
    * Type of connection.
</li><li> depersonalize (remove network lock)
    *
</li><li> baseband-related information and features
    * Possible values: 'gprs', 'edge', 'umts', 'hsdpa', 'evdo0', 'evdoa', 'evdob', etc.
</li></ul>
    */
</li></ul>
    readonly attribute string type?;
<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.

Revision as of 03:45, 6 June 2012

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.

Status

Implemented in bug 729173.

Proposed API

 interface MobileConnection : EventTarget
 {
   /**
    * Indicates the state of the device's ICC card.
    *
    * Possible values: 'unavailable', 'absent', 'pin_required', 'puk_required',
    * 'network_locked', 'not_ready', 'ready'.
    */
   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;
    
   /**
    * 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.