From 3870b66efb4cfa757b53d3f03c716e667097700f Mon Sep 17 00:00:00 2001 From: Bevis Tseng Date: Fri, 13 Feb 2015 15:05:37 +0800 Subject: [PATCH] Bug 1114935 - Part 8: Mark TODO items for deprecating RILContentHelper. r=echen --- dom/icc/IccManager.cpp | 2 ++ dom/icc/interfaces/moz.build | 2 +- dom/system/gonk/RILContentHelper.manifest | 2 ++ dom/system/gonk/RadioInterfaceLayer.js | 17 +++++++++++++++-- dom/system/gonk/moz.build | 4 ++-- .../tests/marionette/test_ril_code_quality.py | 5 +++-- 6 files changed, 25 insertions(+), 7 deletions(-) diff --git a/dom/icc/IccManager.cpp b/dom/icc/IccManager.cpp index 31e6c269cfb..90115c058fd 100644 --- a/dom/icc/IccManager.cpp +++ b/dom/icc/IccManager.cpp @@ -13,6 +13,7 @@ // Service instantiation #include "ipc/IccIPCService.h" #if defined(MOZ_WIDGET_GONK) && defined(MOZ_B2G_RIL) +// TODO: Bug 815526, deprecate RILContentHelper. #include "nsIRadioInterfaceLayer.h" #include "nsRadioInterfaceLayer.h" #include "nsIGonkIccService.h" @@ -147,6 +148,7 @@ NS_CreateIccService() service = new mozilla::dom::icc::IccIPCService(); #if defined(MOZ_WIDGET_GONK) && defined(MOZ_B2G_RIL) } else { + // TODO: Bug 815526, deprecate RILContentHelper. nsCOMPtr ril = do_GetService(NS_RADIOINTERFACELAYER_CONTRACTID); nsCOMPtr ril_new(do_QueryInterface(ril)); diff --git a/dom/icc/interfaces/moz.build b/dom/icc/interfaces/moz.build index b95992c5919..9c5a1fa6435 100644 --- a/dom/icc/interfaces/moz.build +++ b/dom/icc/interfaces/moz.build @@ -6,7 +6,7 @@ XPIDL_SOURCES += [ 'nsIIccInfo.idl', - 'nsIIccProvider.idl', + 'nsIIccProvider.idl', # TODO: Bug 815526, deprecate RILContentHelper. 'nsIIccService.idl', ] diff --git a/dom/system/gonk/RILContentHelper.manifest b/dom/system/gonk/RILContentHelper.manifest index fbfb1a1f64b..c9a871ba583 100644 --- a/dom/system/gonk/RILContentHelper.manifest +++ b/dom/system/gonk/RILContentHelper.manifest @@ -13,6 +13,8 @@ # limitations under the License. # RILContentHelper.js +# TODO: Bug 815526, deprecate RILContentHelper: +# To be removed from b2g/installer/package-manifest.in as well. component {472816e1-1fd6-4405-996c-806f9ea68174} RILContentHelper.js contract @mozilla.org/ril/content-helper;1 {472816e1-1fd6-4405-996c-806f9ea68174} category profile-after-change RILContentHelper @mozilla.org/ril/content-helper;1 diff --git a/dom/system/gonk/RadioInterfaceLayer.js b/dom/system/gonk/RadioInterfaceLayer.js index 6242e7a4dfe..908d78c2105 100644 --- a/dom/system/gonk/RadioInterfaceLayer.js +++ b/dom/system/gonk/RadioInterfaceLayer.js @@ -87,6 +87,7 @@ const NETWORK_TYPE_MOBILE_SUPL = Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_SUPL const NETWORK_TYPE_MOBILE_IMS = Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_IMS; const NETWORK_TYPE_MOBILE_DUN = Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_DUN; +// TODO: Bug 815526, deprecate RILContentHelper. const RIL_IPC_ICCMANAGER_MSG_NAMES = [ "RIL:GetRilContext", "RIL:SendStkResponse", @@ -181,6 +182,7 @@ XPCOMUtils.defineLazyGetter(this, "gStkCmdFactory", function() { return stk.StkProactiveCmdFactory; }); +// TODO: Bug 815526, deprecate RILContentHelper. XPCOMUtils.defineLazyGetter(this, "gMessageManager", function() { return { QueryInterface: XPCOMUtils.generateQI([Ci.nsIMessageListener, @@ -1407,7 +1409,7 @@ function RadioInterfaceLayer() { Services.obs.addObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false); Services.prefs.addObserver(kPrefRilDebuggingEnabled, this, false); - gMessageManager.init(this); + gMessageManager.init(this); // TODO: Bug 815526, deprecate RILContentHelper. gRadioEnabledController.init(this); gDataConnectionManager.init(this); } @@ -1419,7 +1421,7 @@ RadioInterfaceLayer.prototype = { interfaces: [Ci.nsIRadioInterfaceLayer]}), QueryInterface: XPCOMUtils.generateQI([Ci.nsIRadioInterfaceLayer, - Ci.nsIRadioInterfaceLayer_new, + Ci.nsIRadioInterfaceLayer_new, // TODO: Bug 815526, deprecate RILContentHelper. Ci.nsIObserver]), /** @@ -1661,6 +1663,7 @@ function RadioInterface(aClientId, aWorkerMessenger) { this.clientId = aClientId; this.workerMessenger = { send: aWorkerMessenger.send.bind(aWorkerMessenger, aClientId), + // TODO: Bug 815526, deprecate RILContentHelper. sendWithIPCMessage: aWorkerMessenger.sendWithIPCMessage.bind(aWorkerMessenger, aClientId), }; @@ -1771,6 +1774,8 @@ RadioInterface.prototype = { /** * Process a message from the content process. + * + * TODO: Bug 815526, deprecate RILContentHelper */ receiveMessage: function(msg) { switch (msg.name) { @@ -1926,6 +1931,7 @@ RadioInterface.prototype = { gRadioEnabledController.receiveCardState(this.clientId); gIccService.notifyCardStateChanged(this.clientId, this.rilContext.cardState); + // TODO: Bug 815526, deprecate RILContentHelper. gMessageManager.sendIccMessage("RIL:CardStateChanged", this.clientId, message); break; @@ -1955,6 +1961,7 @@ RadioInterface.prototype = { this.handleStkProactiveCommand(message); break; case "stksessionend": + // TODO: Bug 815526, deprecate RILContentHelper. gMessageManager.sendIccMessage("RIL:StkSessionEnd", this.clientId, null); break; case "cdma-info-rec-received": @@ -1970,6 +1977,7 @@ RadioInterface.prototype = { // and not compared. E.g., if the mvnoData passed is '310260x10xxxxxx', // then the function returns true only if imsi has the same first 6 digits, // 8th and 9th digit. + // TODO: Bug 815526, deprecate RILContentHelper. isImsiMatches: function(mvnoData) { let imsi = this.rilContext.imsi; @@ -1987,6 +1995,7 @@ RadioInterface.prototype = { return true; }, + // TODO: Bug 815526, deprecate RILContentHelper. matchMvno: function(target, message) { if (DEBUG) this.debug("matchMvno: " + JSON.stringify(message)); @@ -2224,6 +2233,8 @@ RadioInterface.prototype = { handleIccInfoChange: function(message) { let oldSpn = this.rilContext.iccInfo ? this.rilContext.iccInfo.spn : null; + // TODO: Bug 815526, deprecate RILContentHelper: + // Move the logic of updating iccInfo to IccService.js. if (!message || !message.iccid) { // If iccInfo is already `null`, don't have to clear it and send // RIL:IccInfoChanged. @@ -2253,6 +2264,7 @@ RadioInterface.prototype = { // RIL:IccInfoChanged corresponds to a DOM event that gets fired only // when iccInfo has changed. + // TODO: Bug 815526, deprecate RILContentHelper. gMessageManager.sendIccMessage("RIL:IccInfoChanged", this.clientId, message.iccid ? message : null); @@ -2284,6 +2296,7 @@ RadioInterface.prototype = { .notifyStkProactiveCommand(iccId, gStkCmdFactory.createCommand(message)); } + // TODO: Bug 815526, deprecate RILContentHelper. gMessageManager.sendIccMessage("RIL:StkCommand", this.clientId, message); }, diff --git a/dom/system/gonk/moz.build b/dom/system/gonk/moz.build index 1a88c4c2215..c52f5149ee5 100644 --- a/dom/system/gonk/moz.build +++ b/dom/system/gonk/moz.build @@ -89,8 +89,8 @@ if CONFIG['MOZ_B2G_RIL']: 'nsIRadioInterfaceLayer.idl', ] EXTRA_COMPONENTS += [ - 'RILContentHelper.js', - 'RILContentHelper.manifest', + 'RILContentHelper.js', # TODO: Bug 815526, deprecate RILContentHelper. + 'RILContentHelper.manifest', # TODO: Bug 815526, deprecate RILContentHelper. 'RILSystemMessengerHelper.js', 'RILSystemMessengerHelper.manifest', ] diff --git a/dom/system/gonk/tests/marionette/test_ril_code_quality.py b/dom/system/gonk/tests/marionette/test_ril_code_quality.py index f9221391f54..1002b99486f 100644 --- a/dom/system/gonk/tests/marionette/test_ril_code_quality.py +++ b/dom/system/gonk/tests/marionette/test_ril_code_quality.py @@ -2,7 +2,7 @@ The test performs the static code analysis check by JSHint. Target js files: -- RILContentHelper.js +- RILContentHelper.js TODO: Bug 815526, deprecate RILContentHelper. - RadioInterfaceLayer.js - ril_worker.js - ril_consts.js @@ -100,7 +100,7 @@ class ResourceUriFileReader: URI_PREFIX = 'resource://gre/' URI_PATH = { - 'RILContentHelper.js': 'components/RILContentHelper.js', + 'RILContentHelper.js': 'components/RILContentHelper.js', #TODO: Bug 815526, deprecate RILContentHelper. 'RadioInterfaceLayer.js': 'components/RadioInterfaceLayer.js', 'ril_worker.js': 'modules/ril_worker.js', 'ril_consts.js': 'modules/ril_consts.js', @@ -354,6 +354,7 @@ class TestRILCodeQuality(MarionetteTestCase): def tearDown(self): MarionetteTestCase.tearDown(self) + # TODO: Bug 815526, deprecate RILContentHelper. def test_RILContentHelper(self): self._check('RILContentHelper.js')