Bug 1058397 - Part 2: USSDSession interface. r=hsinyi
--- a/dom/webidl/USSDReceivedEvent.webidl
+++ b/dom/webidl/USSDReceivedEvent.webidl
@@ -1,19 +1,25 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-[Pref="dom.mobileconnection.enabled",
+[Pref="dom.telephony.enabled",
+ CheckPermissions="telephony mobileconnection",
+ AvailableIn="CertifiedApps",
Constructor(DOMString type, optional USSDReceivedEventInit eventInitDict)]
interface USSDReceivedEvent : Event
{
+ readonly attribute unsigned long serviceId;
readonly attribute DOMString? message;
- readonly attribute boolean sessionEnded;
+ readonly attribute USSDSession? session; // null if session is ended.
+ readonly attribute boolean sessionEnded; // deprecated. Bug 1070831
};
dictionary USSDReceivedEventInit : EventInit
{
+ unsigned long serviceId = 0;
DOMString? message = null;
+ USSDSession? session = null;
boolean sessionEnded = false;
};
new file mode 100644
--- /dev/null
+++ b/dom/webidl/USSDSession.webidl
@@ -0,0 +1,14 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+[Pref="dom.telephony.enabled",
+ CheckPermissions="telephony",
+ AvailableIn="CertifiedApps",
+ Constructor(unsigned long serviceId)]
+interface USSDSession {
+ [Throws]
+ Promise<void> send(DOMString ussd);
+};
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -496,16 +496,17 @@ WEBIDL_FILES = [
'UDPMessageEvent.webidl',
'UDPSocket.webidl',
'UIEvent.webidl',
'UndoManager.webidl',
'URL.webidl',
'URLSearchParams.webidl',
'URLUtils.webidl',
'URLUtilsReadOnly.webidl',
+ 'USSDSession.webidl',
'ValidityState.webidl',
'VideoPlaybackQuality.webidl',
'VideoStreamTrack.webidl',
'VideoTrack.webidl',
'VideoTrackList.webidl',
'VTTCue.webidl',
'VTTRegion.webidl',
'WaveShaperNode.webidl',