Bug 882983 - Part 1: Add ota status event (idl, webidl). r=hsinyi, sr=smaug
authorSzu-Yu Chen [:aknow] <szchen@mozilla.com>
Tue, 27 Aug 2013 08:25:53 -0400
changeset 144477 9cadfd1f14749d7a7c3929c7bde13b782d552c01
parent 144476 8a35072c7cb8c1651eae3e706d528d501b3dcef1
child 144478 914fad593e5647bb694806df4c59e71b302565a8
push id25165
push userryanvm@gmail.com
push dateWed, 28 Aug 2013 00:22:24 +0000
treeherdermozilla-central@8b4c3606442d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsinyi, smaug
bugs882983
milestone26.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 882983 - Part 1: Add ota status event (idl, webidl). r=hsinyi, sr=smaug
content/base/src/nsGkAtomList.h
dom/network/interfaces/moz.build
dom/network/interfaces/nsIDOMMobileConnection.idl
dom/network/interfaces/nsIDOMMozOtaStatusEvent.idl
dom/network/interfaces/nsIMobileConnectionProvider.idl
dom/webidl/MozOtaStatusEvent.webidl
dom/webidl/WebIDL.mk
js/xpconnect/src/event_impl_gen.conf.in
--- a/content/base/src/nsGkAtomList.h
+++ b/content/base/src/nsGkAtomList.h
@@ -748,16 +748,17 @@ GK_ATOM(onMozMousePixelScroll, "onMozMou
 GK_ATOM(onMozScrolledAreaChanged, "onMozScrolledAreaChanged")
 GK_ATOM(onmoznetworkupload, "onmoznetworkupload")
 GK_ATOM(onmoznetworkdownload, "onmoznetworkdownload")
 GK_ATOM(onnoupdate, "onnoupdate")
 GK_ATOM(onobsolete, "onobsolete")
 GK_ATOM(ononline, "ononline")
 GK_ATOM(onoffline, "onoffline")
 GK_ATOM(onopen, "onopen")
+GK_ATOM(onotastatuschange, "onotastatuschange")
 GK_ATOM(onoverflow, "onoverflow")
 GK_ATOM(onoverflowchanged, "onoverflowchanged")
 GK_ATOM(onpagehide, "onpagehide")
 GK_ATOM(onpageshow, "onpageshow")
 GK_ATOM(onpaint, "onpaint")
 GK_ATOM(onpairedstatuschanged, "onpairedstatuschanged")
 GK_ATOM(onpaste, "onpaste")
 GK_ATOM(onpopuphidden, "onpopuphidden")
--- a/dom/network/interfaces/moz.build
+++ b/dom/network/interfaces/moz.build
@@ -17,14 +17,15 @@ XPIDL_SOURCES += [
     'nsITCPSocketParent.idl',
 ]
 
 if CONFIG['MOZ_B2G_RIL']:
     XPIDL_SOURCES += [
         'nsIDOMCFStateChangeEvent.idl',
         'nsIDOMMobileConnection.idl',
         'nsIDOMMozEmergencyCbModeEvent.idl',
+        'nsIDOMMozOtaStatusEvent.idl',
         'nsIDOMNetworkStats.idl',
         'nsIDOMNetworkStatsManager.idl',
         'nsIMobileConnectionProvider.idl',
     ]
 
 XPIDL_MODULE = 'dom_network'
--- a/dom/network/interfaces/nsIDOMMobileConnection.idl
+++ b/dom/network/interfaces/nsIDOMMobileConnection.idl
@@ -6,17 +6,17 @@
 
 interface nsIDOMEventListener;
 interface nsIDOMDOMRequest;
 interface nsIDOMMozMobileConnectionInfo;
 interface nsIDOMMozMobileNetworkInfo;
 interface nsIDOMMozMobileCellInfo;
 interface nsIDOMMozMobileCFInfo;
 
-[scriptable, builtinclass, uuid(8284af62-c39d-4a59-b258-107040040418)]
+[scriptable, builtinclass, uuid(abb4e288-f91e-45dc-b1ca-1949de9807ea)]
 interface nsIDOMMozMobileConnection : nsIDOMEventTarget
 {
   const long ICC_SERVICE_CLASS_VOICE = (1 << 0);
   const long ICC_SERVICE_CLASS_DATA = (1 << 1);
   const long ICC_SERVICE_CLASS_FAX = (1 << 2);
   const long ICC_SERVICE_CLASS_SMS = (1 << 3);
   const long ICC_SERVICE_CLASS_DATA_SYNC = (1 << 4);
   const long ICC_SERVICE_CLASS_DATA_ASYNC = (1 << 5);
@@ -357,16 +357,22 @@ interface nsIDOMMozMobileConnection : ns
    */
   [implicit_jscontext] attribute jsval oncfstatechange;
 
   /**
    * The 'emergencycbmodechange' event is notified whenever the emergency
    * callback mode changes.
    */
   [implicit_jscontext] attribute jsval onemergencycbmodechange;
+
+  /**
+   * The 'onotastatuschange' event is notified whenever the ota provision status
+   * changes.
+   */
+  [implicit_jscontext] attribute jsval onotastatuschange;
 };
 
 [scriptable, uuid(49706beb-a160-40b7-b745-50f62e389a2c)]
 interface nsIDOMMozMobileConnectionInfo : nsISupports
 {
   /**
    * State of the connection.
    *
new file mode 100644
--- /dev/null
+++ b/dom/network/interfaces/nsIDOMMozOtaStatusEvent.idl
@@ -0,0 +1,21 @@
+/* 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/. */
+
+#include "nsIDOMEvent.idl"
+
+[scriptable, builtinclass, uuid(d3592cdc-c5cf-4c24-a27c-6f789ac94959)]
+interface nsIDOMMozOtaStatusEvent : nsIDOMEvent
+{
+  readonly attribute DOMString status;
+
+  [noscript] void initMozOtaStatusEvent(in DOMString aType,
+                                        in boolean aCanBubble,
+                                        in boolean aCancelable,
+                                        in DOMString aStatus);
+};
+
+dictionary MozOtaStatusEventInit : EventInit
+{
+  DOMString status;
+};
--- a/dom/network/interfaces/nsIMobileConnectionProvider.idl
+++ b/dom/network/interfaces/nsIMobileConnectionProvider.idl
@@ -5,32 +5,33 @@
 #include "nsISupports.idl"
 
 interface nsIDOMDOMRequest;
 interface nsIDOMMozMobileCFInfo;
 interface nsIDOMMozMobileConnectionInfo;
 interface nsIDOMMozMobileNetworkInfo;
 interface nsIDOMWindow;
 
-[scriptable, uuid(7da2d9f6-eba1-4339-bde1-dc6732d42cdf)]
+[scriptable, uuid(f1878629-4151-4e02-a22a-8cec3d7eddee)]
 interface nsIMobileConnectionListener : nsISupports
 {
   void notifyVoiceChanged();
   void notifyDataChanged();
   void notifyUssdReceived(in DOMString message,
                           in boolean sessionEnded);
   void notifyDataError(in DOMString message);
   void notifyCFStateChange(in boolean success,
                            in unsigned short action,
                            in unsigned short reason,
                            in DOMString number,
                            in unsigned short timeSeconds,
                            in unsigned short serviceClass);
   void notifyEmergencyCbModeChanged(in boolean active,
                                     in unsigned long timeoutMs);
+  void notifyOtaStatusChanged(in DOMString status);
 };
 
 /**
  * XPCOM component (in the content process) that provides the mobile
  * network information.
  */
 [scriptable, uuid(576c7c00-7319-4309-aa9e-1dab102e0874)]
 interface nsIMobileConnectionProvider : nsISupports
new file mode 100644
--- /dev/null
+++ b/dom/webidl/MozOtaStatusEvent.webidl
@@ -0,0 +1,33 @@
+/* -*- 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/.
+ */
+
+[Constructor(DOMString type, optional MozOtaStatusEventInit eventInitDict),
+ HeaderFile="GeneratedEventClasses.h"]
+interface MozOtaStatusEvent : Event
+{
+  /**
+   * One of the following values:
+   *
+   * spl_unlocked
+   * spc_retries_exceeded
+   * a_key_exchanged
+   * ssd_updated
+   * nam_downloaded
+   * mdn_downloaded
+   * imsi_downloaded
+   * prl_downloaded
+   * committed
+   * otapa_started
+   * otapa_stopped
+   * otapa_aborted
+   */
+  readonly attribute DOMString status;
+};
+
+dictionary MozOtaStatusEventInit : EventInit
+{
+  DOMString status = "";
+};
--- a/dom/webidl/WebIDL.mk
+++ b/dom/webidl/WebIDL.mk
@@ -493,16 +493,17 @@ ifdef MOZ_B2G_RIL
 webidl_files += \
   CallEvent.webidl \
   CFStateChangeEvent.webidl \
   DataErrorEvent.webidl \
   IccCardLockErrorEvent.webidl \
   MozCellBroadcast.webidl \
   MozCellBroadcastEvent.webidl \
   MozEmergencyCbModeEvent.webidl \
+  MozOtaStatusEvent.webidl \
   MozVoicemailEvent.webidl \
   MozWifiConnectionInfoEvent.webidl \
   MozWifiStatusChangeEvent.webidl \
   USSDReceivedEvent.webidl \
   $(NULL)
 endif
 
 ifdef MOZ_GAMEPAD
--- a/js/xpconnect/src/event_impl_gen.conf.in
+++ b/js/xpconnect/src/event_impl_gen.conf.in
@@ -31,16 +31,17 @@ simple_events = [
     'BluetoothDeviceEvent',
     'BluetoothStatusChangedEvent',
 #endif
 #ifdef MOZ_B2G_RIL
     'CFStateChangeEvent',
     'DataErrorEvent',
     'IccCardLockErrorEvent',
     'MozEmergencyCbModeEvent',
+    'MozOtaStatusEvent',
     'MozWifiStatusChangeEvent',
     'MozWifiConnectionInfoEvent',
     'MozCellBroadcastEvent',
     'MozVoicemailEvent',
     'USSDReceivedEvent',
 #endif
     'ElementReplaceEvent',
     'MozSmsEvent',