Bug 818393 - Part 1: Add interface for call barring config. r=htsai. sr=mounir.

---
 dom/network/interfaces/nsIDOMMobileConnection.idl  |   84 +++++++++++++++++++-
 .../interfaces/nsIMobileConnectionProvider.idl     |    7 +-
 2 files changed, 87 insertions(+), 4 deletions(-)
This commit is contained in:
Szu-Yu Chen [:aknow] 2013-05-21 13:08:57 +08:00
parent 7e00587478
commit b43baef554
2 changed files with 87 additions and 4 deletions

View File

@ -12,7 +12,7 @@ interface nsIDOMMozMobileNetworkInfo;
interface nsIDOMMozMobileCellInfo;
interface nsIDOMMozMobileCFInfo;
[scriptable, builtinclass, uuid(dd590ea0-a711-11e2-9e96-0800200c9a66)]
[scriptable, builtinclass, uuid(2566dcb8-c82f-4420-a807-0806bd01a3b4)]
interface nsIDOMMozMobileConnection : nsIDOMEventTarget
{
const long ICC_SERVICE_CLASS_VOICE = (1 << 0);
@ -25,6 +25,21 @@ interface nsIDOMMozMobileConnection : nsIDOMEventTarget
const long ICC_SERVICE_CLASS_PAD = (1 << 7);
const long ICC_SERVICE_CLASS_MAX = (1 << 7);
/**
* Call barring program.
*
* (0) all outgoing.
* (1) outgoing international.
* (2) outgoing international except to home country.
* (3) all incoming.
* (4) incoming when roaming outside the home country.
*/
const long CALL_BARRING_PROGRAM_ALL_OUTGOING = 0;
const long CALL_BARRING_PROGRAM_OUTGOING_INTERNATIONAL = 1;
const long CALL_BARRING_PROGRAM_OUTGOING_INTERNATIONAL_EXCEPT_HOME = 2;
const long CALL_BARRING_PROGRAM_ALL_INCOMING = 3;
const long CALL_BARRING_PROGRAM_INCOMING_ROAMING = 4;
/**
* These two fields can be accessed by privileged applications with the
* 'mobilenetwork' permission.
@ -294,6 +309,39 @@ interface nsIDOMMozMobileConnection : nsIDOMEventTarget
*/
nsIDOMDOMRequest getCallForwardingOption(in unsigned short reason);
/**
* Configures call barring option.
*
* @param option
* An object containing the call barring rule to set.
* @see MozCallBarringOption for the detail of info.
*
* 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',
* 'IllegalSIMorME', 'InvalidCallBarringOption' or 'GenericFailure'
*/
nsIDOMDOMRequest setCallBarringOption(in jsval option);
/**
* Queries current call barring status.
*
* @param info
* An object containing the call barring rule to query. No need to
* specify 'enabled' property.
* @see MozCallBarringOption for the detail of info.
*
* If successful, the request's onsuccess will be called, and the request's
* result will be an object of MozCallBarringOption with correct 'enabled'
* property indicating the status of this rule.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'InvalidCallBarringOption' or 'GenericFailure'.
*/
nsIDOMDOMRequest getCallBarringOption(in jsval option);
/**
* Configures call waiting options.
*
@ -584,7 +632,37 @@ interface nsIDOMMozMobileCFInfo : nsISupports
/**
* Service for which the call forward is set up. It should be one of the
* nsIDOMMozMobileConnectionInfo.ICC_SERVICE_CLASS_* values.
* nsIDOMMozMobileConnection.ICC_SERVICE_CLASS_* values.
*/
readonly attribute unsigned short serviceClass;
};
dictionary MozCallBarringOption
{
/**
* Indicates the program the call is being barred.
*
* It shall be one of the nsIDOMMozMobileConnection.CALL_BARRING_PROGRAM_*
* values.
*/
unsigned short program;
/**
* Enable or disable the call barring program.
*/
boolean enabled;
/**
* Barring password. Use "" if no password specified.
*/
DOMString password;
/**
* Service for which the call barring is set up.
*
* It shall be one of the nsIDOMMozMobileConnection.ICC_SERVICE_CLASS_*
* values.
*/
unsigned short serviceClass;
};

View File

@ -35,7 +35,7 @@ interface nsIMobileConnectionListener : nsISupports
* XPCOM component (in the content process) that provides the mobile
* network information.
*/
[scriptable, uuid(3b02afb4-2fc5-471a-b529-816125bf90ae)]
[scriptable, uuid(0abc25f7-372e-4398-8b49-ae8fcdb575d3)]
interface nsIMobileConnectionProvider : nsISupports
{
/**
@ -69,6 +69,11 @@ interface nsIMobileConnectionProvider : nsISupports
nsIDOMDOMRequest setCallForwardingOption(in nsIDOMWindow window,
in nsIDOMMozMobileCFInfo CFInfo);
nsIDOMDOMRequest getCallBarringOption(in nsIDOMWindow window,
in jsval option);
nsIDOMDOMRequest setCallBarringOption(in nsIDOMWindow window,
in jsval option);
nsIDOMDOMRequest setCallWaitingOption(in nsIDOMWindow window,
in bool enabled);
nsIDOMDOMRequest getCallWaitingOption(in nsIDOMWindow window);