WebAPI/WebMobileConnection: Difference between revisions
< WebAPI
Jump to navigation
Jump to search
No edit summary |
|||
Line 87: | Line 87: | ||
*/ | */ | ||
attribute EventListener onsignalstrengthchange; | attribute EventListener onsignalstrengthchange; | ||
}; | }; | ||
Revision as of 04:40, 28 February 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.
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 as defined by 3GPP TS 27.007 specification, section 8.5. * * Possible values: * 0 -113 dBm or less * 1 -111 dBm * 2...30 -109 ... -53 dBm * 31 -51 dBm or greater * null if no signal strength (or signal) is available. */ readonly attribute short signalStrength?; /** * Signal strength expressed as number of "bars". * * Possible values: 0 (weakest signal) to 4 (full signal). */ readonly attribute short bars?; /** * Search for available networks. * * If successful, the request result will be an array of operator names. */ DOMRequest listAvailableNetworks(); /** * 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; };
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.