diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index 6656c8c9f8d..ec91418d73e 100644 --- a/b2g/app/b2g.js +++ b/b2g/app/b2g.js @@ -430,7 +430,7 @@ pref("services.push.requestTimeout", 10000); pref("services.push.udp.wakeupEnabled", true); // NetworkStats -#ifdef MOZ_B2G_RIL +#ifdef MOZ_WIDGET_GONK pref("dom.mozNetworkStats.enabled", true); pref("dom.webapps.firstRunWithSIM", true); #endif diff --git a/b2g/chrome/content/shell.js b/b2g/chrome/content/shell.js index e80e828aa7f..9c37aa716cd 100644 --- a/b2g/chrome/content/shell.js +++ b/b2g/chrome/content/shell.js @@ -18,7 +18,7 @@ Cu.import("resource://gre/modules/AppsUtils.jsm"); Cu.import('resource://gre/modules/UserAgentOverrides.jsm'); Cu.import('resource://gre/modules/Keyboard.jsm'); Cu.import('resource://gre/modules/ErrorPage.jsm'); -#ifdef MOZ_B2G_RIL +#ifdef MOZ_WIDGET_GONK Cu.import('resource://gre/modules/NetworkStatsService.jsm'); #endif @@ -611,7 +611,7 @@ var shell = { this.sendEvent(window, 'ContentStart'); -#ifdef MOZ_B2G_RIL +#ifdef MOZ_WIDGET_GONK Cu.import('resource://gre/modules/OperatorApps.jsm'); #endif diff --git a/b2g/installer/package-manifest.in b/b2g/installer/package-manifest.in index 94a072219d9..39bd1ee846f 100644 --- a/b2g/installer/package-manifest.in +++ b/b2g/installer/package-manifest.in @@ -164,10 +164,12 @@ @BINPATH@/components/dom_audiochannel.xpt @BINPATH@/components/dom_base.xpt @BINPATH@/components/dom_system.xpt -#ifdef MOZ_B2G_RIL -@BINPATH@/components/dom_voicemail.xpt +#ifdef MOZ_WIDGET_GONK @BINPATH@/components/dom_wifi.xpt @BINPATH@/components/dom_system_gonk.xpt +#endif +#ifdef MOZ_B2G_RIL +@BINPATH@/components/dom_voicemail.xpt @BINPATH@/components/dom_icc.xpt @BINPATH@/components/dom_cellbroadcast.xpt @BINPATH@/components/dom_wappush.xpt @@ -400,11 +402,31 @@ @BINPATH@/components/nsSidebar.manifest @BINPATH@/components/nsSidebar.js +; WiFi, NetworkManager, NetworkStats +#ifdef MOZ_WIDGET_GONK +@BINPATH@/components/DOMWifiManager.js +@BINPATH@/components/DOMWifiManager.manifest +@BINPATH@/components/NetworkInterfaceListService.js +@BINPATH@/components/NetworkInterfaceListService.manifest +@BINPATH@/components/NetworkManager.js +@BINPATH@/components/NetworkManager.manifest +@BINPATH@/components/NetworkStatsManager.js +@BINPATH@/components/NetworkStatsManager.manifest +@BINPATH@/components/NetworkStatsServiceProxy.js +@BINPATH@/components/NetworkStatsServiceProxy.manifest +@BINPATH@/components/WifiWorker.js +@BINPATH@/components/WifiWorker.manifest +#endif // MOZ_WIDGET_GONK + +; RIL #if defined(MOZ_WIDGET_GONK) && defined(MOZ_B2G_RIL) @BINPATH@/components/MmsService.js @BINPATH@/components/MmsService.manifest @BINPATH@/components/MobileMessageDatabaseService.js @BINPATH@/components/MobileMessageDatabaseService.manifest +@BINPATH@/components/RadioInterfaceLayer.js +@BINPATH@/components/RadioInterfaceLayer.manifest +@BINPATH@/components/RILContentHelper.js @BINPATH@/components/TelephonyProvider.js @BINPATH@/components/TelephonyProvider.manifest #endif // MOZ_WIDGET_GONK && MOZ_B2G_RIL @@ -474,23 +496,6 @@ @BINPATH@/components/webvtt.xpt @BINPATH@/components/WebVTT.manifest @BINPATH@/components/WebVTTParserWrapper.js -#ifdef MOZ_B2G_RIL -@BINPATH@/components/NetworkManager.manifest -@BINPATH@/components/NetworkManager.js -@BINPATH@/components/RadioInterfaceLayer.manifest -@BINPATH@/components/RadioInterfaceLayer.js -@BINPATH@/components/RILContentHelper.js -@BINPATH@/components/WifiWorker.js -@BINPATH@/components/WifiWorker.manifest -@BINPATH@/components/DOMWifiManager.js -@BINPATH@/components/DOMWifiManager.manifest -@BINPATH@/components/NetworkStatsManager.js -@BINPATH@/components/NetworkStatsManager.manifest -@BINPATH@/components/NetworkInterfaceListService.manifest -@BINPATH@/components/NetworkInterfaceListService.js -@BINPATH@/components/NetworkStatsServiceProxy.manifest -@BINPATH@/components/NetworkStatsServiceProxy.js -#endif #ifdef MOZ_ENABLE_DBUS @BINPATH@/components/@DLL_PREFIX@dbusservice@DLL_SUFFIX@ #endif diff --git a/content/events/src/Makefile.in b/content/events/src/Makefile.in index 8151c59d263..ff68d3f060e 100644 --- a/content/events/src/Makefile.in +++ b/content/events/src/Makefile.in @@ -18,7 +18,7 @@ LOCAL_INCLUDES += \ -I$(srcdir)/../../../layout/xul/tree/ \ $(NULL) -ifdef MOZ_B2G_RIL +ifeq (gonk,$(MOZ_WIDGET_TOOLKIT)) LOCAL_INCLUDES += \ -I$(srcdir)/../../../dom/wifi \ $(NULL) diff --git a/dom/base/moz.build b/dom/base/moz.build index f2bdb13a288..7855232543e 100644 --- a/dom/base/moz.build +++ b/dom/base/moz.build @@ -143,7 +143,7 @@ LOCAL_INCLUDES += [ '/layout/xul/base/src', ] -if CONFIG['MOZ_B2G_RIL']: +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': LOCAL_INCLUDES += [ '../fmradio', '../system/gonk', diff --git a/dom/moz.build b/dom/moz.build index 546df28c830..d0b32a2f080 100644 --- a/dom/moz.build +++ b/dom/moz.build @@ -80,9 +80,11 @@ PARALLEL_DIRS += [ if CONFIG['OS_ARCH'] == 'WINNT': PARALLEL_DIRS += ['plugins/ipc/hangui'] +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': + PARALLEL_DIRS += ['wifi'] + if CONFIG['MOZ_B2G_RIL']: PARALLEL_DIRS += [ - 'wifi', 'icc', 'cellbroadcast', 'voicemail', diff --git a/dom/network/interfaces/moz.build b/dom/network/interfaces/moz.build index 23d8baa07e5..48988202d26 100644 --- a/dom/network/interfaces/moz.build +++ b/dom/network/interfaces/moz.build @@ -22,10 +22,14 @@ if CONFIG['MOZ_B2G_RIL']: 'nsIDOMMobileConnection.idl', 'nsIDOMMozEmergencyCbModeEvent.idl', 'nsIDOMMozOtaStatusEvent.idl', - 'nsIDOMNetworkStats.idl', - 'nsIDOMNetworkStatsManager.idl', 'nsIDOMUSSDReceivedEvent.idl', 'nsIMobileConnectionProvider.idl', + ] + +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': + XPIDL_SOURCES += [ + 'nsIDOMNetworkStats.idl', + 'nsIDOMNetworkStatsManager.idl', 'nsINetworkStatsServiceProxy.idl', ] diff --git a/dom/network/src/moz.build b/dom/network/src/moz.build index e945b41d134..a18122a6d08 100644 --- a/dom/network/src/moz.build +++ b/dom/network/src/moz.build @@ -28,6 +28,8 @@ if CONFIG['MOZ_B2G_RIL']: SOURCES += [ 'MobileConnection.cpp', ] + +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': EXTRA_JS_MODULES = [ 'NetworkStatsDB.jsm', 'NetworkStatsService.jsm', @@ -43,7 +45,7 @@ EXTRA_PP_COMPONENTS += [ 'TCPSocket.js', ] -if CONFIG['MOZ_B2G_RIL']: +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': EXTRA_COMPONENTS += [ 'NetworkStatsManager.js', 'NetworkStatsManager.manifest', diff --git a/dom/network/tests/Makefile.in b/dom/network/tests/Makefile.in index 52fcdb65ce1..cc1bd18cacb 100644 --- a/dom/network/tests/Makefile.in +++ b/dom/network/tests/Makefile.in @@ -9,7 +9,7 @@ MOCHITEST_FILES = \ test_tcpsocket_enabled_with_perm.html \ $(NULL) -ifdef MOZ_B2G_RIL +ifeq (gonk,$(MOZ_WIDGET_TOOLKIT)) MOCHITEST_FILES = \ test_networkstats_basics.html \ test_networkstats_disabled.html \ diff --git a/dom/system/gonk/NetworkManager.js b/dom/system/gonk/NetworkManager.js index 291a20736f5..b2c30e19595 100644 --- a/dom/system/gonk/NetworkManager.js +++ b/dom/system/gonk/NetworkManager.js @@ -133,8 +133,10 @@ function defineLazyRegExp(obj, name, pattern) { function NetworkManager() { this.networkInterfaces = {}; Services.obs.addObserver(this, TOPIC_INTERFACE_STATE_CHANGED, true); +#ifdef MOZ_B2G_RIL Services.obs.addObserver(this, TOPIC_INTERFACE_REGISTERED, true); Services.obs.addObserver(this, TOPIC_INTERFACE_UNREGISTERED, true); +#endif Services.obs.addObserver(this, TOPIC_XPCOM_SHUTDOWN, false); Services.obs.addObserver(this, TOPIC_MOZSETTINGS_CHANGED, false); @@ -229,6 +231,7 @@ NetworkManager.prototype = { debug("Network " + network.name + " changed state to " + network.state); switch (network.state) { case Ci.nsINetworkInterface.NETWORK_STATE_CONNECTED: +#ifdef MOZ_B2G_RIL // Add host route for data calls if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE || network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS || @@ -238,16 +241,19 @@ NetworkManager.prototype = { } // Add extra host route. For example, mms proxy or mmsc. this.setExtraHostRoute(network); +#endif // Remove pre-created default route and let setAndConfigureActive() // to set default route only on preferred network this.removeDefaultRoute(network.name); this.setAndConfigureActive(); +#ifdef MOZ_B2G_RIL // Update data connection when Wifi connected/disconnected if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_WIFI) { for (let i = 0; i < this.mRIL.numRadioInterfaces; i++) { this.mRIL.getRadioInterface(i).updateRILNetworkInterface(); } } +#endif this.onConnectionChanged(network); @@ -255,6 +261,7 @@ NetworkManager.prototype = { CaptivePortalDetectionHelper.notify(CaptivePortalDetectionHelper.EVENT_CONNECT, this.active); break; case Ci.nsINetworkInterface.NETWORK_STATE_DISCONNECTED: +#ifdef MOZ_B2G_RIL // Remove host route for data calls if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE || network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS || @@ -263,24 +270,30 @@ NetworkManager.prototype = { } // Remove extra host route. For example, mms proxy or mmsc. this.removeExtraHostRoute(network); +#endif // Remove routing table in /proc/net/route if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_WIFI) { this.resetRoutingTable(network); +#ifdef MOZ_B2G_RIL } else if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE) { this.removeDefaultRoute(network.name); +#endif } // Abort ongoing captive portal detection on the wifi interface CaptivePortalDetectionHelper.notify(CaptivePortalDetectionHelper.EVENT_DISCONNECT, network); this.setAndConfigureActive(); +#ifdef MOZ_B2G_RIL // Update data connection when Wifi connected/disconnected if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_WIFI) { for (let i = 0; i < this.mRIL.numRadioInterfaces; i++) { this.mRIL.getRadioInterface(i).updateRILNetworkInterface(); } } +#endif break; } break; +#ifdef MOZ_B2G_RIL case TOPIC_INTERFACE_REGISTERED: let regNetwork = subject.QueryInterface(Ci.nsINetworkInterface); // Add extra host route. For example, mms proxy or mmsc. @@ -291,6 +304,7 @@ NetworkManager.prototype = { // Remove extra host route. For example, mms proxy or mmsc. this.removeExtraHostRoute(unregNetwork); break; +#endif case TOPIC_MOZSETTINGS_CHANGED: let setting = JSON.parse(data); this.handle(setting.key, setting.value); @@ -303,8 +317,10 @@ NetworkManager.prototype = { case TOPIC_XPCOM_SHUTDOWN: Services.obs.removeObserver(this, TOPIC_XPCOM_SHUTDOWN); Services.obs.removeObserver(this, TOPIC_MOZSETTINGS_CHANGED); +#ifdef MOZ_B2G_RIL Services.obs.removeObserver(this, TOPIC_INTERFACE_REGISTERED); Services.obs.removeObserver(this, TOPIC_INTERFACE_UNREGISTERED); +#endif Services.obs.removeObserver(this, TOPIC_INTERFACE_STATE_CHANGED); break; } @@ -313,15 +329,19 @@ NetworkManager.prototype = { receiveMessage: function receiveMessage(aMsg) { switch (aMsg.name) { case "NetworkInterfaceList:ListInterface": { +#ifdef MOZ_B2G_RIL let excludeMms = aMsg.json.exculdeMms; let excludeSupl = aMsg.json.exculdeSupl; +#endif let interfaces = []; for each (let i in this.networkInterfaces) { +#ifdef MOZ_B2G_RIL if ((i.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS && excludeMms) || (i.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_SUPL && excludeSupl)) { continue; } +#endif interfaces.push({ state: i.state, type: i.type, @@ -353,12 +373,14 @@ NetworkManager.prototype = { Cr.NS_ERROR_INVALID_ARG); } this.networkInterfaces[network.name] = network; +#ifdef MOZ_B2G_RIL // Add host route for data calls if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE || network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS || network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_SUPL) { this.addHostRoute(network); } +#endif // Remove pre-created default route and let setAndConfigureActive() // to set default route only on preferred network this.removeDefaultRoute(network.name); @@ -377,12 +399,14 @@ NetworkManager.prototype = { Cr.NS_ERROR_INVALID_ARG); } delete this.networkInterfaces[network.name]; +#ifdef MOZ_B2G_RIL // Remove host route for data calls if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE || network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS || network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_SUPL) { this.removeHostRoute(network); } +#endif this.setAndConfigureActive(); Services.obs.notifyObservers(network, TOPIC_INTERFACE_UNREGISTERED, null); debug("Network '" + network.name + "' unregistered."); @@ -397,8 +421,12 @@ NetworkManager.prototype = { return this._preferredNetworkType; }, set preferredNetworkType(val) { +#ifdef MOZ_B2G_RIL if ([Ci.nsINetworkInterface.NETWORK_TYPE_WIFI, Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE].indexOf(val) == -1) { +#else + if (val != Ci.nsINetworkInterface.NETWORK_TYPE_WIFI) { +#endif throw "Invalid network type"; } this._preferredNetworkType = val; @@ -411,10 +439,12 @@ NetworkManager.prototype = { _activeInfo: null, overrideActive: function overrideActive(network) { +#ifdef MOZ_B2G_RIL if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS || network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_SUPL) { throw "Invalid network type"; } +#endif this._overriddenActive = network; this.setAndConfigureActive(); }, @@ -486,6 +516,7 @@ NetworkManager.prototype = { } }, +#ifdef MOZ_B2G_RIL setExtraHostRoute: function setExtraHostRoute(network) { if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS) { debug("Network '" + network.name + "' registered, adding mmsproxy and/or mmsc route"); @@ -505,6 +536,7 @@ NetworkManager.prototype = { this.removeHostRouteWithResolve(network, mmsHosts); } }, +#endif // MOZ_B2G_RIL /** * Determine the active interface and configure it. @@ -512,7 +544,6 @@ NetworkManager.prototype = { setAndConfigureActive: function setAndConfigureActive() { debug("Evaluating whether active network needs to be changed."); let oldActive = this.active; - let defaultDataNetwork; if (this._overriddenActive) { debug("We have an override for the active network: " + @@ -538,13 +569,18 @@ NetworkManager.prototype = { // Find a suitable network interface to activate. this.active = null; this._activeInfo = Object.create(null); +#ifdef MOZ_B2G_RIL + let defaultDataNetwork; +#endif for each (let network in this.networkInterfaces) { if (network.state != Ci.nsINetworkInterface.NETWORK_STATE_CONNECTED) { continue; } +#ifdef MOZ_B2G_RIL if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE) { defaultDataNetwork = network; } +#endif this.active = network; this._activeInfo = {name:network.name, ip:network.ip, netmask:network.netmask}; if (network.type == this.preferredNetworkType) { @@ -553,6 +589,7 @@ NetworkManager.prototype = { } } if (this.active) { +#ifdef MOZ_B2G_RIL // Give higher priority to default data APN than seconary APN. // If default data APN is not connected, we still set default route // and DNS on seconary APN. @@ -567,8 +604,11 @@ NetworkManager.prototype = { this.active.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_SUPL) { this.setDNS(this.active); } else { +#endif // MOZ_B2G_RIL this.setDefaultRouteAndDNS(oldActive); +#ifdef MOZ_B2G_RIL } +#endif if (this.active != oldActive) { Services.obs.notifyObservers(this.active, TOPIC_ACTIVE_CHANGED, null); } @@ -593,6 +633,7 @@ NetworkManager.prototype = { this.worker.postMessage(options); }, +#ifdef MOZ_B2G_RIL setDNS: function setDNS(networkInterface) { debug("Going DNS to " + networkInterface.name); let options = { @@ -603,6 +644,7 @@ NetworkManager.prototype = { }; this.worker.postMessage(options); }, +#endif setDefaultRouteAndDNS: function setDefaultRouteAndDNS(oldInterface) { debug("Going to change route and DNS to " + this.active.name); @@ -627,6 +669,7 @@ NetworkManager.prototype = { this.worker.postMessage(options); }, +#ifdef MOZ_B2G_RIL addHostRoute: function addHostRoute(network) { debug("Going to add host route on " + network.name); let options = { @@ -706,6 +749,7 @@ NetworkManager.prototype = { }; this.worker.postMessage(options); }, +#endif // MOZ_B2G_RIL setNetworkProxy: function setNetworkProxy(network) { try { @@ -1224,9 +1268,11 @@ let CaptivePortalDetectionHelper = (function() { }; }()); +#ifdef MOZ_B2G_RIL XPCOMUtils.defineLazyServiceGetter(NetworkManager.prototype, "mRIL", "@mozilla.org/ril;1", "nsIRadioInterfaceLayer"); +#endif this.NSGetFactory = XPCOMUtils.generateNSGetFactory([NetworkManager]); diff --git a/dom/system/gonk/SystemWorkerManager.cpp b/dom/system/gonk/SystemWorkerManager.cpp index a3dd23cef4b..637760689d3 100644 --- a/dom/system/gonk/SystemWorkerManager.cpp +++ b/dom/system/gonk/SystemWorkerManager.cpp @@ -24,13 +24,13 @@ #include "jsfriendapi.h" #include "mozilla/dom/workers/Workers.h" -#ifdef MOZ_WIDGET_GONK #include "mozilla/ipc/Netd.h" #include "AutoMounter.h" #include "TimeZoneSettingObserver.h" #include "AudioManager.h" -#endif +#ifdef MOZ_B2G_RIL #include "mozilla/ipc/Ril.h" +#endif #include "mozilla/ipc/KeyStore.h" #include "nsIObserverService.h" #include "nsCxPusher.h" @@ -44,9 +44,7 @@ USING_WORKERS_NAMESPACE using namespace mozilla::dom::gonk; using namespace mozilla::ipc; -#ifdef MOZ_WIDGET_GONK using namespace mozilla::system; -#endif #define NS_NETWORKMANAGER_CID \ { 0x33901e46, 0x33b8, 0x11e1, \ @@ -60,107 +58,6 @@ NS_DEFINE_CID(kNetworkManagerCID, NS_NETWORKMANAGER_CID); // Doesn't carry a reference, we're owned by services. SystemWorkerManager *gInstance = nullptr; -class ConnectWorkerToRIL : public WorkerTask -{ -public: - ConnectWorkerToRIL() - { } - - virtual bool RunTask(JSContext *aCx); -}; - -class SendRilSocketDataTask : public nsRunnable -{ -public: - SendRilSocketDataTask(unsigned long aClientId, - UnixSocketRawData *aRawData) - : mRawData(aRawData) - , mClientId(aClientId) - { } - - NS_IMETHOD Run() - { - MOZ_ASSERT(NS_IsMainThread()); - SystemWorkerManager::SendRilRawData(mClientId, mRawData); - return NS_OK; - } - -private: - UnixSocketRawData *mRawData; - unsigned long mClientId; -}; - -bool -PostToRIL(JSContext *cx, unsigned argc, JS::Value *vp) -{ - NS_ASSERTION(!NS_IsMainThread(), "Expecting to be on the worker thread"); - - if (argc != 2) { - JS_ReportError(cx, "Expecting two arguments with the RIL message"); - return false; - } - - JS::Value cv = JS_ARGV(cx, vp)[0]; - int clientId = cv.toInt32(); - - JS::Value v = JS_ARGV(cx, vp)[1]; - - JSAutoByteString abs; - void *data; - size_t size; - if (JSVAL_IS_STRING(v)) { - JSString *str = JSVAL_TO_STRING(v); - if (!abs.encodeUtf8(cx, str)) { - return false; - } - - data = abs.ptr(); - size = abs.length(); - } else if (!JSVAL_IS_PRIMITIVE(v)) { - JSObject *obj = JSVAL_TO_OBJECT(v); - if (!JS_IsTypedArrayObject(obj)) { - JS_ReportError(cx, "Object passed in wasn't a typed array"); - return false; - } - - uint32_t type = JS_GetArrayBufferViewType(obj); - if (type != js::ArrayBufferView::TYPE_INT8 && - type != js::ArrayBufferView::TYPE_UINT8 && - type != js::ArrayBufferView::TYPE_UINT8_CLAMPED) { - JS_ReportError(cx, "Typed array data is not octets"); - return false; - } - - size = JS_GetTypedArrayByteLength(obj); - data = JS_GetArrayBufferViewData(obj); - } else { - JS_ReportError(cx, - "Incorrect argument. Expecting a string or a typed array"); - return false; - } - - UnixSocketRawData* raw = new UnixSocketRawData(data, size); - - nsRefPtr task = new SendRilSocketDataTask(clientId, raw); - NS_DispatchToMainThread(task); - return true; -} - -bool -ConnectWorkerToRIL::RunTask(JSContext *aCx) -{ - // Set up the postRILMessage on the function for worker -> RIL thread - // communication. - NS_ASSERTION(!NS_IsMainThread(), "Expecting to be on the worker thread"); - NS_ASSERTION(!JS_IsRunning(aCx), "Are we being called somehow?"); - JSObject *workerGlobal = JS::CurrentGlobalOrNull(aCx); - - return !!JS_DefineFunction(aCx, workerGlobal, "postRILMessage", PostToRIL, 1, - 0); -} - -#ifdef MOZ_WIDGET_GONK - bool DoNetdCommand(JSContext *cx, unsigned argc, JS::Value *vp) { @@ -306,8 +203,6 @@ NetdReceiver::DispatchNetdEvent::RunTask(JSContext *aCx) argv, argv); } -#endif // MOZ_WIDGET_GONK - } // anonymous namespace SystemWorkerManager::SystemWorkerManager() @@ -345,14 +240,12 @@ SystemWorkerManager::Init() InitKeyStore(cx); -#ifdef MOZ_WIDGET_GONK InitAutoMounter(); InitializeTimeZoneSettingObserver(); rv = InitNetd(cx); NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr audioManager = do_GetService(NS_AUDIOMANAGER_CONTRACTID); -#endif nsCOMPtr obs = mozilla::services::GetObserverService(); if (!obs) { @@ -376,21 +269,14 @@ SystemWorkerManager::Shutdown() mShutdown = true; -#ifdef MOZ_WIDGET_GONK ShutdownAutoMounter(); + +#ifdef MOZ_B2G_RIL + RilConsumer::Shutdown(); #endif - for (unsigned long i = 0; i < mRilConsumers.Length(); i++) { - if (mRilConsumers[i]) { - mRilConsumers[i]->Shutdown(); - mRilConsumers[i] = nullptr; - } - } - -#ifdef MOZ_WIDGET_GONK StopNetd(); mNetdWorker = nullptr; -#endif nsCOMPtr wifi(do_QueryInterface(mWifiWorker)); if (wifi) { @@ -433,20 +319,6 @@ SystemWorkerManager::GetInterfaceRequestor() return gInstance; } -bool -SystemWorkerManager::SendRilRawData(unsigned long aClientId, - UnixSocketRawData* aRaw) -{ - if ((gInstance->mRilConsumers.Length() <= aClientId) || - !gInstance->mRilConsumers[aClientId] || - gInstance->mRilConsumers[aClientId]->GetConnectionStatus() != SOCKET_CONNECTED) { - // Probably shuting down. - delete aRaw; - return true; - } - return gInstance->mRilConsumers[aClientId]->SendSocketData(aRaw); -} - NS_IMETHODIMP SystemWorkerManager::GetInterface(const nsIID &aIID, void **aResult) { @@ -457,12 +329,10 @@ SystemWorkerManager::GetInterface(const nsIID &aIID, void **aResult) reinterpret_cast(aResult)); } -#ifdef MOZ_WIDGET_GONK if (aIID.Equals(NS_GET_IID(nsINetworkManager))) { return CallQueryInterface(mNetdWorker, reinterpret_cast(aResult)); } -#endif NS_WARNING("Got nothing for the requested IID!"); return NS_ERROR_NO_INTERFACE; @@ -473,15 +343,11 @@ SystemWorkerManager::RegisterRilWorker(unsigned int aClientId, const JS::Value& aWorker, JSContext *aCx) { +#ifndef MOZ_B2G_RIL + return NS_ERROR_NOT_IMPLEMENTED; +#else NS_ENSURE_TRUE(!JSVAL_IS_PRIMITIVE(aWorker), NS_ERROR_UNEXPECTED); - mRilConsumers.EnsureLengthAtLeast(aClientId + 1); - - if (mRilConsumers[aClientId]) { - NS_WARNING("RilConsumer already registered"); - return NS_ERROR_FAILURE; - } - JSAutoCompartment ac(aCx, JSVAL_TO_OBJECT(aWorker)); WorkerCrossThreadDispatcher *wctd = @@ -491,18 +357,10 @@ SystemWorkerManager::RegisterRilWorker(unsigned int aClientId, return NS_ERROR_FAILURE; } - nsRefPtr connection = new ConnectWorkerToRIL(); - if (!wctd->PostTask(connection)) { - NS_WARNING("Failed to connect worker to ril"); - return NS_ERROR_UNEXPECTED; - } - - // Now that we're set up, connect ourselves to the RIL thread. - mRilConsumers[aClientId] = new RilConsumer(aClientId, wctd); - return NS_OK; + return RilConsumer::Register(aClientId, wctd); +#endif // MOZ_B2G_RIL } -#ifdef MOZ_WIDGET_GONK nsresult SystemWorkerManager::InitNetd(JSContext *cx) { @@ -535,7 +393,6 @@ SystemWorkerManager::InitNetd(JSContext *cx) mNetdWorker = worker; return NS_OK; } -#endif nsresult SystemWorkerManager::InitWifi(JSContext *cx) diff --git a/dom/system/gonk/SystemWorkerManager.h b/dom/system/gonk/SystemWorkerManager.h index 0198e6584b0..1562a80eb75 100644 --- a/dom/system/gonk/SystemWorkerManager.h +++ b/dom/system/gonk/SystemWorkerManager.h @@ -23,18 +23,13 @@ #include "nsIObserver.h" #include "nsAutoPtr.h" #include "nsCOMPtr.h" -#include "nsDebug.h" -#include "nsDOMEventTargetHelper.h" -#include "nsString.h" -#include "nsTArray.h" +#include "nsXULAppAPI.h" // For XRE_GetProcessType class nsIWorkerHolder; namespace mozilla { namespace ipc { - class RilConsumer; - class UnixSocketRawData; class KeyStore; } @@ -60,25 +55,17 @@ public: static nsIInterfaceRequestor* GetInterfaceRequestor(); - static bool SendRilRawData(unsigned long aClientId, - ipc::UnixSocketRawData* aRaw); - private: SystemWorkerManager(); ~SystemWorkerManager(); -#ifdef MOZ_WIDGET_GONK nsresult InitNetd(JSContext *cx); -#endif nsresult InitWifi(JSContext *cx); nsresult InitKeyStore(JSContext *cx); -#ifdef MOZ_WIDGET_GONK nsCOMPtr mNetdWorker; -#endif nsCOMPtr mWifiWorker; - nsTArray > mRilConsumers; nsRefPtr mKeyStore; bool mShutdown; diff --git a/dom/system/gonk/moz.build b/dom/system/gonk/moz.build index 2e5eebbec69..62691d77980 100644 --- a/dom/system/gonk/moz.build +++ b/dom/system/gonk/moz.build @@ -18,7 +18,6 @@ XPIDL_SOURCES += [ 'nsIAudioManager.idl', 'nsINetworkInterfaceListService.idl', 'nsINetworkManager.idl', - 'nsIRadioInterfaceLayer.idl', 'nsISystemWorkerManager.idl', 'nsIVolume.idl', 'nsIVolumeMountLock.idl', @@ -31,55 +30,61 @@ XPIDL_MODULE = 'dom_system_gonk' MODULE = 'dom' -if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': - EXPORTS += [ - 'GonkGPSGeolocationProvider.h', - 'nsVolume.h', - 'nsVolumeService.h', - ] - SOURCES += [ - 'AudioChannelManager.cpp', - 'AudioManager.cpp', - 'AutoMounter.cpp', - 'AutoMounterSetting.cpp', - 'GonkGPSGeolocationProvider.cpp', - 'nsVolume.cpp', - 'nsVolumeMountLock.cpp', - 'nsVolumeService.cpp', - 'nsVolumeStat.cpp', - 'OpenFileFinder.cpp', - 'TimeZoneSettingObserver.cpp', - 'Volume.cpp', - 'VolumeCommand.cpp', - 'VolumeManager.cpp', - 'VolumeServiceIOThread.cpp', - 'VolumeServiceTest.cpp', - ] +EXPORTS += [ + 'GonkGPSGeolocationProvider.h', + 'nsVolume.h', + 'nsVolumeService.h', +] +SOURCES += [ + 'AudioChannelManager.cpp', + 'AudioManager.cpp', + 'AutoMounter.cpp', + 'AutoMounterSetting.cpp', + 'GonkGPSGeolocationProvider.cpp', + 'nsVolume.cpp', + 'nsVolumeMountLock.cpp', + 'nsVolumeService.cpp', + 'nsVolumeStat.cpp', + 'OpenFileFinder.cpp', + 'SystemWorkerManager.cpp', + 'TimeZoneSettingObserver.cpp', + 'Volume.cpp', + 'VolumeCommand.cpp', + 'VolumeManager.cpp', + 'VolumeServiceIOThread.cpp', + 'VolumeServiceTest.cpp', +] if CONFIG['ENABLE_TESTS']: XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell.ini'] -SOURCES += [ - 'SystemWorkerManager.cpp', -] - EXTRA_COMPONENTS += [ 'NetworkInterfaceListService.js', 'NetworkInterfaceListService.manifest', - 'NetworkManager.js', 'NetworkManager.manifest', - 'RadioInterfaceLayer.js', - 'RadioInterfaceLayer.manifest', - 'RILContentHelper.js', ] - +EXTRA_PP_COMPONENTS += [ + 'NetworkManager.js', +] EXTRA_JS_MODULES += [ 'net_worker.js', - 'ril_consts.js', - 'ril_worker.js', 'systemlibs.js', ] +if CONFIG['MOZ_B2G_RIL']: + XPIDL_SOURCES += [ + 'nsIRadioInterfaceLayer.idl', + ] + EXTRA_COMPONENTS += [ + 'RadioInterfaceLayer.js', + 'RadioInterfaceLayer.manifest', + 'RILContentHelper.js', + ] + EXTRA_JS_MODULES += [ + 'ril_consts.js', + 'ril_worker.js', + ] + FAIL_ON_WARNINGS = True LIBXUL_LIBRARY = True diff --git a/dom/system/moz.build b/dom/system/moz.build index af8338848c9..8eaabb305fa 100644 --- a/dom/system/moz.build +++ b/dom/system/moz.build @@ -14,8 +14,7 @@ elif toolkit == 'cocoa': DIRS += ['mac'] elif toolkit == 'android': DIRS += ['android'] - -if CONFIG['MOZ_B2G_RIL']: +elif toolkit == 'gonk': DIRS += ['gonk'] TEST_DIRS += ['tests'] diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build index 0eb3127549d..147659dcafe 100644 --- a/dom/webidl/moz.build +++ b/dom/webidl/moz.build @@ -514,9 +514,13 @@ if CONFIG['MOZ_B2G_RIL']: 'MozStkCommandEvent.webidl', 'MozVoicemail.webidl', 'MozVoicemailEvent.webidl', + 'USSDReceivedEvent.webidl', + ] + +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': + WEBIDL_FILES += [ 'MozWifiConnectionInfoEvent.webidl', 'MozWifiStatusChangeEvent.webidl', - 'USSDReceivedEvent.webidl', ] if CONFIG['MOZ_WEBSPEECH']: diff --git a/ipc/moz.build b/ipc/moz.build index 7b9711ced12..1dc549316da 100644 --- a/ipc/moz.build +++ b/ipc/moz.build @@ -17,10 +17,10 @@ if CONFIG['MOZ_B2G_RIL']: if CONFIG['MOZ_B2G_BT_BLUEZ']: DIRS += ['dbus'] -if CONFIG['MOZ_B2G_RIL'] or CONFIG['MOZ_B2G_BT']: - DIRS += ['unixsocket', 'keystore'] +if CONFIG['MOZ_B2G_RIL'] or CONFIG['MOZ_B2G_BT'] or CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': + DIRS += ['unixsocket'] if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': - DIRS += ['netd'] + DIRS += ['netd', 'keystore'] TOOL_DIRS += ['app'] diff --git a/ipc/ril/Ril.cpp b/ipc/ril/Ril.cpp index 3dc8e0a8be8..c0bc05446f1 100644 --- a/ipc/ril/Ril.cpp +++ b/ipc/ril/Ril.cpp @@ -4,6 +4,8 @@ * 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 "mozilla/ipc/Ril.h" + #include #include #include @@ -18,8 +20,8 @@ #endif #include "jsfriendapi.h" +#include "nsTArray.h" #include "nsThreadUtils.h" // For NS_IsMainThread. -#include "Ril.h" USING_WORKERS_NAMESPACE using namespace mozilla::ipc; @@ -32,17 +34,130 @@ const char* RIL_SOCKET_NAME = "/dev/socket/rilproxy"; // desktop development. const uint32_t RIL_TEST_PORT = 6200; -class DispatchRILEvent : public WorkerTask +nsTArray > sRilConsumers; + +class ConnectWorkerToRIL : public WorkerTask { public: - DispatchRILEvent(UnixSocketRawData* aMessage) - : mMessage(aMessage) + ConnectWorkerToRIL() { } virtual bool RunTask(JSContext *aCx); +}; + +class SendRilSocketDataTask : public nsRunnable +{ +public: + SendRilSocketDataTask(unsigned long aClientId, + UnixSocketRawData *aRawData) + : mRawData(aRawData) + , mClientId(aClientId) + { } + + NS_IMETHOD Run() + { + MOZ_ASSERT(NS_IsMainThread()); + + if (sRilConsumers.Length() <= mClientId || + !sRilConsumers[mClientId] || + sRilConsumers[mClientId]->GetConnectionStatus() != SOCKET_CONNECTED) { + // Probably shuting down. + delete mRawData; + return NS_OK; + } + + sRilConsumers[mClientId]->SendSocketData(mRawData); + return NS_OK; + } private: - nsAutoPtr mMessage; + UnixSocketRawData *mRawData; + unsigned long mClientId; +}; + +bool +PostToRIL(JSContext *aCx, + unsigned aArgc, + JS::Value *aArgv) +{ + NS_ASSERTION(!NS_IsMainThread(), "Expecting to be on the worker thread"); + + if (aArgc != 2) { + JS_ReportError(aCx, "Expecting two arguments with the RIL message"); + return false; + } + + JS::Value cv = JS_ARGV(aCx, aArgv)[0]; + int clientId = cv.toInt32(); + + JS::Value v = JS_ARGV(aCx, aArgv)[1]; + + JSAutoByteString abs; + void *data; + size_t size; + if (JSVAL_IS_STRING(v)) { + JSString *str = JSVAL_TO_STRING(v); + if (!abs.encodeUtf8(aCx, str)) { + return false; + } + + data = abs.ptr(); + size = abs.length(); + } else if (!JSVAL_IS_PRIMITIVE(v)) { + JSObject *obj = JSVAL_TO_OBJECT(v); + if (!JS_IsTypedArrayObject(obj)) { + JS_ReportError(aCx, "Object passed in wasn't a typed array"); + return false; + } + + uint32_t type = JS_GetArrayBufferViewType(obj); + if (type != js::ArrayBufferView::TYPE_INT8 && + type != js::ArrayBufferView::TYPE_UINT8 && + type != js::ArrayBufferView::TYPE_UINT8_CLAMPED) { + JS_ReportError(aCx, "Typed array data is not octets"); + return false; + } + + size = JS_GetTypedArrayByteLength(obj); + data = JS_GetArrayBufferViewData(obj); + } else { + JS_ReportError(aCx, + "Incorrect argument. Expecting a string or a typed array"); + return false; + } + + UnixSocketRawData* raw = new UnixSocketRawData(data, size); + + nsRefPtr task = + new SendRilSocketDataTask(clientId, raw); + NS_DispatchToMainThread(task); + return true; +} + +bool +ConnectWorkerToRIL::RunTask(JSContext *aCx) +{ + // Set up the postRILMessage on the function for worker -> RIL thread + // communication. + NS_ASSERTION(!NS_IsMainThread(), "Expecting to be on the worker thread"); + NS_ASSERTION(!JS_IsRunning(aCx), "Are we being called somehow?"); + JSObject *workerGlobal = JS::CurrentGlobalOrNull(aCx); + + return !!JS_DefineFunction(aCx, workerGlobal, + "postRILMessage", PostToRIL, 1, 0); +} + +class DispatchRILEvent : public WorkerTask +{ +public: + DispatchRILEvent(UnixSocketRawData* aMessage) + : mMessage(aMessage) + { } + + virtual bool RunTask(JSContext *aCx); + +private: + nsAutoPtr mMessage; }; bool @@ -192,11 +307,45 @@ RilConsumer::RilConsumer(unsigned long aClientId, ConnectSocket(new RilConnector(mClientId), mAddress.get()); } +nsresult +RilConsumer::Register(unsigned int aClientId, + WorkerCrossThreadDispatcher* aDispatcher) +{ + MOZ_ASSERT(NS_IsMainThread()); + + sRilConsumers.EnsureLengthAtLeast(aClientId + 1); + + if (sRilConsumers[aClientId]) { + NS_WARNING("RilConsumer already registered"); + return NS_ERROR_FAILURE; + } + + nsRefPtr connection = new ConnectWorkerToRIL(); + if (!aDispatcher->PostTask(connection)) { + NS_WARNING("Failed to connect worker to ril"); + return NS_ERROR_UNEXPECTED; + } + + // Now that we're set up, connect ourselves to the RIL thread. + sRilConsumers[aClientId] = new RilConsumer(aClientId, aDispatcher); + return NS_OK; +} + void RilConsumer::Shutdown() { - mShutdown = true; - CloseSocket(); + MOZ_ASSERT(NS_IsMainThread()); + + for (unsigned long i = 0; i < sRilConsumers.Length(); i++) { + nsRefPtr& instance = sRilConsumers[i]; + if (!instance) { + continue; + } + + instance->mShutdown = true; + instance->CloseSocket(); + instance = nullptr; + } } void @@ -212,20 +361,20 @@ void RilConsumer::OnConnectSuccess() { // Nothing to do here. - LOG("RIL[%u]: %s\n", mClientId, __FUNCTION__); + LOG("RIL[%lu]: %s\n", mClientId, __FUNCTION__); } void RilConsumer::OnConnectError() { - LOG("RIL[%u]: %s\n", mClientId, __FUNCTION__); + LOG("RIL[%lu]: %s\n", mClientId, __FUNCTION__); CloseSocket(); } void RilConsumer::OnDisconnect() { - LOG("RIL[%u]: %s\n", mClientId, __FUNCTION__); + LOG("RIL[%lu]: %s\n", mClientId, __FUNCTION__); if (!mShutdown) { ConnectSocket(new RilConnector(mClientId), mAddress.get(), 1000); } diff --git a/ipc/ril/Ril.h b/ipc/ril/Ril.h index bb4d1c7daee..ce294a412ce 100644 --- a/ipc/ril/Ril.h +++ b/ipc/ril/Ril.h @@ -16,13 +16,16 @@ namespace ipc { class RilConsumer : public mozilla::ipc::UnixSocketConsumer { public: - RilConsumer(unsigned long aClientId, - mozilla::dom::workers::WorkerCrossThreadDispatcher* aDispatcher); virtual ~RilConsumer() { } - void Shutdown(); + static nsresult Register(unsigned int aClientId, + mozilla::dom::workers::WorkerCrossThreadDispatcher* aDispatcher); + static void Shutdown(); private: + RilConsumer(unsigned long aClientId, + mozilla::dom::workers::WorkerCrossThreadDispatcher* aDispatcher); + virtual void ReceiveSocketData(nsAutoPtr& aMessage); virtual void OnConnectSuccess(); diff --git a/js/xpconnect/src/event_impl_gen.conf.in b/js/xpconnect/src/event_impl_gen.conf.in index a60017c1f68..cc93ee6a588 100644 --- a/js/xpconnect/src/event_impl_gen.conf.in +++ b/js/xpconnect/src/event_impl_gen.conf.in @@ -23,6 +23,10 @@ simple_events = [ 'StyleRuleChangeEvent', 'StyleSheetChangeEvent', 'StyleSheetApplicableStateChangeEvent', +#ifdef MOZ_WIDGET_GONK + 'MozWifiStatusChangeEvent', + 'MozWifiConnectionInfoEvent', +#endif #ifdef MOZ_B2G_BT 'BluetoothDeviceEvent', 'BluetoothStatusChangedEvent', @@ -32,8 +36,6 @@ simple_events = [ 'DataErrorEvent', 'MozEmergencyCbModeEvent', 'MozOtaStatusEvent', - 'MozWifiStatusChangeEvent', - 'MozWifiConnectionInfoEvent', 'MozCellBroadcastEvent', 'MozVoicemailEvent', 'USSDReceivedEvent', diff --git a/layout/build/Makefile.in b/layout/build/Makefile.in index 07b22ec4293..972012f0f2c 100644 --- a/layout/build/Makefile.in +++ b/layout/build/Makefile.in @@ -127,9 +127,14 @@ endif #} SHARED_LIBRARY_LIBS += $(DEPTH)/dom/camera/$(LIB_PREFIX)domcamera_s.$(LIB_SUFFIX) -ifdef MOZ_B2G_RIL #{ +ifeq (gonk,$(MOZ_WIDGET_TOOLKIT)) SHARED_LIBRARY_LIBS += \ $(DEPTH)/dom/system/gonk/$(LIB_PREFIX)domsystemgonk_s.$(LIB_SUFFIX) \ + $(NULL) +endif #} + +ifdef MOZ_B2G_RIL #{ +SHARED_LIBRARY_LIBS += \ $(DEPTH)/dom/icc/src/$(LIB_PREFIX)dom_icc_s.$(LIB_SUFFIX) \ $(DEPTH)/dom/cellbroadcast/src/$(LIB_PREFIX)dom_cellbroadcast_s.$(LIB_SUFFIX) \ $(DEPTH)/dom/voicemail/$(LIB_PREFIX)domvoicemail_s.$(LIB_SUFFIX) \ @@ -326,7 +331,7 @@ ifdef MOZ_GSTREAMER LOCAL_INCLUDES += $(GSTREAMER_CFLAGS) endif -ifdef MOZ_B2G_RIL #{ +ifeq (gonk,$(MOZ_WIDGET_TOOLKIT)) LOCAL_INCLUDES += -I$(topsrcdir)/dom/system/gonk endif #} diff --git a/layout/build/nsLayoutModule.cpp b/layout/build/nsLayoutModule.cpp index 53e33d9b87c..1c144b0c219 100644 --- a/layout/build/nsLayoutModule.cpp +++ b/layout/build/nsLayoutModule.cpp @@ -101,7 +101,7 @@ #include "mozilla/dom/nsSynthVoiceRegistry.h" #endif -#ifdef MOZ_B2G_RIL +#ifdef MOZ_WIDGET_GONK #include "SystemWorkerManager.h" using mozilla::dom::gonk::SystemWorkerManager; #define SYSTEMWORKERMANAGER_CID \ @@ -288,7 +288,7 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(DOMRequestService, DOMRequestService::FactoryCreate) NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(QuotaManager, QuotaManager::FactoryCreate) -#ifdef MOZ_B2G_RIL +#ifdef MOZ_WIDGET_GONK NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(SystemWorkerManager, SystemWorkerManager::FactoryCreate) #endif @@ -754,7 +754,7 @@ NS_DEFINE_NAMED_CID(NS_TEXTEDITOR_CID); NS_DEFINE_NAMED_CID(INDEXEDDB_MANAGER_CID); NS_DEFINE_NAMED_CID(DOMREQUEST_SERVICE_CID); NS_DEFINE_NAMED_CID(QUOTA_MANAGER_CID); -#ifdef MOZ_B2G_RIL +#ifdef MOZ_WIDGET_GONK NS_DEFINE_NAMED_CID(SYSTEMWORKERMANAGER_CID); #endif #ifdef MOZ_B2G_BT @@ -1043,7 +1043,7 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = { { &kINDEXEDDB_MANAGER_CID, false, nullptr, IndexedDatabaseManagerConstructor }, { &kDOMREQUEST_SERVICE_CID, false, nullptr, DOMRequestServiceConstructor }, { &kQUOTA_MANAGER_CID, false, nullptr, QuotaManagerConstructor }, -#ifdef MOZ_B2G_RIL +#ifdef MOZ_WIDGET_GONK { &kSYSTEMWORKERMANAGER_CID, true, nullptr, SystemWorkerManagerConstructor }, #endif #ifdef MOZ_B2G_BT @@ -1201,7 +1201,7 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = { { INDEXEDDB_MANAGER_CONTRACTID, &kINDEXEDDB_MANAGER_CID }, { DOMREQUEST_SERVICE_CONTRACTID, &kDOMREQUEST_SERVICE_CID }, { QUOTA_MANAGER_CONTRACTID, &kQUOTA_MANAGER_CID }, -#ifdef MOZ_B2G_RIL +#ifdef MOZ_WIDGET_GONK { SYSTEMWORKERMANAGER_CONTRACTID, &kSYSTEMWORKERMANAGER_CID }, #endif #ifdef MOZ_B2G_BT @@ -1286,8 +1286,8 @@ static const mozilla::Module::CategoryEntry kLayoutCategories[] = { { "app-startup", "Volume Service", "service," NS_VOLUMESERVICE_CONTRACTID }, #endif CONTENTDLF_CATEGORIES -#ifdef MOZ_B2G_RIL - { "profile-after-change", "Telephony System Worker Manager", SYSTEMWORKERMANAGER_CONTRACTID }, +#ifdef MOZ_WIDGET_GONK + { "profile-after-change", "Gonk System Worker Manager", SYSTEMWORKERMANAGER_CONTRACTID }, #endif #ifdef MOZ_B2G_BT { "profile-after-change", "Bluetooth Service", BLUETOOTHSERVICE_CONTRACTID }, diff --git a/toolkit/library/Makefile.in b/toolkit/library/Makefile.in index 7f923e15d78..004f8b7e29c 100644 --- a/toolkit/library/Makefile.in +++ b/toolkit/library/Makefile.in @@ -96,12 +96,12 @@ OS_LIBS += -ldbus endif endif #} -ifneq ($(strip $(MOZ_B2G_RIL)$(MOZ_B2G_BT)),) #{ -STATIC_LIBS += mozipcunixsocket_s mozkeystore_s +ifneq ($(strip $(MOZ_B2G_RIL)$(MOZ_B2G_BT)$(filter gonk,$(MOZ_WIDGET_TOOLKIT))),) #{ +STATIC_LIBS += mozipcunixsocket_s endif #} ifeq (gonk,$(MOZ_WIDGET_TOOLKIT)) -STATIC_LIBS += moznetd_s +STATIC_LIBS += moznetd_s mozkeystore_s endif ifdef MOZ_B2G_CAMERA #{