Bug 944225 - Part 1: Add set/getPreferredNetworkType() API (idl). r=hsinyi

This commit is contained in:
Jessica Jong 2013-12-11 11:14:20 +08:00
parent cd473103ed
commit df07502730
2 changed files with 42 additions and 2 deletions

View File

@ -11,7 +11,7 @@ interface nsIDOMMozMobileNetworkInfo;
interface nsIDOMMozMobileCellInfo;
interface nsIDOMMozMobileCFInfo;
[scriptable, builtinclass, uuid(4c8331f9-45f3-479d-ac3f-acb60fcc0583)]
[scriptable, builtinclass, uuid(f55510a9-8dfc-44f5-90ab-355d1e721808)]
interface nsIDOMMozMobileConnection : nsIDOMEventTarget
{
const long ICC_SERVICE_CLASS_VOICE = (1 << 0);
@ -129,6 +129,40 @@ interface nsIDOMMozMobileConnection : nsIDOMEventTarget
*/
nsIDOMDOMRequest selectNetworkAutomatically();
/**
* Set preferred network type
*
* @param type
* DOMString indicates the desired preferred network type.
* Possible values: 'wcdma/gsm', 'gsm', 'wcdma', 'wcdma/gsm-auto',
'cdma/evdo', 'cdma', 'evdo', or
'wcdma/gsm/cdma/evdo'.
*
* If successful, the request's onsuccess will be called.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'InvalidParameter', 'ModeNotSupported' or 'GenericFailure'
*
* TODO: param "type" should be a WebIDL enum when this interface is converted
* to WebIDL
*/
nsIDOMDOMRequest setPreferredNetworkType(in DOMString type);
/**
* Query current preferred network type
*
* If successful, the request's onsuccess will be called. And the request's
* result will be a string indicating the current preferred network type.
* The value will be either 'wcdma/gsm', 'gsm', 'wcdma', 'wcdma/gsm-auto',
* 'cdma/evdo', 'cdma', 'evdo', or 'wcdma/gsm/cdma/evdo'.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* or 'GenericFailure'
*/
nsIDOMDOMRequest getPreferredNetworkType();
/**
* Set roaming preference
*

View File

@ -35,7 +35,7 @@ interface nsIMobileConnectionListener : nsISupports
* XPCOM component (in the content process) that provides the mobile
* network information.
*/
[scriptable, uuid(9a804dc4-6900-46af-8c38-3d0f424672b5)]
[scriptable, uuid(0e027520-dd87-461d-88a6-c3e46369c03c)]
interface nsIMobileConnectionProvider : nsISupports
{
/**
@ -62,6 +62,12 @@ interface nsIMobileConnectionProvider : nsISupports
nsIDOMDOMRequest selectNetworkAutomatically(in unsigned long clientId,
in nsIDOMWindow window);
nsIDOMDOMRequest setPreferredNetworkType(in unsigned long clientId,
in nsIDOMWindow window,
in DOMString type);
nsIDOMDOMRequest getPreferredNetworkType(in unsigned long clientId,
in nsIDOMWindow window);
nsIDOMDOMRequest setRoamingPreference(in unsigned long clientId,
in nsIDOMWindow window,
in DOMString mode);