Confirmed users
1,340
edits
Allstars.chh (talk | contribs) No edit summary |
No edit summary |
||
| (8 intermediate revisions by 4 users not shown) | |||
| Line 3: | Line 3: | ||
* entering PIN, PIN2, PUK, PUK2 to unlock various states of the SIM card. | * entering PIN, PIN2, PUK, PUK2 to unlock various states of the SIM card. | ||
* changing the PIN (also serves as enabling/disabling the PIN lock.) | * changing the PIN (also serves as enabling/disabling the PIN lock.) | ||
== Status == | == Status == | ||
Implemented in {{bug|729173}}. | * Implemented in {{bug|729173}}. | ||
ICC lock(PIN/PIN2/PUK/PUK2) is implemented in {{Bug|729173}}. | * ICC lock(PIN/PIN2/PUK/PUK2) is implemented in {{Bug|729173}}. | ||
* getNetworks() and WebMobileOperatorInfo were added in {{Bug|744344}} | |||
* data status is not exposed until {{Bug|753170}} is resolved. | |||
* Move icc/sim related stuff to iccManager in {{Bug|857414}}. And also separate IccManager from MobileConnection. | |||
== Proposed API == | == Proposed API == | ||
| Line 21: | Line 23: | ||
*/ | */ | ||
readonly attribute string cardState; | readonly attribute string cardState; | ||
/** | /** | ||
* | * Information about the voice connection. | ||
*/ | */ | ||
readonly attribute | readonly attribute MobileConnectionInfo voice; | ||
/** | /** | ||
* | * Information about the data connection. | ||
*/ | */ | ||
readonly attribute | readonly attribute MobileConnectionInfo data; | ||
/** | /** | ||
* | * The 'cardstatechange' event is notified when the 'cardState' attribute | ||
* | * changes value. | ||
*/ | */ | ||
attribute EventListener oncardstatechange; | |||
/** | /** | ||
* | * The 'voicechange' event is notified whenever the voice connection object | ||
* changes. | |||
*/ | */ | ||
attribute EventListener onvoicechange; | |||
/** | /** | ||
* | * The 'datachange' event is notified whenever the data connection object | ||
* changes values. | |||
* | |||
*/ | */ | ||
attribute EventListener ondatachange; | |||
/** | /** | ||
* Search for available networks. | * Search for available networks. | ||
* | * | ||
* If successful, the request result will be an array of | * If successful, the request's onsuccess will be called, and the request's | ||
* result will be an array of MobileOperatorInfo. | |||
* | |||
* Otherwise, the request's onerror will be called, and the request's error | |||
* will be either 'RadioNotAvailable', 'RequestNotSupported', or 'GenericFailure'. | |||
*/ | */ | ||
DOMRequest getNetworks(); | DOMRequest getNetworks(); | ||
/** | /** | ||
| Line 100: | Line 74: | ||
* e.g. {lockType: "pin", enabled: true}. | * e.g. {lockType: "pin", enabled: true}. | ||
*/ | */ | ||
DOMRequest getCardLock(DOMString lockType); | |||
/** | /** | ||
* Unlock a card lock. | * Unlock a card lock. | ||
| Line 125: | Line 99: | ||
* newPin: "..."}); | * newPin: "..."}); | ||
* | * | ||
* @return a | * @return a DOMRequest. | ||
* The request's result will be an object containing | * The request's result will be an object containing | ||
* information about the unlock operation. | * information about the unlock operation. | ||
| Line 146: | Line 120: | ||
* } | * } | ||
*/ | */ | ||
DOMRequest unlockCardLock(Object info); | |||
/** | /** | ||
* Modify the state of a card lock. | * Modify the state of a card lock. | ||
| Line 172: | Line 146: | ||
* newPin: "..."}); | * newPin: "..."}); | ||
* | * | ||
* @return a | * @return a DOMRequest. | ||
* The request's result will be an object containing | * The request's result will be an object containing | ||
* information about the operation. | * information about the operation. | ||
| Line 193: | Line 167: | ||
* } | * } | ||
*/ | */ | ||
DOMRequest setCardLock(Object info); | |||
}; | |||
interface MobileConnectionInfo | |||
{ | |||
/** | |||
* Indicates whether the device is connected to a mobile network. | |||
*/ | |||
readonly attribute bool connected; | |||
/** | |||
* Indicates whether only emergency calls are possible. | |||
* | |||
* This flag is only relevant to voice connections and when 'connected' is | |||
* false. | |||
*/ | |||
readonly attribute bool emergencyCallsOnly; | |||
/** | |||
* Indicates whether the connection is going through a foreign operator | |||
* (roaming) or not. | |||
*/ | |||
readonly attribute bool roaming; | |||
/** | |||
* Network operator | |||
*/ | |||
readonly attribute DOMString operator; | |||
/** | |||
* Type of connection. | |||
* | |||
* Possible values: 'gsm', 'cdma', gprs', 'edge', 'umts', 'hsdpa', 'evdo0', | |||
* 'evdoa', 'evdob', etc. | |||
*/ | |||
readonly attribute DOMString type; | |||
/** | |||
* Signal strength in dBm, or null if no service is available. | |||
*/ | |||
readonly attribute int signalStrength; | |||
/** | |||
* Signal strength, represented linearly as a number between 0 (weakest | |||
* signal) and 100 (full signal). | |||
*/ | |||
readonly attribute int relSignalStrength; | |||
}; | |||
interface MobileOperatorInfo | |||
{ | |||
/** | |||
* Short name of the network operator | |||
*/ | |||
readonly attribute DOMString shortName; | |||
/** | |||
* Long name of the network operator | |||
*/ | |||
readonly attribute DOMString longName; | |||
/** | |||
* Mobile Country Code (MCC) of the network operator | |||
*/ | |||
readonly attribute unsigned short mcc; | |||
/** | |||
* Mobile Network Code (MNC) of the network operator | |||
*/ | |||
readonly attribute unsigned short mnc; | |||
/** | |||
* State of this network operator. | |||
* | |||
* Possible values: 'available', 'connected', 'forbidden', or null (unknown) | |||
*/ | |||
readonly attribute DOMString state; | |||
}; | }; | ||
| Line 209: | Line 260: | ||
* ICC-related (SIM/RUIM card) | * ICC-related (SIM/RUIM card) | ||
** own phone number and other ICC I/O related features | ** own phone number and other ICC I/O related features.(Currently these information are not exposed in WebAPI, see {{Bug|736941}}.) | ||
* device-related | * device-related | ||
** get IMEI, IMEISV | ** get IMEI, IMEISV | ||
| Line 216: | Line 267: | ||
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. | 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. | ||
[[Category:Web APIs]] | |||