From 16c6da04b2bf1e4edc895e2a6169cde9085e4b21 Mon Sep 17 00:00:00 2001 From: "Szu-Yu Chen [:aknow]" Date: Tue, 27 Aug 2013 08:25:53 -0400 Subject: [PATCH] Bug 882983 - Part 1: Add ota status event (idl, webidl). r=hsinyi, sr=smaug --- content/base/src/nsGkAtomList.h | 1 + dom/network/interfaces/moz.build | 1 + .../interfaces/nsIDOMMobileConnection.idl | 8 ++++- .../interfaces/nsIDOMMozOtaStatusEvent.idl | 21 ++++++++++++ .../nsIMobileConnectionProvider.idl | 3 +- dom/webidl/MozOtaStatusEvent.webidl | 33 +++++++++++++++++++ dom/webidl/WebIDL.mk | 1 + js/xpconnect/src/event_impl_gen.conf.in | 1 + 8 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 dom/network/interfaces/nsIDOMMozOtaStatusEvent.idl create mode 100644 dom/webidl/MozOtaStatusEvent.webidl diff --git a/content/base/src/nsGkAtomList.h b/content/base/src/nsGkAtomList.h index 4f8f55e7ff78..5a2098850957 100644 --- a/content/base/src/nsGkAtomList.h +++ b/content/base/src/nsGkAtomList.h @@ -753,6 +753,7 @@ 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") diff --git a/dom/network/interfaces/moz.build b/dom/network/interfaces/moz.build index eab9fffd4462..9e7ce875f934 100644 --- a/dom/network/interfaces/moz.build +++ b/dom/network/interfaces/moz.build @@ -22,6 +22,7 @@ if CONFIG['MOZ_B2G_RIL']: 'nsIDOMCFStateChangeEvent.idl', 'nsIDOMMobileConnection.idl', 'nsIDOMMozEmergencyCbModeEvent.idl', + 'nsIDOMMozOtaStatusEvent.idl', 'nsIDOMNetworkStats.idl', 'nsIDOMNetworkStatsManager.idl', 'nsIMobileConnectionProvider.idl', diff --git a/dom/network/interfaces/nsIDOMMobileConnection.idl b/dom/network/interfaces/nsIDOMMobileConnection.idl index 2f7276af09c6..cb0df9bf399f 100644 --- a/dom/network/interfaces/nsIDOMMobileConnection.idl +++ b/dom/network/interfaces/nsIDOMMobileConnection.idl @@ -11,7 +11,7 @@ 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); @@ -362,6 +362,12 @@ interface nsIDOMMozMobileConnection : nsIDOMEventTarget * 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)] diff --git a/dom/network/interfaces/nsIDOMMozOtaStatusEvent.idl b/dom/network/interfaces/nsIDOMMozOtaStatusEvent.idl new file mode 100644 index 000000000000..aedd5bd6752a --- /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; +}; diff --git a/dom/network/interfaces/nsIMobileConnectionProvider.idl b/dom/network/interfaces/nsIMobileConnectionProvider.idl index e867742f65f9..7a118921d0ea 100644 --- a/dom/network/interfaces/nsIMobileConnectionProvider.idl +++ b/dom/network/interfaces/nsIMobileConnectionProvider.idl @@ -10,7 +10,7 @@ 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(); @@ -26,6 +26,7 @@ interface nsIMobileConnectionListener : nsISupports in unsigned short serviceClass); void notifyEmergencyCbModeChanged(in boolean active, in unsigned long timeoutMs); + void notifyOtaStatusChanged(in DOMString status); }; /** diff --git a/dom/webidl/MozOtaStatusEvent.webidl b/dom/webidl/MozOtaStatusEvent.webidl new file mode 100644 index 000000000000..4afc860d5c5d --- /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 = ""; +}; diff --git a/dom/webidl/WebIDL.mk b/dom/webidl/WebIDL.mk index 0ddc86193c54..918c31c5f8b5 100644 --- a/dom/webidl/WebIDL.mk +++ b/dom/webidl/WebIDL.mk @@ -498,6 +498,7 @@ webidl_files += \ MozCellBroadcast.webidl \ MozCellBroadcastEvent.webidl \ MozEmergencyCbModeEvent.webidl \ + MozOtaStatusEvent.webidl \ MozVoicemailEvent.webidl \ MozWifiConnectionInfoEvent.webidl \ MozWifiStatusChangeEvent.webidl \ diff --git a/js/xpconnect/src/event_impl_gen.conf.in b/js/xpconnect/src/event_impl_gen.conf.in index 24279486796b..35eb971fd504 100644 --- a/js/xpconnect/src/event_impl_gen.conf.in +++ b/js/xpconnect/src/event_impl_gen.conf.in @@ -36,6 +36,7 @@ simple_events = [ 'DataErrorEvent', 'IccCardLockErrorEvent', 'MozEmergencyCbModeEvent', + 'MozOtaStatusEvent', 'MozWifiStatusChangeEvent', 'MozWifiConnectionInfoEvent', 'MozCellBroadcastEvent',