Bug 1058397 - Part 2: USSDSession interface. r=hsinyi
authorSzu-Yu Chen [:aknow] <szchen@mozilla.com>
Wed, 15 Oct 2014 02:50:00 -0400
changeset 210715 8ec09ed512d3830642fe2c3859d55ca3135e26b6
parent 210714 1a2f098c634dd890e7f7d7fe8ef8d3eb5bd3e403
child 210716 b93c5e78c526d4d1caa93fb9664adeb1a96f33bf
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewershsinyi
bugs1058397
milestone36.0a1
Bug 1058397 - Part 2: USSDSession interface. r=hsinyi
dom/webidl/USSDReceivedEvent.webidl
dom/webidl/USSDSession.webidl
dom/webidl/moz.build
--- 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
@@ -504,16 +504,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',