From 8a9a47d07a4da9a2cd18224934665146f8ac6fd6 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Tue, 29 Oct 2013 01:00:24 -0700 Subject: [PATCH 01/29] Bumping gaia.json for 2 gaia-central revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/2fa2d77525c0 Author: Rudy Lu Desc: Merge pull request #13110 from RudyLu/keyboard/Bug925003_greekSMS_master_v1.2 Bug 925003 - Add a new keyboard layout, "Greek SMS" to allow sending mes... r=djf, julienw ======== https://hg.mozilla.org/integration/gaia-central/rev/7413aadf84d5 Author: Rudy Lu Desc: Bug 925003 - Add a new keyboard layout, "Greek SMS" to allow sending messages with GSM 7-bit encoding. - Disable auto crrection for Greek SMS keyboard layout. --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 6857235f11068..6ac258a045a83 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "d2dbad943faf566fe36dbe79086127da837af6a3", + "revision": "2fa2d77525c04ac9078f88495c3737e1b7d61a03", "repo_path": "/integration/gaia-central" } From 435e6f2d726da4221f00b3c592b4436b9e92e5df Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Tue, 29 Oct 2013 01:10:23 -0700 Subject: [PATCH 02/29] Bumping gaia.json for 2 gaia-central revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/1010c4c9abb5 Author: Amir Nissim Desc: Merge pull request #13119 from EverythingMe/912361-eme-banner Bug 912361 - [e.me] Re-use Homescreen Status Banner [r=crdlc, ranbena] ======== https://hg.mozilla.org/integration/gaia-central/rev/07bf317dadbb Author: Amir Nissim Desc: Bug 912361 - [e.me] Re-use Homescreen Status Banner [r=crdlc, ranbena] --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 6ac258a045a83..34fb921c3a444 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "2fa2d77525c04ac9078f88495c3737e1b7d61a03", + "revision": "1010c4c9abb59f2bb54b0dc8f5fbbabc65a0cb45", "repo_path": "/integration/gaia-central" } From 18d0af3d8e93dd014c7c162a536825f4c14ca121 Mon Sep 17 00:00:00 2001 From: Vicamo Yang Date: Tue, 29 Oct 2013 16:12:36 +0800 Subject: [PATCH 03/29] Bug 920551 - 1/2: Allow building b2g without MOZ_B2G_RIL. r=khuey --- configure.in | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index c95500cbc8b8d..199f2a8f2abdd 100644 --- a/configure.in +++ b/configure.in @@ -1941,7 +1941,7 @@ ia64*-hpux*) no_x=yes if test -n "$gonkdir"; then _PLATFORM_DEFAULT_TOOLKIT=cairo-gonk - MOZ_B2G_RIL=1 + _PLATFORM_HAVE_RIL=1 MOZ_B2G_FM=1 MOZ_SYNTH_PICO=1 else @@ -7274,9 +7274,14 @@ dnl ======================================================== MOZ_ARG_ENABLE_BOOL(b2g-ril, [ --enable-b2g-ril Set compile flags necessary for testing B2G Radio Interface Layer via network sockets ], MOZ_B2G_RIL=1, - MOZ_B2G_RIL= ) + MOZ_B2G_RIL=, + MOZ_B2G_RIL=$_PLATFORM_HAVE_RIL ) if test -n "$MOZ_B2G_RIL"; then - AC_DEFINE(MOZ_B2G_RIL) + if test -n "$_PLATFORM_HAVE_RIL"; then + AC_DEFINE(MOZ_B2G_RIL) + else + AC_MSG_ERROR([b2g-ril cannot be enabled because target platform doesn't support it.]) + fi fi AC_SUBST(MOZ_B2G_RIL) From 5fe778ab22fcdfe4be3068f8810b47ca9349a055 Mon Sep 17 00:00:00 2001 From: Vicamo Yang Date: Tue, 29 Oct 2013 16:12:37 +0800 Subject: [PATCH 04/29] Bug 920551 - 2.a/2: fix MobileMessage. r=gene,khuey --- b2g/installer/package-manifest.in | 12 +- dom/mobilemessage/interfaces/moz.build | 2 +- dom/mobilemessage/src/SmsServicesFactory.cpp | 6 +- dom/mobilemessage/src/moz.build | 2 +- dom/mobilemessage/tests/Makefile.in | 6 - .../tests/test_smsdatabaseservice.xul | 876 ------------------ dom/mobilemessage/tests/xpcshell.ini | 1 - 7 files changed, 13 insertions(+), 892 deletions(-) delete mode 100644 dom/mobilemessage/tests/test_smsdatabaseservice.xul diff --git a/b2g/installer/package-manifest.in b/b2g/installer/package-manifest.in index cee64eab8d10e..c466b5e0c1a5c 100644 --- a/b2g/installer/package-manifest.in +++ b/b2g/installer/package-manifest.in @@ -399,6 +399,14 @@ @BINPATH@/components/nsDownloadManagerUI.js @BINPATH@/components/nsSidebar.manifest @BINPATH@/components/nsSidebar.js + +#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 +#endif // MOZ_WIDGET_GONK && MOZ_B2G_RIL + #ifndef MOZ_WIDGET_GONK @BINPATH@/components/extensions.manifest @BINPATH@/components/addonManager.js @@ -469,11 +477,7 @@ @BINPATH@/components/NetworkManager.js @BINPATH@/components/RadioInterfaceLayer.manifest @BINPATH@/components/RadioInterfaceLayer.js -@BINPATH@/components/MmsService.manifest -@BINPATH@/components/MmsService.js @BINPATH@/components/RILContentHelper.js -@BINPATH@/components/MobileMessageDatabaseService.manifest -@BINPATH@/components/MobileMessageDatabaseService.js @BINPATH@/components/WifiWorker.js @BINPATH@/components/WifiWorker.manifest @BINPATH@/components/DOMWifiManager.js diff --git a/dom/mobilemessage/interfaces/moz.build b/dom/mobilemessage/interfaces/moz.build index 52cc79b9288cd..f112aab93ad62 100644 --- a/dom/mobilemessage/interfaces/moz.build +++ b/dom/mobilemessage/interfaces/moz.build @@ -22,7 +22,7 @@ XPIDL_SOURCES += [ 'nsIWapPushApplication.idl', ] -if CONFIG['MOZ_B2G_RIL']: +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['MOZ_B2G_RIL']: XPIDL_SOURCES += [ 'nsIRilMobileMessageDatabaseService.idl', ] diff --git a/dom/mobilemessage/src/SmsServicesFactory.cpp b/dom/mobilemessage/src/SmsServicesFactory.cpp index 2410a8102253e..db379fb4dbbcf 100644 --- a/dom/mobilemessage/src/SmsServicesFactory.cpp +++ b/dom/mobilemessage/src/SmsServicesFactory.cpp @@ -10,7 +10,7 @@ #include "android/MobileMessageDatabaseService.h" #include "android/SmsService.h" #include "android/MmsService.h" -#elif defined(MOZ_B2G_RIL) +#elif defined(MOZ_WIDGET_GONK) && defined(MOZ_B2G_RIL) #include "gonk/SmsService.h" #else #include "fallback/MmsService.h" @@ -47,7 +47,7 @@ SmsServicesFactory::CreateMobileMessageDatabaseService() if (XRE_GetProcessType() == GeckoProcessType_Content) { mobileMessageDBService = new SmsIPCService(); } else { -#ifdef MOZ_B2G_RIL +#if defined(MOZ_WIDGET_GONK) && defined(MOZ_B2G_RIL) mobileMessageDBService = do_GetService(RIL_MOBILE_MESSAGE_DATABASE_SERVICE_CONTRACTID); #else mobileMessageDBService = new MobileMessageDatabaseService(); @@ -65,7 +65,7 @@ SmsServicesFactory::CreateMmsService() if (XRE_GetProcessType() == GeckoProcessType_Content) { mmsService = new SmsIPCService(); } else { -#ifdef MOZ_B2G_RIL +#if defined(MOZ_WIDGET_GONK) && defined(MOZ_B2G_RIL) mmsService = do_CreateInstance(RIL_MMSSERVICE_CONTRACTID); #else mmsService = new MmsService(); diff --git a/dom/mobilemessage/src/moz.build b/dom/mobilemessage/src/moz.build index 9f0369c42d2b7..b79139f024275 100644 --- a/dom/mobilemessage/src/moz.build +++ b/dom/mobilemessage/src/moz.build @@ -19,7 +19,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android': 'android/MobileMessageDatabaseService.cpp', 'android/SmsService.cpp', ] -elif CONFIG['MOZ_B2G_RIL']: +elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['MOZ_B2G_RIL']: EXTRA_JS_MODULES = [ 'gonk/mms_consts.js', 'gonk/MmsPduHelper.jsm', diff --git a/dom/mobilemessage/tests/Makefile.in b/dom/mobilemessage/tests/Makefile.in index d9c2214d252f6..6fbe8159b2db1 100644 --- a/dom/mobilemessage/tests/Makefile.in +++ b/dom/mobilemessage/tests/Makefile.in @@ -1,9 +1,3 @@ # 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/. - -ifdef MOZ_B2G_RIL -MOCHITEST_CHROME_FILES = \ - test_smsdatabaseservice.xul \ - $(NULL) -endif diff --git a/dom/mobilemessage/tests/test_smsdatabaseservice.xul b/dom/mobilemessage/tests/test_smsdatabaseservice.xul deleted file mode 100644 index b95de0d7e6474..0000000000000 --- a/dom/mobilemessage/tests/test_smsdatabaseservice.xul +++ /dev/null @@ -1,876 +0,0 @@ - - - - - - Test MobileMessageDatabaseService by SMS - - -

- -

-  
-
diff --git a/dom/mobilemessage/tests/xpcshell.ini b/dom/mobilemessage/tests/xpcshell.ini index 6af3d261c6656..8498ad4deef0a 100644 --- a/dom/mobilemessage/tests/xpcshell.ini +++ b/dom/mobilemessage/tests/xpcshell.ini @@ -3,7 +3,6 @@ head = header_helpers.js tail = support-files = test_sms_basics.html - test_smsdatabaseservice.xul test_smsfilter.html [test_smsservice_createsmsmessage.js] From b0b9dbf6ab6049f2503d5ed315b5e4a98817409b Mon Sep 17 00:00:00 2001 From: Vicamo Yang Date: Tue, 29 Oct 2013 16:12:38 +0800 Subject: [PATCH 05/29] Bug 920551 - 2.b/2: fix Telephony. r=hsinyi,khuey --- b2g/app/b2g.js | 3 -- b2g/installer/package-manifest.in | 4 +-- dom/base/Navigator.cpp | 54 +++++++++++++++--------------- dom/base/Navigator.h | 10 +++--- dom/telephony/TelephonyFactory.cpp | 4 +-- dom/telephony/moz.build | 2 +- dom/webidl/Navigator.webidl | 10 +++--- modules/libpref/src/init/all.js | 4 +++ 8 files changed, 46 insertions(+), 45 deletions(-) diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index 27d8d7e008141..a9b0b7a81848d 100644 --- a/b2g/app/b2g.js +++ b/b2g/app/b2g.js @@ -821,9 +821,6 @@ pref("gfx.canvas.skiagl.dynamic-cache", true); // enable fence with readpixels for SurfaceStream pref("gfx.gralloc.fence-with-readpixels", true); -// Enable Telephony API -pref("dom.telephony.enabled", true); - // Cell Broadcast API pref("dom.cellbroadcast.enabled", true); pref("ril.cellbroadcast.disabled", false); diff --git a/b2g/installer/package-manifest.in b/b2g/installer/package-manifest.in index c466b5e0c1a5c..94a072219d9f1 100644 --- a/b2g/installer/package-manifest.in +++ b/b2g/installer/package-manifest.in @@ -405,6 +405,8 @@ @BINPATH@/components/MmsService.manifest @BINPATH@/components/MobileMessageDatabaseService.js @BINPATH@/components/MobileMessageDatabaseService.manifest +@BINPATH@/components/TelephonyProvider.js +@BINPATH@/components/TelephonyProvider.manifest #endif // MOZ_WIDGET_GONK && MOZ_B2G_RIL #ifndef MOZ_WIDGET_GONK @@ -486,8 +488,6 @@ @BINPATH@/components/NetworkStatsManager.manifest @BINPATH@/components/NetworkInterfaceListService.manifest @BINPATH@/components/NetworkInterfaceListService.js -@BINPATH@/components/TelephonyProvider.manifest -@BINPATH@/components/TelephonyProvider.js @BINPATH@/components/NetworkStatsServiceProxy.manifest @BINPATH@/components/NetworkStatsServiceProxy.js #endif diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp index 6938ea3cea50f..966764867f219 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -29,6 +29,7 @@ #include "nsIDOMWakeLock.h" #include "nsIPowerManagerService.h" #include "mozilla/dom/MobileMessageManager.h" +#include "mozilla/dom/Telephony.h" #include "mozilla/Hal.h" #include "nsISiteSpecificUserAgent.h" #include "mozilla/ClearOnShutdown.h" @@ -40,7 +41,6 @@ #include "mozilla/dom/IccManager.h" #include "MobileConnection.h" #include "mozilla/dom/CellBroadcast.h" -#include "mozilla/dom/Telephony.h" #include "mozilla/dom/Voicemail.h" #endif #include "nsIIdleObserver.h" @@ -138,12 +138,12 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Navigator) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBatteryManager) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPowerManager) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMobileMessageManager) + NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTelephony) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mConnection) #ifdef MOZ_B2G_RIL NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMobileConnection) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCellBroadcast) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mIccManager) - NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTelephony) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mVoicemail) #endif #ifdef MOZ_B2G_BT @@ -209,6 +209,10 @@ Navigator::Invalidate() mMobileMessageManager = nullptr; } + if (mTelephony) { + mTelephony = nullptr; + } + if (mConnection) { mConnection->Shutdown(); mConnection = nullptr; @@ -229,10 +233,6 @@ Navigator::Invalidate() mIccManager = nullptr; } - if (mTelephony) { - mTelephony = nullptr; - } - if (mVoicemail) { mVoicemail = nullptr; } @@ -1165,34 +1165,34 @@ Navigator::GetMozMobileMessage() return mMobileMessageManager; } -#ifdef MOZ_B2G_RIL - -CellBroadcast* -Navigator::GetMozCellBroadcast(ErrorResult& aRv) +Telephony* +Navigator::GetMozTelephony(ErrorResult& aRv) { - if (!mCellBroadcast) { + if (!mTelephony) { if (!mWindow) { aRv.Throw(NS_ERROR_UNEXPECTED); return nullptr; } - mCellBroadcast = CellBroadcast::Create(mWindow, aRv); + mTelephony = Telephony::Create(mWindow, aRv); } - return mCellBroadcast; + return mTelephony; } -Telephony* -Navigator::GetMozTelephony(ErrorResult& aRv) +#ifdef MOZ_B2G_RIL + +CellBroadcast* +Navigator::GetMozCellBroadcast(ErrorResult& aRv) { - if (!mTelephony) { + if (!mCellBroadcast) { if (!mWindow) { aRv.Throw(NS_ERROR_UNEXPECTED); return nullptr; } - mTelephony = Telephony::Create(mWindow, aRv); + mCellBroadcast = CellBroadcast::Create(mWindow, aRv); } - return mTelephony; + return mCellBroadcast; } Voicemail* @@ -1697,15 +1697,6 @@ Navigator::HasMobileMessageSupport(JSContext* /* unused */, JSObject* aGlobal) return true; } -/* static */ -bool -Navigator::HasCameraSupport(JSContext* /* unused */, JSObject* aGlobal) -{ - nsCOMPtr win = GetWindowFromGlobal(aGlobal); - return win && nsDOMCameraManager::CheckPermission(win); -} - -#ifdef MOZ_B2G_RIL /* static */ bool Navigator::HasTelephonySupport(JSContext* /* unused */, JSObject* aGlobal) @@ -1719,6 +1710,15 @@ Navigator::HasTelephonySupport(JSContext* /* unused */, JSObject* aGlobal) return win && CheckPermission(win, "telephony"); } +/* static */ +bool +Navigator::HasCameraSupport(JSContext* /* unused */, JSObject* aGlobal) +{ + nsCOMPtr win = GetWindowFromGlobal(aGlobal); + return win && nsDOMCameraManager::CheckPermission(win); +} + +#ifdef MOZ_B2G_RIL /* static */ bool Navigator::HasMobileConnectionSupport(JSContext* /* unused */, diff --git a/dom/base/Navigator.h b/dom/base/Navigator.h index 60c89a3d661be..c35f22af66c30 100644 --- a/dom/base/Navigator.h +++ b/dom/base/Navigator.h @@ -86,11 +86,11 @@ class BluetoothManager; #ifdef MOZ_B2G_RIL class CellBroadcast; class IccManager; -class Telephony; class Voicemail; #endif class PowerManager; +class Telephony; namespace time { class TimeManager; @@ -211,6 +211,7 @@ class Navigator : public nsIDOMNavigator bool MozIsLocallyAvailable(const nsAString& aURI, bool aWhenOffline, ErrorResult& aRv); nsIDOMMozMobileMessageManager* GetMozMobileMessage(); + Telephony* GetMozTelephony(ErrorResult& aRv); nsIDOMMozConnection* GetMozConnection(); nsDOMCameraManager* GetMozCameras(ErrorResult& aRv); void MozSetMessageHandler(const nsAString& aType, @@ -218,7 +219,6 @@ class Navigator : public nsIDOMNavigator ErrorResult& aRv); bool MozHasPendingMessage(const nsAString& aType, ErrorResult& aRv); #ifdef MOZ_B2G_RIL - Telephony* GetMozTelephony(ErrorResult& aRv); nsIDOMMozMobileConnection* GetMozMobileConnection(ErrorResult& aRv); CellBroadcast* GetMozCellBroadcast(ErrorResult& aRv); Voicemail* GetMozVoicemail(ErrorResult& aRv); @@ -268,11 +268,11 @@ class Navigator : public nsIDOMNavigator } static bool HasMobileMessageSupport(JSContext* /* unused */, JSObject* aGlobal); + static bool HasTelephonySupport(JSContext* /* unused */, + JSObject* aGlobal); static bool HasCameraSupport(JSContext* /* unused */, JSObject* aGlobal); #ifdef MOZ_B2G_RIL - static bool HasTelephonySupport(JSContext* /* unused */, - JSObject* aGlobal); static bool HasMobileConnectionSupport(JSContext* /* unused */, JSObject* aGlobal); static bool HasCellBroadcastSupport(JSContext* /* unused */, @@ -326,12 +326,12 @@ class Navigator : public nsIDOMNavigator #endif nsRefPtr mPowerManager; nsRefPtr mMobileMessageManager; + nsRefPtr mTelephony; nsRefPtr mConnection; #ifdef MOZ_B2G_RIL nsRefPtr mMobileConnection; nsRefPtr mCellBroadcast; nsRefPtr mIccManager; - nsRefPtr mTelephony; nsRefPtr mVoicemail; #endif #ifdef MOZ_B2G_BT diff --git a/dom/telephony/TelephonyFactory.cpp b/dom/telephony/TelephonyFactory.cpp index eab2c699185cb..593a39d93472b 100644 --- a/dom/telephony/TelephonyFactory.cpp +++ b/dom/telephony/TelephonyFactory.cpp @@ -4,7 +4,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "mozilla/dom/telephony/TelephonyFactory.h" -#ifdef MOZ_WIDGET_GONK +#if defined(MOZ_WIDGET_GONK) && defined(MOZ_B2G_RIL) #include "nsIGonkTelephonyProvider.h" #endif #include "nsServiceManagerUtils.h" @@ -20,7 +20,7 @@ TelephonyFactory::CreateTelephonyProvider() if (XRE_GetProcessType() == GeckoProcessType_Content) { provider = new TelephonyIPCProvider(); -#ifdef MOZ_WIDGET_GONK +#if defined(MOZ_WIDGET_GONK) && defined(MOZ_B2G_RIL) } else { provider = do_CreateInstance(GONK_TELEPHONY_PROVIDER_CONTRACTID); #endif diff --git a/dom/telephony/moz.build b/dom/telephony/moz.build index d46be04b21ef4..8501230bfae12 100644 --- a/dom/telephony/moz.build +++ b/dom/telephony/moz.build @@ -45,7 +45,7 @@ IPDL_SOURCES += [ 'ipc/TelephonyTypes.ipdlh' ] -if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['MOZ_B2G_RIL']: XPIDL_SOURCES += [ 'nsIGonkTelephonyProvider.idl', ] diff --git a/dom/webidl/Navigator.webidl b/dom/webidl/Navigator.webidl index 3220533fcda74..5ccc1aeb67df5 100644 --- a/dom/webidl/Navigator.webidl +++ b/dom/webidl/Navigator.webidl @@ -255,11 +255,6 @@ partial interface Navigator { }; #ifdef MOZ_B2G_RIL -partial interface Navigator { - [Throws, Func="Navigator::HasTelephonySupport"] - readonly attribute Telephony? mozTelephony; -}; - // nsIMozNavigatorMobileConnection interface MozMobileConnection; partial interface Navigator { @@ -285,6 +280,11 @@ partial interface Navigator { }; #endif // MOZ_B2G_RIL +partial interface Navigator { + [Throws, Func="Navigator::HasTelephonySupport"] + readonly attribute Telephony? mozTelephony; +}; + #ifdef MOZ_GAMEPAD // https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#navigator-interface-extension partial interface Navigator { diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index ecba0dd309859..7875b700ac084 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -4512,7 +4512,11 @@ pref("dom.mozInputMethod.enabled", false); pref("dom.datastore.enabled", false); // Telephony API +#ifdef MOZ_B2G_RIL +pref("dom.telephony.enabled", true); +#else pref("dom.telephony.enabled", false); +#endif // Numeric default service id for WebTelephony API calls with |serviceId| // parameter omitted. pref("dom.telephony.defaultServiceId", 0); From 2a45e4e3b27ace2e361d14ef0ba3c9ebbfddad84 Mon Sep 17 00:00:00 2001 From: Vicamo Yang Date: Tue, 29 Oct 2013 16:12:39 +0800 Subject: [PATCH 06/29] Bug 920551 - 2.c/2: fix CellBroadcast. r=hsinyi --- b2g/app/b2g.js | 1 - modules/libpref/src/init/all.js | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index a9b0b7a81848d..85c3de85398de 100644 --- a/b2g/app/b2g.js +++ b/b2g/app/b2g.js @@ -822,7 +822,6 @@ pref("gfx.canvas.skiagl.dynamic-cache", true); pref("gfx.gralloc.fence-with-readpixels", true); // Cell Broadcast API -pref("dom.cellbroadcast.enabled", true); pref("ril.cellbroadcast.disabled", false); // ICC API diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index 7875b700ac084..f59cfb822ef45 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -4522,7 +4522,11 @@ pref("dom.telephony.enabled", false); pref("dom.telephony.defaultServiceId", 0); // Cell Broadcast API +#ifdef MOZ_B2G_RIL +pref("dom.cellbroadcast.enabled", true); +#else pref("dom.cellbroadcast.enabled", false); +#endif // ICC API pref("dom.icc.enabled", false); From fdf3d4b1edc59c18fdc5d9d0aa710df9e99e9ccb Mon Sep 17 00:00:00 2001 From: Vicamo Yang Date: Tue, 29 Oct 2013 16:12:40 +0800 Subject: [PATCH 07/29] Bug 920551 - 2.d/2: fix ICC. r=hsinyi,khuey --- b2g/app/b2g.js | 3 --- dom/base/moz.build | 1 - dom/webidl/moz.build | 2 +- modules/libpref/src/init/all.js | 4 ++++ 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index 85c3de85398de..a35e6c126187e 100644 --- a/b2g/app/b2g.js +++ b/b2g/app/b2g.js @@ -824,9 +824,6 @@ pref("gfx.gralloc.fence-with-readpixels", true); // Cell Broadcast API pref("ril.cellbroadcast.disabled", false); -// ICC API -pref("dom.icc.enabled", true); - // Mobile Connection API pref("dom.mobileconnection.enabled", true); diff --git a/dom/base/moz.build b/dom/base/moz.build index 160c12fcdf625..f2bdb13a288c0 100644 --- a/dom/base/moz.build +++ b/dom/base/moz.build @@ -128,7 +128,6 @@ LIBRARY_NAME = 'jsdombase_s' LOCAL_INCLUDES += [ '../battery', '../bluetooth', - '../icc/src', '../media', '../network/src', '../src/geolocation', diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build index 4af79c4972d00..1777ab30165c9 100644 --- a/dom/webidl/moz.build +++ b/dom/webidl/moz.build @@ -471,7 +471,6 @@ if CONFIG['MOZ_GAMEPAD']: if CONFIG['MOZ_B2G_RIL']: WEBIDL_FILES += [ - 'MozStkCommandEvent.webidl', 'MozVoicemail.webidl', ] @@ -517,6 +516,7 @@ if CONFIG['MOZ_B2G_RIL']: 'MozCellBroadcastEvent.webidl', 'MozEmergencyCbModeEvent.webidl', 'MozOtaStatusEvent.webidl', + 'MozStkCommandEvent.webidl', 'MozVoicemailEvent.webidl', 'MozWifiConnectionInfoEvent.webidl', 'MozWifiStatusChangeEvent.webidl', diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index f59cfb822ef45..f23acaf19a13d 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -4529,7 +4529,11 @@ pref("dom.cellbroadcast.enabled", false); #endif // ICC API +#ifdef MOZ_B2G_RIL +pref("dom.icc.enabled", true); +#else pref("dom.icc.enabled", false); +#endif // Mobile Connection API pref("dom.mobileconnection.enabled", false); From 8230c9be78422b57b0b43516b42afd0183a9d8f9 Mon Sep 17 00:00:00 2001 From: Vicamo Yang Date: Tue, 29 Oct 2013 16:12:41 +0800 Subject: [PATCH 08/29] Bug 920551 - 2.e/2: fix MobileConnection. r=hsinyi,khuey --- b2g/app/b2g.js | 3 --- dom/base/Navigator.cpp | 2 +- dom/network/interfaces/moz.build | 4 ++-- dom/network/src/MobileConnection.cpp | 3 ++- dom/network/src/moz.build | 3 +++ modules/libpref/src/init/all.js | 4 ++++ 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index a35e6c126187e..512925b3d421f 100644 --- a/b2g/app/b2g.js +++ b/b2g/app/b2g.js @@ -824,9 +824,6 @@ pref("gfx.gralloc.fence-with-readpixels", true); // Cell Broadcast API pref("ril.cellbroadcast.disabled", false); -// Mobile Connection API -pref("dom.mobileconnection.enabled", true); - // Voice Mail API pref("dom.voicemail.enabled", true); diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp index 966764867f219..e9940b96eec57 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -39,8 +39,8 @@ #include "nsGlobalWindow.h" #ifdef MOZ_B2G_RIL #include "mozilla/dom/IccManager.h" -#include "MobileConnection.h" #include "mozilla/dom/CellBroadcast.h" +#include "mozilla/dom/network/MobileConnection.h" #include "mozilla/dom/Voicemail.h" #endif #include "nsIIdleObserver.h" diff --git a/dom/network/interfaces/moz.build b/dom/network/interfaces/moz.build index 443b76373806d..23d8baa07e57f 100644 --- a/dom/network/interfaces/moz.build +++ b/dom/network/interfaces/moz.build @@ -6,10 +6,8 @@ XPIDL_SOURCES += [ 'nsIDOMConnection.idl', - 'nsIDOMDataErrorEvent.idl', 'nsIDOMTCPServerSocket.idl', 'nsIDOMTCPSocket.idl', - 'nsIDOMUSSDReceivedEvent.idl', 'nsIMozNavigatorNetwork.idl', 'nsITCPServerSocketChild.idl', 'nsITCPServerSocketParent.idl', @@ -20,11 +18,13 @@ XPIDL_SOURCES += [ if CONFIG['MOZ_B2G_RIL']: XPIDL_SOURCES += [ 'nsIDOMCFStateChangeEvent.idl', + 'nsIDOMDataErrorEvent.idl', 'nsIDOMMobileConnection.idl', 'nsIDOMMozEmergencyCbModeEvent.idl', 'nsIDOMMozOtaStatusEvent.idl', 'nsIDOMNetworkStats.idl', 'nsIDOMNetworkStatsManager.idl', + 'nsIDOMUSSDReceivedEvent.idl', 'nsIMobileConnectionProvider.idl', 'nsINetworkStatsServiceProxy.idl', ] diff --git a/dom/network/src/MobileConnection.cpp b/dom/network/src/MobileConnection.cpp index e743ea4158ae9..f975eea969c4f 100644 --- a/dom/network/src/MobileConnection.cpp +++ b/dom/network/src/MobileConnection.cpp @@ -2,7 +2,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 "MobileConnection.h" +#include "mozilla/dom/network/MobileConnection.h" + #include "GeneratedEvents.h" #include "mozilla/Preferences.h" #include "nsDOMEvent.h" diff --git a/dom/network/src/moz.build b/dom/network/src/moz.build index be1e8f5e81fa9..e945b41d134db 100644 --- a/dom/network/src/moz.build +++ b/dom/network/src/moz.build @@ -22,6 +22,9 @@ SOURCES += [ ] if CONFIG['MOZ_B2G_RIL']: + EXPORTS.mozilla.dom.network += [ + 'MobileConnection.h', + ] SOURCES += [ 'MobileConnection.cpp', ] diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index f23acaf19a13d..7828e67abf41a 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -4536,7 +4536,11 @@ pref("dom.icc.enabled", false); #endif // Mobile Connection API +#ifdef MOZ_B2G_RIL +pref("dom.mobileconnection.enabled", true); +#else pref("dom.mobileconnection.enabled", false); +#endif // Voice Mail API pref("dom.voicemail.enabled", false); From 451a3b5c6e9bf6f2cafa179a84fb12c0e9b0dcbd Mon Sep 17 00:00:00 2001 From: Vicamo Yang Date: Tue, 29 Oct 2013 16:12:42 +0800 Subject: [PATCH 09/29] Bug 920551 - 2.f/2: fix Voicemail. r=hsinyi,khuey --- b2g/app/b2g.js | 3 --- dom/webidl/moz.build | 6 +----- modules/libpref/src/init/all.js | 4 ++++ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index 512925b3d421f..6656c8c9f8df5 100644 --- a/b2g/app/b2g.js +++ b/b2g/app/b2g.js @@ -824,9 +824,6 @@ pref("gfx.gralloc.fence-with-readpixels", true); // Cell Broadcast API pref("ril.cellbroadcast.disabled", false); -// Voice Mail API -pref("dom.voicemail.enabled", true); - // The url of the page used to display network error details. pref("b2g.neterror.url", "app://system.gaiamobile.org/net_error.html"); diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build index 1777ab30165c9..0eb3127549da1 100644 --- a/dom/webidl/moz.build +++ b/dom/webidl/moz.build @@ -469,11 +469,6 @@ if CONFIG['MOZ_GAMEPAD']: 'Gamepad.webidl', ] -if CONFIG['MOZ_B2G_RIL']: - WEBIDL_FILES += [ - 'MozVoicemail.webidl', - ] - WEBIDL_FILES += [ 'CloseEvent.webidl', 'CustomEvent.webidl', @@ -517,6 +512,7 @@ if CONFIG['MOZ_B2G_RIL']: 'MozEmergencyCbModeEvent.webidl', 'MozOtaStatusEvent.webidl', 'MozStkCommandEvent.webidl', + 'MozVoicemail.webidl', 'MozVoicemailEvent.webidl', 'MozWifiConnectionInfoEvent.webidl', 'MozWifiStatusChangeEvent.webidl', diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index 7828e67abf41a..8030032ff0caf 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -4543,7 +4543,11 @@ pref("dom.mobileconnection.enabled", false); #endif // Voice Mail API +#ifdef MOZ_B2G_RIL +pref("dom.voicemail.enabled", true); +#else pref("dom.voicemail.enabled", false); +#endif // Numeric default service id for Voice Mail API calls with |serviceId| // parameter omitted. pref("dom.voicemail.defaultServiceId", 0); From 7974812b92860e4938fceb36c7827043c9fd85f7 Mon Sep 17 00:00:00 2001 From: Vicamo Yang Date: Tue, 29 Oct 2013 16:12:43 +0800 Subject: [PATCH 10/29] Bug 920551 - 2.g/2: fix WAP Push. r=hsinyi,khuey --- dom/moz.build | 2 +- dom/wappush/moz.build | 2 +- dom/wappush/src/moz.build | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dom/moz.build b/dom/moz.build index 789476ac52d95..546df28c83091 100644 --- a/dom/moz.build +++ b/dom/moz.build @@ -72,7 +72,6 @@ PARALLEL_DIRS += [ 'camera', 'audiochannel', 'promise', - 'wappush', 'telephony', 'inputmethod', 'webidl', @@ -87,6 +86,7 @@ if CONFIG['MOZ_B2G_RIL']: 'icc', 'cellbroadcast', 'voicemail', + 'wappush', ] if CONFIG['MOZ_PAY']: diff --git a/dom/wappush/moz.build b/dom/wappush/moz.build index a21f6787c8eca..1f6041d326c01 100644 --- a/dom/wappush/moz.build +++ b/dom/wappush/moz.build @@ -5,5 +5,5 @@ PARALLEL_DIRS += ['interfaces', 'src'] -if CONFIG['MOZ_B2G_RIL'] and CONFIG['ENABLE_TESTS']: +if CONFIG['ENABLE_TESTS']: XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell.ini'] diff --git a/dom/wappush/src/moz.build b/dom/wappush/src/moz.build index 87c35e10f2708..39cc0cb151f8b 100644 --- a/dom/wappush/src/moz.build +++ b/dom/wappush/src/moz.build @@ -4,7 +4,7 @@ # 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/. -if CONFIG['MOZ_B2G_RIL']: +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['MOZ_B2G_RIL']: EXTRA_JS_MODULES = [ 'gonk/CpPduHelper.jsm', 'gonk/SiPduHelper.jsm', From ef40add91e5ad8403aa58b42cf9a4e7874194bc0 Mon Sep 17 00:00:00 2001 From: Vicamo Yang Date: Tue, 29 Oct 2013 16:12:45 +0800 Subject: [PATCH 11/29] Bug 920551 - 2.h/2: fix dom/system/gonk/*. r=hsinyi,khuey --- b2g/app/b2g.js | 2 +- b2g/chrome/content/shell.js | 4 +- b2g/installer/package-manifest.in | 43 +++--- content/events/src/Makefile.in | 2 +- dom/base/moz.build | 2 +- dom/moz.build | 4 +- dom/network/interfaces/moz.build | 8 +- dom/network/src/moz.build | 4 +- dom/network/tests/Makefile.in | 2 +- dom/system/gonk/NetworkManager.js | 48 ++++++- dom/system/gonk/SystemWorkerManager.cpp | 163 ++--------------------- dom/system/gonk/SystemWorkerManager.h | 15 +-- dom/system/gonk/moz.build | 77 ++++++----- dom/system/moz.build | 3 +- dom/webidl/moz.build | 6 +- ipc/moz.build | 6 +- ipc/ril/Ril.cpp | 169 ++++++++++++++++++++++-- ipc/ril/Ril.h | 9 +- js/xpconnect/src/event_impl_gen.conf.in | 6 +- layout/build/Makefile.in | 9 +- layout/build/nsLayoutModule.cpp | 14 +- toolkit/library/Makefile.in | 6 +- 22 files changed, 336 insertions(+), 266 deletions(-) diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index 6656c8c9f8df5..ec91418d73eb0 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 e80e828aa7f0b..9c37aa716cd85 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 94a072219d9f1..39bd1ee846f02 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 8151c59d263d1..ff68d3f060e30 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 f2bdb13a288c0..7855232543ed2 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 546df28c83091..d0b32a2f08056 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 23d8baa07e57f..48988202d267f 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 e945b41d134db..a18122a6d0838 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 52fcdb65ce1a4..cc1bd18cacb17 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 291a20736f528..b2c30e1959510 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 a3dd23cef4b65..637760689d360 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(); -#endif - for (unsigned long i = 0; i < mRilConsumers.Length(); i++) { - if (mRilConsumers[i]) { - mRilConsumers[i]->Shutdown(); - mRilConsumers[i] = nullptr; - } - } +#ifdef MOZ_B2G_RIL + RilConsumer::Shutdown(); +#endif -#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 0198e6584b045..1562a80eb7585 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 @@ class SystemWorkerManager : public nsIObserver, 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 2e5eebbec690b..62691d7798058 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', - ] - -if CONFIG['ENABLE_TESTS']: - XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell.ini'] - +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'] + 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 af8338848c992..8eaabb305fa44 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 0eb3127549da1..147659dcafeb0 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 7b9711ced1249..1dc549316dae5 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 3dc8e0a8be821..c0bc05446f1de 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: + 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; + 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 bb4d1c7daee6e..ce294a412ce94 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 a60017c1f68a2..cc93ee6a58805 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 07b22ec4293c9..972012f0f2c08 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 53e33d9b87c6c..1c144b0c21919 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 7f923e15d782c..004f8b7e29c6b 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 #{ From fbe4741ee5071b28144b17e61c36cd816088e25e Mon Sep 17 00:00:00 2001 From: Vicamo Yang Date: Tue, 29 Oct 2013 16:12:46 +0800 Subject: [PATCH 12/29] Bug 920551 - 2.i/2: fix Bluetooth. r=echou --- dom/bluetooth/BluetoothAdapter.cpp | 15 +++++ dom/bluetooth/BluetoothHfpManager.cpp | 65 +++++++++++++++++-- dom/bluetooth/BluetoothHfpManager.h | 29 +++++++++ dom/bluetooth/BluetoothService.h | 2 + dom/bluetooth/ipc/BluetoothParent.cpp | 4 ++ dom/bluetooth/ipc/BluetoothParent.h | 2 + .../ipc/BluetoothServiceChildProcess.cpp | 2 + .../ipc/BluetoothServiceChildProcess.h | 2 + dom/bluetooth/linux/BluetoothDBusService.cpp | 2 + dom/bluetooth/linux/BluetoothDBusService.h | 2 + 10 files changed, 120 insertions(+), 5 deletions(-) diff --git a/dom/bluetooth/BluetoothAdapter.cpp b/dom/bluetooth/BluetoothAdapter.cpp index d12a5e4ce2221..f602d2b1f3ab4 100644 --- a/dom/bluetooth/BluetoothAdapter.cpp +++ b/dom/bluetooth/BluetoothAdapter.cpp @@ -881,6 +881,7 @@ BluetoothAdapter::IsScoConnected(ErrorResult& aRv) already_AddRefed BluetoothAdapter::AnswerWaitingCall(ErrorResult& aRv) { +#ifdef MOZ_B2G_RIL nsCOMPtr win = GetOwner(); if (!win) { aRv.Throw(NS_ERROR_FAILURE); @@ -899,11 +900,16 @@ BluetoothAdapter::AnswerWaitingCall(ErrorResult& aRv) bs->AnswerWaitingCall(results); return request.forget(); +#else + aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); + return nullptr; +#endif // MOZ_B2G_RIL } already_AddRefed BluetoothAdapter::IgnoreWaitingCall(ErrorResult& aRv) { +#ifdef MOZ_B2G_RIL nsCOMPtr win = GetOwner(); if (!win) { aRv.Throw(NS_ERROR_FAILURE); @@ -922,11 +928,16 @@ BluetoothAdapter::IgnoreWaitingCall(ErrorResult& aRv) bs->IgnoreWaitingCall(results); return request.forget(); +#else + aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); + return nullptr; +#endif // MOZ_B2G_RIL } already_AddRefed BluetoothAdapter::ToggleCalls(ErrorResult& aRv) { +#ifdef MOZ_B2G_RIL nsCOMPtr win = GetOwner(); if (!win) { aRv.Throw(NS_ERROR_FAILURE); @@ -945,6 +956,10 @@ BluetoothAdapter::ToggleCalls(ErrorResult& aRv) bs->ToggleCalls(results); return request.forget(); +#else + aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); + return nullptr; +#endif // MOZ_B2G_RIL } already_AddRefed diff --git a/dom/bluetooth/BluetoothHfpManager.cpp b/dom/bluetooth/BluetoothHfpManager.cpp index 95e33004ac686..5f3a61e061e20 100644 --- a/dom/bluetooth/BluetoothHfpManager.cpp +++ b/dom/bluetooth/BluetoothHfpManager.cpp @@ -15,19 +15,24 @@ #include "BluetoothUtils.h" #include "BluetoothUuid.h" -#include "MobileConnection.h" +#include "jsapi.h" #include "mozilla/dom/bluetooth/BluetoothTypes.h" #include "mozilla/Services.h" #include "mozilla/StaticPtr.h" #include "nsContentUtils.h" #include "nsIAudioManager.h" -#include "nsIDOMIccInfo.h" -#include "nsIIccProvider.h" #include "nsIObserverService.h" #include "nsISettingsService.h" +#include "nsServiceManagerUtils.h" + +#ifdef MOZ_B2G_RIL +#include "nsIDOMIccInfo.h" +#include "nsIDOMMobileConnection.h" +#include "nsIIccProvider.h" +#include "nsIMobileConnectionProvider.h" #include "nsITelephonyProvider.h" #include "nsRadioInterfaceLayer.h" -#include "nsServiceManagerUtils.h" +#endif /** * BRSF bitmask of AG supported features. See 4.34.1 "Bluetooth Defined AT @@ -44,6 +49,7 @@ #define BRSF_BIT_EXTENDED_ERR_RESULT_CODES (1 << 8) #define BRSF_BIT_CODEC_NEGOTIATION (1 << 9) +#ifdef MOZ_B2G_RIL /** * These constants are used in result code such as +CLIP and +CCWA. The value * of these constants is the same as TOA_INTERNATIONAL/TOA_UNKNOWN defined in @@ -51,6 +57,7 @@ */ #define TOA_UNKNOWN 0x81 #define TOA_INTERNATIONAL 0x91 +#endif #define CR_LF "\xd\xa"; @@ -66,6 +73,7 @@ namespace { bool sInShutdown = false; static const char kHfpCrlf[] = "\xd\xa"; +#ifdef MOZ_B2G_RIL // Sending ringtone related static bool sStopSendingRingFlag = true; static int sRingInterval = 3000; //unit: ms @@ -79,8 +87,10 @@ namespace { // The mechanism should be revised once we know the exact time at which // Dialer stops playing. static int sBusyToneInterval = 3700; //unit: ms +#endif // MOZ_B2G_RIL } // anonymous namespace +#ifdef MOZ_B2G_RIL /* CallState for sCINDItems[CINDType::CALL].value * - NO_CALL: there are no calls in progress * - IN_PROGRESS: at least one call is in progress @@ -113,6 +123,7 @@ enum CallHeldState { ONHOLD_ACTIVE, ONHOLD_NOACTIVE }; +#endif // MOZ_B2G_RIL typedef struct { const char* name; @@ -123,23 +134,27 @@ typedef struct { enum CINDType { BATTCHG = 1, +#ifdef MOZ_B2G_RIL CALL, CALLHELD, CALLSETUP, SERVICE, SIGNAL, ROAM +#endif }; static CINDItem sCINDItems[] = { {}, {"battchg", "0-5", 5, true}, +#ifdef MOZ_B2G_RIL {"call", "0,1", CallState::NO_CALL, true}, {"callheld", "0-2", CallHeldState::NO_CALLHELD, true}, {"callsetup", "0-3", CallSetupState::NO_CALLSETUP, true}, {"service", "0,1", 0, true}, {"signal", "0-5", 0, true}, {"roam", "0,1", 0, true} +#endif }; class BluetoothHfpManager::GetVolumeTask : public nsISettingsServiceCallback @@ -206,6 +221,7 @@ BluetoothHfpManager::Notify(const hal::BatteryInformation& aBatteryInfo) } } +#ifdef MOZ_B2G_RIL class BluetoothHfpManager::RespondToBLDNTask : public Task { private: @@ -265,6 +281,7 @@ class BluetoothHfpManager::SendRingIndicatorTask : public Task nsString mNumber; int mType; }; +#endif // MOZ_B2G_RIL class BluetoothHfpManager::CloseScoTask : public Task { @@ -277,6 +294,7 @@ class BluetoothHfpManager::CloseScoTask : public Task } }; +#ifdef MOZ_B2G_RIL static bool IsValidDtmf(const char aChar) { // Valid DTMF: [*#0-9ABCD] @@ -319,6 +337,7 @@ Call::IsActive() { return (mState == nsITelephonyProvider::CALL_STATE_CONNECTED); } +#endif // MOZ_B2G_RIL /** * BluetoothHfpManager @@ -328,6 +347,7 @@ BluetoothHfpManager::BluetoothHfpManager() : mController(nullptr) Reset(); } +#ifdef MOZ_B2G_RIL void BluetoothHfpManager::ResetCallArray() { @@ -341,25 +361,31 @@ BluetoothHfpManager::ResetCallArray() mCdmaSecondCall.Reset(); } } +#endif // MOZ_B2G_RIL void BluetoothHfpManager::Reset() { +#ifdef MOZ_B2G_RIL sStopSendingRingFlag = true; sCINDItems[CINDType::CALL].value = CallState::NO_CALL; sCINDItems[CINDType::CALLSETUP].value = CallSetupState::NO_CALLSETUP; sCINDItems[CINDType::CALLHELD].value = CallHeldState::NO_CALLHELD; +#endif for (uint8_t i = 1; i < ArrayLength(sCINDItems); i++) { sCINDItems[i].activated = true; } +#ifdef MOZ_B2G_RIL mCCWA = false; mCLIP = false; + mDialingRequestProcessed = true; +#endif mCMEE = false; mCMER = false; mReceiveVgsFlag = false; - mDialingRequestProcessed = true; +#ifdef MOZ_B2G_RIL // We disable BSIR by default as it requires OEM implement BT SCO + SPEAKER // output audio path in audio driver. OEM can enable BSIR by setting // mBSIR=true here. @@ -368,6 +394,7 @@ BluetoothHfpManager::Reset() mBSIR = false; ResetCallArray(); +#endif } bool @@ -386,11 +413,13 @@ BluetoothHfpManager::Init() hal::RegisterBatteryObserver(this); +#ifdef MOZ_B2G_RIL mListener = new BluetoothRilListener(); if (!mListener->StartListening()) { BT_WARNING("Failed to start listening RIL"); return false; } +#endif nsCOMPtr settings = do_GetService("@mozilla.org/settingsService;1"); @@ -417,10 +446,12 @@ BluetoothHfpManager::Init() BluetoothHfpManager::~BluetoothHfpManager() { +#ifdef MOZ_B2G_RIL if (!mListener->StopListening()) { BT_WARNING("Failed to stop listening RIL"); } mListener = nullptr; +#endif nsCOMPtr obs = services::GetObserverService(); NS_ENSURE_TRUE_VOID(obs); @@ -486,6 +517,7 @@ BluetoothHfpManager::NotifyConnectionStatusChanged(const nsAString& aType) DispatchStatusChangedEvent(eventName, mDeviceAddress, status); } +#ifdef MOZ_B2G_RIL void BluetoothHfpManager::NotifyDialer(const nsAString& aCommand) { @@ -502,6 +534,7 @@ BluetoothHfpManager::NotifyDialer(const nsAString& aCommand) BT_WARNING("Failed to broadcast system message to dialer"); } } +#endif // MOZ_B2G_RIL void BluetoothHfpManager::HandleVolumeChanged(const nsAString& aData) @@ -551,6 +584,7 @@ BluetoothHfpManager::HandleVolumeChanged(const nsAString& aData) } } +#ifdef MOZ_B2G_RIL void BluetoothHfpManager::HandleVoiceConnectionChanged() { @@ -636,6 +670,7 @@ BluetoothHfpManager::HandleIccInfoChanged() NS_ENSURE_TRUE_VOID(gsmIccInfo); gsmIccInfo->GetMsisdn(mMsisdn); } +#endif // MOZ_B2G_RIL void BluetoothHfpManager::HandleShutdown() @@ -663,6 +698,7 @@ BluetoothHfpManager::ReceiveSocketData(BluetoothSocket* aSocket, // For more information, please refer to 4.34.1 "Bluetooth Defined AT // Capabilities" in Bluetooth hands-free profile 1.6 if (msg.Find("AT+BRSF=") != -1) { +#ifdef MOZ_B2G_RIL uint32_t brsf = BRSF_BIT_ABILITY_TO_REJECT_CALL | BRSF_BIT_ENHANCED_CALL_STATUS; @@ -675,6 +711,9 @@ BluetoothHfpManager::ReceiveSocketData(BluetoothSocket* aSocket, if (mBSIR) { brsf |= BRSF_BIT_IN_BAND_RING_TONE; } +#else + uint32_t brsf = 0; +#endif // MOZ_B2G_RIL SendCommand("+BRSF: ", brsf); } else if (msg.Find("AT+CIND=?") != -1) { @@ -715,6 +754,7 @@ BluetoothHfpManager::ReceiveSocketData(BluetoothSocket* aSocket, // AT+CMEE = 1: use numeric // AT+CMEE = 2: use verbose mCMEE = !atCommandValues[0].EqualsLiteral("0"); +#ifdef MOZ_B2G_RIL } else if (msg.Find("AT+COPS=") != -1) { ParseAtCommand(msg, 8, atCommandValues); @@ -753,6 +793,7 @@ BluetoothHfpManager::ReceiveSocketData(BluetoothSocket* aSocket, message += atCommandValues[0].get()[0]; NotifyDialer(NS_ConvertUTF8toUTF16(message)); } +#endif // MOZ_B2G_RIL } else if (msg.Find("AT+VGM=") != -1) { ParseAtCommand(msg, 7, atCommandValues); @@ -770,6 +811,7 @@ BluetoothHfpManager::ReceiveSocketData(BluetoothSocket* aSocket, NS_ASSERTION(vgm >= 0 && vgm <= 15, "Received invalid VGM value"); mCurrentVgm = vgm; +#ifdef MOZ_B2G_RIL } else if (msg.Find("AT+CHLD=?") != -1) { SendLine("+CHLD: (0,1,2)"); } else if (msg.Find("AT+CHLD=") != -1) { @@ -820,6 +862,7 @@ BluetoothHfpManager::ReceiveSocketData(BluetoothSocket* aSocket, SendLine("ERROR"); return; } +#endif // MOZ_B2G_RIL } else if (msg.Find("AT+VGS=") != -1) { // Adjust volume by headset mReceiveVgsFlag = true; @@ -847,6 +890,7 @@ BluetoothHfpManager::ReceiveSocketData(BluetoothSocket* aSocket, nsCOMPtr os = mozilla::services::GetObserverService(); data.AppendInt(newVgs); os->NotifyObservers(nullptr, "bluetooth-volume-change", data.get()); +#ifdef MOZ_B2G_RIL } else if ((msg.Find("AT+BLDN") != -1) || (msg.Find("ATD>") != -1)) { // Dialer app of FFOS v1 does not have plan to support Memory Dailing. // However, in order to pass Bluetooth HFP certification, we still have to @@ -972,6 +1016,7 @@ BluetoothHfpManager::ReceiveSocketData(BluetoothSocket* aSocket, // Ignore requests to activate/deactivate mandatory indicators } } +#endif // MOZ_B2G_RIL } else { nsCString warningMsg; warningMsg.Append(NS_LITERAL_CSTRING("Unsupported AT command: ")); @@ -1096,6 +1141,7 @@ BluetoothHfpManager::Disconnect(BluetoothProfileController* aController) mSocket->Disconnect(); } +#ifdef MOZ_B2G_RIL void BluetoothHfpManager::SendCCWA(const nsAString& aNumber, int aType) { @@ -1157,6 +1203,7 @@ BluetoothHfpManager::SendCLCC(const Call& aCall, int aIndex) return SendLine(message.get()); } +#endif // MOZ_B2G_RIL bool BluetoothHfpManager::SendLine(const char* aMessage) @@ -1222,6 +1269,7 @@ BluetoothHfpManager::SendCommand(const char* aCommand, uint32_t aValue) message.AppendLiteral(","); } } +#ifdef MOZ_B2G_RIL } else if (!strcmp(aCommand, "+CLCC: ")) { bool rv = true; uint32_t callNumbers = mCurrentCallArray.Length(); @@ -1238,6 +1286,7 @@ BluetoothHfpManager::SendCommand(const char* aCommand, uint32_t aValue) } return rv; +#endif // MOZ_B2G_RIL } else { message.AppendInt(aValue); } @@ -1245,6 +1294,7 @@ BluetoothHfpManager::SendCommand(const char* aCommand, uint32_t aValue) return SendLine(message.get()); } +#ifdef MOZ_B2G_RIL void BluetoothHfpManager::UpdateCIND(uint8_t aType, uint8_t aValue, bool aSend) { @@ -1525,12 +1575,15 @@ BluetoothHfpManager::ToggleCalls() nsITelephonyProvider::CALL_STATE_HELD : nsITelephonyProvider::CALL_STATE_CONNECTED; } +#endif // MOZ_B2G_RIL void BluetoothHfpManager::OnSocketConnectSuccess(BluetoothSocket* aSocket) { MOZ_ASSERT(aSocket); +#ifdef MOZ_B2G_RIL MOZ_ASSERT(mListener); +#endif // Success to create a SCO socket if (aSocket == mScoSocket) { @@ -1559,10 +1612,12 @@ BluetoothHfpManager::OnSocketConnectSuccess(BluetoothSocket* aSocket) mHandsfreeSocket = nullptr; } +#ifdef MOZ_B2G_RIL // Enumerate current calls mListener->EnumerateCalls(); mFirstCKPD = true; +#endif // Cache device path for NotifySettings() since we can't get socket address // when a headset disconnect with us diff --git a/dom/bluetooth/BluetoothHfpManager.h b/dom/bluetooth/BluetoothHfpManager.h index 10eb4542a54fb..b62eb8dc2ffcf 100644 --- a/dom/bluetooth/BluetoothHfpManager.h +++ b/dom/bluetooth/BluetoothHfpManager.h @@ -9,7 +9,9 @@ #include "BluetoothCommon.h" #include "BluetoothProfileManagerBase.h" +#ifdef MOZ_B2G_RIL #include "BluetoothRilListener.h" +#endif #include "BluetoothSocketObserver.h" #include "mozilla/ipc/UnixSocket.h" #include "mozilla/Hal.h" @@ -18,6 +20,8 @@ BEGIN_BLUETOOTH_NAMESPACE class BluetoothReplyRunnable; class BluetoothSocket; + +#ifdef MOZ_B2G_RIL class Call; /** @@ -67,6 +71,7 @@ class Call { nsString mNumber; int mType; }; +#endif // MOZ_B2G_RIL class BluetoothHfpManager : public BluetoothSocketObserver , public BluetoothProfileManagerBase @@ -109,6 +114,7 @@ class BluetoothHfpManager : public BluetoothSocketObserver bool DisconnectSco(); bool ListenSco(); +#ifdef MOZ_B2G_RIL /** * @param aSend A boolean indicates whether we need to notify headset or not */ @@ -117,26 +123,33 @@ class BluetoothHfpManager : public BluetoothSocketObserver const bool aIsOutgoing, bool aSend); void HandleIccInfoChanged(); void HandleVoiceConnectionChanged(); +#endif bool IsConnected(); bool IsScoConnected(); +#ifdef MOZ_B2G_RIL // CDMA-specific functions void UpdateSecondNumber(const nsAString& aNumber); void AnswerWaitingCall(); void IgnoreWaitingCall(); void ToggleCalls(); +#endif private: class CloseScoTask; class GetVolumeTask; +#ifdef MOZ_B2G_RIL class RespondToBLDNTask; class SendRingIndicatorTask; +#endif friend class CloseScoTask; friend class GetVolumeTask; +#ifdef MOZ_B2G_RIL friend class RespondToBLDNTask; friend class SendRingIndicatorTask; +#endif friend class BluetoothHfpManagerObserver; BluetoothHfpManager(); @@ -146,41 +159,55 @@ class BluetoothHfpManager : public BluetoothSocketObserver bool Init(); void Notify(const hal::BatteryInformation& aBatteryInfo); void Reset(); +#ifdef MOZ_B2G_RIL void ResetCallArray(); uint32_t FindFirstCall(uint16_t aState); uint32_t GetNumberOfCalls(uint16_t aState); PhoneType GetPhoneType(const nsAString& aType); +#endif void NotifyConnectionStatusChanged(const nsAString& aType); void NotifyDialer(const nsAString& aCommand); +#ifdef MOZ_B2G_RIL void SendCCWA(const nsAString& aNumber, int aType); bool SendCLCC(const Call& aCall, int aIndex); +#endif bool SendCommand(const char* aCommand, uint32_t aValue = 0); bool SendLine(const char* aMessage); +#ifdef MOZ_B2G_RIL void UpdateCIND(uint8_t aType, uint8_t aValue, bool aSend = true); +#endif void OnScoConnectSuccess(); void OnScoConnectError(); void OnScoDisconnect(); int mCurrentVgs; int mCurrentVgm; +#ifdef MOZ_B2G_RIL bool mBSIR; bool mCCWA; bool mCLIP; +#endif bool mCMEE; bool mCMER; +#ifdef MOZ_B2G_RIL bool mFirstCKPD; int mNetworkSelectionMode; PhoneType mPhoneType; +#endif bool mReceiveVgsFlag; +#ifdef MOZ_B2G_RIL bool mDialingRequestProcessed; +#endif nsString mDeviceAddress; +#ifdef MOZ_B2G_RIL nsString mMsisdn; nsString mOperatorName; nsTArray mCurrentCallArray; nsAutoPtr mListener; +#endif nsRefPtr mController; nsRefPtr mScoRunnable; @@ -198,8 +225,10 @@ class BluetoothHfpManager : public BluetoothSocketObserver nsRefPtr mScoSocket; SocketConnectionStatus mScoSocketStatus; +#ifdef MOZ_B2G_RIL // CDMA-specific variable Call mCdmaSecondCall; +#endif }; END_BLUETOOTH_NAMESPACE diff --git a/dom/bluetooth/BluetoothService.h b/dom/bluetooth/BluetoothService.h index 4aa1c41284960..8a798ba84d983 100644 --- a/dom/bluetooth/BluetoothService.h +++ b/dom/bluetooth/BluetoothService.h @@ -266,6 +266,7 @@ class BluetoothService : public nsIObserver virtual void IsScoConnected(BluetoothReplyRunnable* aRunnable) = 0; +#ifdef MOZ_B2G_RIL virtual void AnswerWaitingCall(BluetoothReplyRunnable* aRunnable) = 0; @@ -274,6 +275,7 @@ class BluetoothService : public nsIObserver virtual void ToggleCalls(BluetoothReplyRunnable* aRunnable) = 0; +#endif virtual void SendMetaData(const nsAString& aTitle, diff --git a/dom/bluetooth/ipc/BluetoothParent.cpp b/dom/bluetooth/ipc/BluetoothParent.cpp index 8116875565e21..057e2a678a29f 100644 --- a/dom/bluetooth/ipc/BluetoothParent.cpp +++ b/dom/bluetooth/ipc/BluetoothParent.cpp @@ -226,12 +226,14 @@ BluetoothParent::RecvPBluetoothRequestConstructor( return actor->DoRequest(aRequest.get_DisconnectScoRequest()); case Request::TIsScoConnectedRequest: return actor->DoRequest(aRequest.get_IsScoConnectedRequest()); +#ifdef MOZ_B2G_RIL case Request::TAnswerWaitingCallRequest: return actor->DoRequest(aRequest.get_AnswerWaitingCallRequest()); case Request::TIgnoreWaitingCallRequest: return actor->DoRequest(aRequest.get_IgnoreWaitingCallRequest()); case Request::TToggleCallsRequest: return actor->DoRequest(aRequest.get_ToggleCallsRequest()); +#endif case Request::TSendMetaDataRequest: return actor->DoRequest(aRequest.get_SendMetaDataRequest()); case Request::TSendPlayStatusRequest: @@ -581,6 +583,7 @@ BluetoothRequestParent::DoRequest(const IsScoConnectedRequest& aRequest) return true; } +#ifdef MOZ_B2G_RIL bool BluetoothRequestParent::DoRequest(const AnswerWaitingCallRequest& aRequest) { @@ -613,6 +616,7 @@ BluetoothRequestParent::DoRequest(const ToggleCallsRequest& aRequest) return true; } +#endif // MOZ_B2G_RIL bool BluetoothRequestParent::DoRequest(const SendMetaDataRequest& aRequest) diff --git a/dom/bluetooth/ipc/BluetoothParent.h b/dom/bluetooth/ipc/BluetoothParent.h index fc18980f708a7..d5ee4a391782b 100644 --- a/dom/bluetooth/ipc/BluetoothParent.h +++ b/dom/bluetooth/ipc/BluetoothParent.h @@ -190,6 +190,7 @@ class BluetoothRequestParent : public PBluetoothRequestParent bool DoRequest(const IsScoConnectedRequest& aRequest); +#ifdef MOZ_B2G_RIL bool DoRequest(const AnswerWaitingCallRequest& aRequest); @@ -198,6 +199,7 @@ class BluetoothRequestParent : public PBluetoothRequestParent bool DoRequest(const ToggleCallsRequest& aRequest); +#endif bool DoRequest(const SendMetaDataRequest& aRequest); diff --git a/dom/bluetooth/ipc/BluetoothServiceChildProcess.cpp b/dom/bluetooth/ipc/BluetoothServiceChildProcess.cpp index 92f3982eed469..de9b8f164637b 100644 --- a/dom/bluetooth/ipc/BluetoothServiceChildProcess.cpp +++ b/dom/bluetooth/ipc/BluetoothServiceChildProcess.cpp @@ -328,6 +328,7 @@ BluetoothServiceChildProcess::IsScoConnected(BluetoothReplyRunnable* aRunnable) SendRequest(aRunnable, IsScoConnectedRequest()); } +#ifdef MOZ_B2G_RIL void BluetoothServiceChildProcess::AnswerWaitingCall( BluetoothReplyRunnable* aRunnable) @@ -348,6 +349,7 @@ BluetoothServiceChildProcess::ToggleCalls( { SendRequest(aRunnable, ToggleCallsRequest()); } +#endif // MOZ_B2G_RIL void BluetoothServiceChildProcess::SendMetaData(const nsAString& aTitle, diff --git a/dom/bluetooth/ipc/BluetoothServiceChildProcess.h b/dom/bluetooth/ipc/BluetoothServiceChildProcess.h index 19061c2248ac0..ac8298fe6bd3e 100644 --- a/dom/bluetooth/ipc/BluetoothServiceChildProcess.h +++ b/dom/bluetooth/ipc/BluetoothServiceChildProcess.h @@ -149,6 +149,7 @@ class BluetoothServiceChildProcess : public BluetoothService virtual void IsScoConnected(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; +#ifdef MOZ_B2G_RIL virtual void AnswerWaitingCall(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; @@ -157,6 +158,7 @@ class BluetoothServiceChildProcess : public BluetoothService virtual void ToggleCalls(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; +#endif virtual void SendMetaData(const nsAString& aTitle, diff --git a/dom/bluetooth/linux/BluetoothDBusService.cpp b/dom/bluetooth/linux/BluetoothDBusService.cpp index 475e406d9c895..0abc47a61b75a 100644 --- a/dom/bluetooth/linux/BluetoothDBusService.cpp +++ b/dom/bluetooth/linux/BluetoothDBusService.cpp @@ -2627,6 +2627,7 @@ BluetoothDBusService::IsConnected(const uint16_t aServiceUuid) return profile->IsConnected(); } +#ifdef MOZ_B2G_RIL void BluetoothDBusService::AnswerWaitingCall(BluetoothReplyRunnable* aRunnable) { @@ -2659,6 +2660,7 @@ BluetoothDBusService::ToggleCalls(BluetoothReplyRunnable* aRunnable) DispatchBluetoothReply(aRunnable, BluetoothValue(true), EmptyString()); } +#endif // MOZ_B2G_RIL class OnUpdateSdpRecordsRunnable : public nsRunnable { diff --git a/dom/bluetooth/linux/BluetoothDBusService.h b/dom/bluetooth/linux/BluetoothDBusService.h index 2ef61e9b1590c..341205a3496df 100644 --- a/dom/bluetooth/linux/BluetoothDBusService.h +++ b/dom/bluetooth/linux/BluetoothDBusService.h @@ -135,6 +135,7 @@ class BluetoothDBusService : public BluetoothService virtual void IsScoConnected(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; +#ifdef MOZ_B2G_RIL virtual void AnswerWaitingCall(BluetoothReplyRunnable* aRunnable); @@ -143,6 +144,7 @@ class BluetoothDBusService : public BluetoothService virtual void ToggleCalls(BluetoothReplyRunnable* aRunnable); +#endif virtual void SendMetaData(const nsAString& aTitle, From 541aefd7c54795c0abc0c553f5b1e30bac14d911 Mon Sep 17 00:00:00 2001 From: Vicamo Yang Date: Tue, 29 Oct 2013 16:12:47 +0800 Subject: [PATCH 13/29] Bug 920551 - 2.j/2: fix GonkGPSGeolocationProvider. r=kanru --- .../gonk/GonkGPSGeolocationProvider.cpp | 39 ++++++++++++++++--- dom/system/gonk/GonkGPSGeolocationProvider.h | 27 ++++++++++--- 2 files changed, 54 insertions(+), 12 deletions(-) diff --git a/dom/system/gonk/GonkGPSGeolocationProvider.cpp b/dom/system/gonk/GonkGPSGeolocationProvider.cpp index c215623fc54b9..1383e35d28d25 100644 --- a/dom/system/gonk/GonkGPSGeolocationProvider.cpp +++ b/dom/system/gonk/GonkGPSGeolocationProvider.cpp @@ -18,19 +18,21 @@ #include #include "GonkGPSGeolocationProvider.h" -#include "SystemWorkerManager.h" #include "mozilla/Preferences.h" #include "nsGeoPosition.h" #include "nsIInterfaceRequestorUtils.h" #include "nsINetworkManager.h" -#include "nsIRadioInterfaceLayer.h" -#include "nsIDOMIccInfo.h" -#include "nsIDOMMobileConnection.h" #include "nsJSUtils.h" #include "nsServiceManagerUtils.h" #include "nsThreadUtils.h" #include "nsContentUtils.h" +#ifdef MOZ_B2G_RIL +#include "nsIDOMIccInfo.h" +#include "nsIDOMMobileConnection.h" +#include "nsIRadioInterfaceLayer.h" +#endif + #ifdef AGPS_TYPE_INVALID #define AGPS_HAVE_DUAL_APN #endif @@ -44,10 +46,15 @@ static const int kDefaultPeriod = 1000; // ms // While most methods of GonkGPSGeolocationProvider should only be // called from main thread, we deliberately put the Init and ShutdownGPS // methods off main thread to avoid blocking. +#ifdef MOZ_B2G_RIL NS_IMPL_ISUPPORTS3(GonkGPSGeolocationProvider, nsIGeolocationProvider, nsIRILDataCallback, nsISettingsServiceCallback) +#else +NS_IMPL_ISUPPORTS1(GonkGPSGeolocationProvider, + nsIGeolocationProvider) +#endif /* static */ GonkGPSGeolocationProvider* GonkGPSGeolocationProvider::sSingleton = nullptr; GpsCallbacks GonkGPSGeolocationProvider::mCallbacks = { @@ -65,6 +72,7 @@ GpsCallbacks GonkGPSGeolocationProvider::mCallbacks = { #endif }; +#ifdef MOZ_B2G_RIL AGpsCallbacks GonkGPSGeolocationProvider::mAGPSCallbacks = { AGPSStatusCallback, @@ -77,6 +85,7 @@ GonkGPSGeolocationProvider::mAGPSRILCallbacks = { AGPSRILRefLocCallback, CreateThreadCallback, }; +#endif // MOZ_B2G_RIL void GonkGPSGeolocationProvider::LocationCallback(GpsLocation* location) @@ -146,8 +155,10 @@ GonkGPSGeolocationProvider::SetCapabilitiesCallback(uint32_t capabilities) GonkGPSGeolocationProvider::GetSingleton(); provider->mSupportsScheduling = mCapabilities & GPS_CAPABILITY_SCHEDULING; +#ifdef MOZ_B2G_RIL provider->mSupportsMSB = mCapabilities & GPS_CAPABILITY_MSB; provider->mSupportsMSA = mCapabilities & GPS_CAPABILITY_MSA; +#endif provider->mSupportsSingleShot = mCapabilities & GPS_CAPABILITY_SINGLE_SHOT; #ifdef GPS_CAPABILITY_ON_DEMAND_TIME provider->mSupportsTimeInjection = mCapabilities & GPS_CAPABILITY_ON_DEMAND_TIME; @@ -196,6 +207,7 @@ GonkGPSGeolocationProvider::RequestUtcTimeCallback() { } +#ifdef MOZ_B2G_RIL void GonkGPSGeolocationProvider::AGPSStatusCallback(AGpsStatus* status) { @@ -267,12 +279,15 @@ GonkGPSGeolocationProvider::AGPSRILRefLocCallback(uint32_t flags) NS_DispatchToMainThread(new RequestRefLocEvent()); } } +#endif // MOZ_B2G_RIL GonkGPSGeolocationProvider::GonkGPSGeolocationProvider() : mStarted(false) , mSupportsScheduling(false) +#ifdef MOZ_B2G_RIL , mSupportsMSB(false) , mSupportsMSA(false) +#endif , mSupportsSingleShot(false) , mSupportsTimeInjection(false) , mGpsInterface(nullptr) @@ -320,6 +335,7 @@ GonkGPSGeolocationProvider::GetGPSInterface() return result; } +#ifdef MOZ_B2G_RIL int32_t GonkGPSGeolocationProvider::GetDataConnectionState() { @@ -507,6 +523,7 @@ GonkGPSGeolocationProvider::SetReferenceLocation() } } } +#endif // MOZ_B2G_RIL void GonkGPSGeolocationProvider::Init() @@ -523,6 +540,7 @@ GonkGPSGeolocationProvider::Init() return; } +#ifdef MOZ_B2G_RIL mAGpsInterface = static_cast(mGpsInterface->get_extension(AGPS_INTERFACE)); if (mAGpsInterface) { @@ -534,6 +552,7 @@ GonkGPSGeolocationProvider::Init() if (mAGpsRilInterface) { mAGpsRilInterface->init(&mAGPSRILCallbacks); } +#endif NS_DispatchToMainThread(NS_NewRunnableMethod(this, &GonkGPSGeolocationProvider::StartGPS)); } @@ -546,19 +565,23 @@ GonkGPSGeolocationProvider::StartGPS() int32_t update = Preferences::GetInt("geo.default.update", kDefaultPeriod); +#ifdef MOZ_B2G_RIL if (mSupportsMSA || mSupportsMSB) { SetupAGPS(); } +#endif int positionMode = GPS_POSITION_MODE_STANDALONE; bool singleShot = false; +#ifdef MOZ_B2G_RIL // XXX: If we know this is a single shot request, use MSA can be faster. if (singleShot && mSupportsMSA) { positionMode = GPS_POSITION_MODE_MS_ASSISTED; } else if (mSupportsMSB) { positionMode = GPS_POSITION_MODE_MS_BASED; } +#endif if (!mSupportsScheduling) { update = kDefaultPeriod; } @@ -574,6 +597,7 @@ GonkGPSGeolocationProvider::StartGPS() mGpsInterface->start(); } +#ifdef MOZ_B2G_RIL void GonkGPSGeolocationProvider::SetupAGPS() { @@ -599,9 +623,8 @@ GonkGPSGeolocationProvider::SetupAGPS() mRadioInterface->RegisterDataCallCallback(this); } } - - return; } +#endif // MOZ_B2G_RIL NS_IMETHODIMP GonkGPSGeolocationProvider::Startup() @@ -643,9 +666,11 @@ GonkGPSGeolocationProvider::Shutdown() } mStarted = false; +#ifdef MOZ_B2G_RIL if (mRadioInterface) { mRadioInterface->UnregisterDataCallCallback(this); } +#endif mInitThread->Dispatch(NS_NewRunnableMethod(this, &GonkGPSGeolocationProvider::ShutdownGPS), NS_DISPATCH_NORMAL); @@ -670,6 +695,7 @@ GonkGPSGeolocationProvider::SetHighAccuracy(bool) return NS_OK; } +#ifdef MOZ_B2G_RIL /** nsIRILDataCallback interface **/ NS_IMETHODIMP @@ -721,3 +747,4 @@ GonkGPSGeolocationProvider::HandleError(const nsAString& aErrorMessage) { return NS_OK; } +#endif // MOZ_B2G_RIL diff --git a/dom/system/gonk/GonkGPSGeolocationProvider.h b/dom/system/gonk/GonkGPSGeolocationProvider.h index 66f27da8cea4e..cc59d8a064e08 100644 --- a/dom/system/gonk/GonkGPSGeolocationProvider.h +++ b/dom/system/gonk/GonkGPSGeolocationProvider.h @@ -20,9 +20,10 @@ #include // for GpsInterface #include "nsCOMPtr.h" #include "nsIGeolocationProvider.h" +#ifdef MOZ_B2G_RIL #include "nsIRadioInterfaceLayer.h" -#include "nsString.h" #include "nsISettingsService.h" +#endif class nsIThread; @@ -33,14 +34,18 @@ class nsIThread; "@mozilla.org/gonk-gps-geolocation-provider;1" class GonkGPSGeolocationProvider : public nsIGeolocationProvider +#ifdef MOZ_B2G_RIL , public nsIRILDataCallback , public nsISettingsServiceCallback +#endif { public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIGEOLOCATIONPROVIDER +#ifdef MOZ_B2G_RIL NS_DECL_NSIRILDATACALLBACK NS_DECL_NSISETTINGSSERVICECALLBACK +#endif static already_AddRefed GetSingleton(); @@ -61,25 +66,31 @@ class GonkGPSGeolocationProvider : public nsIGeolocationProvider static void ReleaseWakelockCallback(); static pthread_t CreateThreadCallback(const char* name, void (*start)(void*), void* arg); static void RequestUtcTimeCallback(); +#ifdef MOZ_B2G_RIL static void AGPSStatusCallback(AGpsStatus* status); static void AGPSRILSetIDCallback(uint32_t flags); static void AGPSRILRefLocCallback(uint32_t flags); +#endif static GpsCallbacks mCallbacks; +#ifdef MOZ_B2G_RIL static AGpsCallbacks mAGPSCallbacks; static AGpsRilCallbacks mAGPSRILCallbacks; +#endif - int32_t GetDataConnectionState(); - void SetAGpsDataConn(nsAString& aApn); - void RequestSettingValue(char* aKey); void Init(); - void SetupAGPS(); void StartGPS(); void ShutdownGPS(); +#ifdef MOZ_B2G_RIL + void SetupAGPS(); + int32_t GetDataConnectionState(); + void SetAGpsDataConn(nsAString& aApn); void RequestDataConnection(); void ReleaseDataConnection(); + void RequestSettingValue(char* aKey); void RequestSetID(uint32_t flags); void SetReferenceLocation(); +#endif const GpsInterface* GetGPSInterface(); @@ -88,17 +99,21 @@ class GonkGPSGeolocationProvider : public nsIGeolocationProvider bool mStarted; bool mSupportsScheduling; +#ifdef MOZ_B2G_RIL bool mSupportsMSB; bool mSupportsMSA; +#endif bool mSupportsSingleShot; bool mSupportsTimeInjection; const GpsInterface* mGpsInterface; +#ifdef MOZ_B2G_RIL const AGpsInterface* mAGpsInterface; const AGpsRilInterface* mAGpsRilInterface; + nsCOMPtr mRadioInterface; +#endif nsCOMPtr mLocationCallback; nsCOMPtr mInitThread; - nsCOMPtr mRadioInterface; }; #endif /* GonkGPSGeolocationProvider_h */ From 262b337eea636c97dbe566ed290082451beee22f Mon Sep 17 00:00:00 2001 From: Gene Lian Date: Tue, 29 Oct 2013 16:13:06 +0800 Subject: [PATCH 14/29] Bug 931699 - SNTP can only update system time when WiFi or Mobile gets connected (not MMS/SUPL). r=skao,echen --- dom/system/gonk/RadioInterfaceLayer.js | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/dom/system/gonk/RadioInterfaceLayer.js b/dom/system/gonk/RadioInterfaceLayer.js index f67716bf56452..c0cf46d9c7678 100644 --- a/dom/system/gonk/RadioInterfaceLayer.js +++ b/dom/system/gonk/RadioInterfaceLayer.js @@ -2200,13 +2200,28 @@ RadioInterface.prototype = { break; case kNetworkInterfaceStateChangedTopic: let network = subject.QueryInterface(Ci.nsINetworkInterface); - if (network.state == Ci.nsINetworkInterface.NETWORK_STATE_CONNECTED) { - // Check SNTP when we have data connection, this may not take - // effect immediately before the setting get enabled. - if (this._sntp.isExpired()) { - this._sntp.request(); + if (network.state != Ci.nsINetworkInterface.NETWORK_STATE_CONNECTED) { + return; + } + + // SNTP can only update when we have mobile or Wifi connections. + if (network.type != Ci.nsINetworkInterface.NETWORK_TYPE_WIFI && + network.type != Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE) { + return; + } + + // If the network comes from RIL, make sure the RIL service is matched. + if (subject instanceof Ci.nsIRilNetworkInterface) { + network = subject.QueryInterface(Ci.nsIRilNetworkInterface); + if (network.serviceId != this.clientId) { + return; } } + + // SNTP won't update unless the SNTP is already expired. + if (this._sntp.isExpired()) { + this._sntp.request(); + } break; case kScreenStateChangedTopic: this.workerMessenger.send("setScreenState", { on: (data === "on") }); From 7a3af0212312ac5d52567821bb2b78a9713d22f1 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Tue, 29 Oct 2013 02:20:23 -0700 Subject: [PATCH 15/29] Bumping gaia.json for 2 gaia-central revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/2665fbf148c5 Author: gasolin Desc: Merge pull request #13157 from gasolin/issue-932141 Bug 932141 - [Homescreen] Refactor tablet media query styles, r=crdlc ======== https://hg.mozilla.org/integration/gaia-central/rev/3e8647d84744 Author: gasolin Desc: Bug 932141 - [Homescreen] Refactor tablet media query styles --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 34fb921c3a444..ca174dc26fb95 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "1010c4c9abb59f2bb54b0dc8f5fbbabc65a0cb45", + "revision": "2665fbf148c505a50ab19c3299257af99a03f510", "repo_path": "/integration/gaia-central" } From 1aa94d08575db03a0b7d570eb4d6c1b5b189b87f Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Tue, 29 Oct 2013 02:45:32 -0700 Subject: [PATCH 16/29] Bumping gaia.json for 2 gaia-central revision(s) a=gaia-bump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ======== https://hg.mozilla.org/integration/gaia-central/rev/12249906aac3 Author: Salvador de la Puente González Desc: Merge pull request #13166 from lodr/reset-wifi Bug 932009 - Fixing reset for WiFi ======== https://hg.mozilla.org/integration/gaia-central/rev/5e558379ef01 Author: lodr Desc: Bug 932009 - Fixing reset for WiFi --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index ca174dc26fb95..037d8c0a225f1 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "2665fbf148c505a50ab19c3299257af99a03f510", + "revision": "12249906aac39405601b6224b335f7b671dbbeac", "repo_path": "/integration/gaia-central" } From 14e2e4aacedbca4ba9b6634082868512e95a5790 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Tue, 29 Oct 2013 11:08:16 +0100 Subject: [PATCH 17/29] Bug 931038: Remove blocking DBus interface, r=qdot All blocking calls to DBus have been replaced by non-blocking code. This patch removes the corresponding DBus interfaces. --- ipc/dbus/RawDBusConnection.cpp | 189 +-------------------------------- ipc/dbus/RawDBusConnection.h | 9 -- 2 files changed, 2 insertions(+), 196 deletions(-) diff --git a/ipc/dbus/RawDBusConnection.cpp b/ipc/dbus/RawDBusConnection.cpp index 12d8b50554448..bc13d2e83b687 100644 --- a/ipc/dbus/RawDBusConnection.cpp +++ b/ipc/dbus/RawDBusConnection.cpp @@ -53,59 +53,16 @@ class DBusConnectionSendRunnableBase : public nsRunnable DBusMessageRefPtr mMessage; }; -class DBusConnectionSendSyncRunnable : public DBusConnectionSendRunnableBase -{ -public: - bool WaitForCompletion() - { - MOZ_ASSERT(!NS_IsMainThread()); - - MonitorAutoLock autoLock(mCompletedMonitor); - while (!mCompleted) { - mCompletedMonitor.Wait(); - } - return mSuccess; - } - -protected: - DBusConnectionSendSyncRunnable(DBusConnection* aConnection, - DBusMessage* aMessage) - : DBusConnectionSendRunnableBase(aConnection, aMessage), - mCompletedMonitor("DBusConnectionSendSyncRunnable.mCompleted"), - mCompleted(false), - mSuccess(false) - { } - - virtual ~DBusConnectionSendSyncRunnable() - { } - - // Call this function at the end of Run() to notify waiting - // threads. - void Completed(bool aSuccess) - { - MonitorAutoLock autoLock(mCompletedMonitor); - MOZ_ASSERT(!mCompleted); - mSuccess = aSuccess; - mCompleted = true; - mCompletedMonitor.Notify(); - } - -private: - Monitor mCompletedMonitor; - bool mCompleted; - bool mSuccess; -}; - // // Sends a message and returns the message's serial number to the // disaptching thread. Only run it in DBus thread. // -class DBusConnectionSendRunnable : public DBusConnectionSendSyncRunnable +class DBusConnectionSendRunnable : public DBusConnectionSendRunnableBase { public: DBusConnectionSendRunnable(DBusConnection* aConnection, DBusMessage* aMessage) - : DBusConnectionSendSyncRunnable(aConnection, aMessage) + : DBusConnectionSendRunnableBase(aConnection, aMessage) { } NS_IMETHOD Run() @@ -113,7 +70,6 @@ class DBusConnectionSendRunnable : public DBusConnectionSendSyncRunnable MOZ_ASSERT(!NS_IsMainThread()); dbus_bool_t success = dbus_connection_send(mConnection, mMessage, nullptr); - Completed(success == TRUE); NS_ENSURE_TRUE(success == TRUE, NS_ERROR_FAILURE); @@ -220,95 +176,6 @@ class DBusConnectionSendWithReplyRunnable : public DBusConnectionSendRunnableBas int mTimeout; }; -// -// Legacy interface, don't use in new code -// -// Sends a message and waits for the reply. Only run it in DBus thread. -// -class DBusConnectionSendAndBlockRunnable : public DBusConnectionSendSyncRunnable -{ -private: - static void Notify(DBusPendingCall* aCall, void* aData) - { - DBusConnectionSendAndBlockRunnable* runnable( - static_cast(aData)); - - runnable->mReply = dbus_pending_call_steal_reply(aCall); - - bool success = !!runnable->mReply; - - if (runnable->mError) { - success = success && !dbus_error_is_set(runnable->mError); - - if (!dbus_set_error_from_message(runnable->mError, runnable->mReply)) { - dbus_error_init(runnable->mError); - } - } - - dbus_pending_call_cancel(aCall); - dbus_pending_call_unref(aCall); - - runnable->Completed(success); - } - -public: - DBusConnectionSendAndBlockRunnable(DBusConnection* aConnection, - DBusMessage* aMessage, - int aTimeout, - DBusError* aError) - : DBusConnectionSendSyncRunnable(aConnection, aMessage), - mError(aError), - mReply(nullptr), - mTimeout(aTimeout) - { } - - NS_IMETHOD Run() - { - MOZ_ASSERT(!NS_IsMainThread()); - - DBusPendingCall* call = nullptr; - - dbus_bool_t success = dbus_connection_send_with_reply(mConnection, - mMessage, - &call, - mTimeout); - if (success == TRUE) { - success = dbus_pending_call_set_notify(call, Notify, this, nullptr); - } else { - if (mError) { - if (!call) { - dbus_set_error(mError, DBUS_ERROR_DISCONNECTED, "Connection is closed"); - } else { - dbus_error_init(mError); - } - } - } - - dbus_message_unref(mMessage); - - if (!success) { - Completed(false); - NS_ENSURE_TRUE(success == TRUE, NS_ERROR_FAILURE); - } - - return NS_OK; - } - - DBusMessage* GetReply() - { - return mReply; - } - -protected: - ~DBusConnectionSendAndBlockRunnable() - { } - -private: - DBusError* mError; - DBusMessage* mReply; - int mTimeout; -}; - } } @@ -414,58 +281,6 @@ bool RawDBusConnection::SendWithReply(DBusReplyCallback aCallback, return SendWithReply(aCallback, aData, aTimeout, msg); } -bool RawDBusConnection::SendWithError(DBusMessage** aReply, - DBusError* aError, - int aTimeout, - DBusMessage* aMessage) -{ - nsRefPtr t( - new DBusConnectionSendAndBlockRunnable(mConnection, aMessage, - aTimeout, aError)); - MOZ_ASSERT(t); - - nsresult rv = DispatchToDBusThread(t); - - if (NS_FAILED(rv)) { - if (aMessage) { - dbus_message_unref(aMessage); - } - return false; - } - - if (!t->WaitForCompletion()) { - return false; - } - - if (aReply) { - *aReply = t->GetReply(); - } - - return true; -} - -bool RawDBusConnection::SendWithError(DBusMessage** aReply, - DBusError* aError, - int aTimeout, - const char* aPath, - const char* aIntf, - const char* aFunc, - int aFirstArgType, ...) -{ - va_list args; - - va_start(args, aFirstArgType); - DBusMessage* msg = BuildDBusMessage(aPath, aIntf, aFunc, - aFirstArgType, args); - va_end(args); - - if (!msg) { - return false; - } - - return SendWithError(aReply, aError, aTimeout, msg); -} - DBusMessage* RawDBusConnection::BuildDBusMessage(const char* aPath, const char* aIntf, const char* aFunc, diff --git a/ipc/dbus/RawDBusConnection.h b/ipc/dbus/RawDBusConnection.h index 57e5ea838b95d..616a964b3e2ae 100644 --- a/ipc/dbus/RawDBusConnection.h +++ b/ipc/dbus/RawDBusConnection.h @@ -53,15 +53,6 @@ class RawDBusConnection : public AtomicRefCounted int aTimeout, const char* aPath, const char* aIntf, const char *aFunc, int aFirstArgType, ...); - /* Legacy interface, don't use in new code */ - bool SendWithError(DBusMessage** aReply, DBusError* aError, int aTimeout, - DBusMessage* aMessage); - - /* Legacy interface, don't use in new code */ - bool SendWithError(DBusMessage** aReply, DBusError* aError, int aTimeout, - const char* aPath, const char* aIntf, const char* aFunc, - int aFirstArgType, ...); - protected: DBusMessage* BuildDBusMessage(const char* aPath, const char* aIntf, const char* aFunc, int aFirstArgType, From cb24063173a68f4a7f7e4d77fa0f6d8e2420e110 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Tue, 29 Oct 2013 03:20:23 -0700 Subject: [PATCH 18/29] Bumping gaia.json for 1 gaia-central revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/9621d106a3cc Author: Zac Campbell Desc: Python xfail test test_sms_add_contact a=testonly r=me --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 037d8c0a225f1..f8fe9d74d7a86 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "12249906aac39405601b6224b335f7b671dbbeac", + "revision": "9621d106a3cc469f2170533edc41fb8c92a9c7bb", "repo_path": "/integration/gaia-central" } From 249a2d65625197b1ed1692f7ca34a6d1cfef22e7 Mon Sep 17 00:00:00 2001 From: Gene Lian Date: Tue, 29 Oct 2013 16:33:18 +0800 Subject: [PATCH 19/29] Bug 923382 - B2G Multi-SIM: support multiple SIM cards for network metering (a follow-up of bug 887699). r=albert --- dom/network/src/NetworkStatsService.jsm | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/dom/network/src/NetworkStatsService.jsm b/dom/network/src/NetworkStatsService.jsm index 8e325faa4c428..3a0e15b25e811 100644 --- a/dom/network/src/NetworkStatsService.jsm +++ b/dom/network/src/NetworkStatsService.jsm @@ -46,12 +46,6 @@ XPCOMUtils.defineLazyServiceGetter(this, "gSettingsService", "@mozilla.org/settingsService;1", "nsISettingsService"); -XPCOMUtils.defineLazyGetter(this, "gRadioInterface", function () { - let ril = Cc["@mozilla.org/ril;1"].getService(Ci["nsIRadioInterfaceLayer"]); - // TODO: Bug 923382 - B2G Multi-SIM: support multiple SIM cards for network metering. - return ril.getRadioInterface(0); -}); - this.NetworkStatsService = { init: function() { debug("Service started"); @@ -202,10 +196,13 @@ this.NetworkStatsService = { let id = '0'; if (aNetwork.type == NET_TYPE_MOBILE) { - // Bug 904542 will provide the serviceId to map the iccId with the - // nsINetworkInterface of the NetworkManager. Now, lets assume that - // network is mapped with the current iccId of the single SIM. - id = gRadioInterface.rilContext.iccInfo.iccid; + if (!(aNetwork instanceof Ci.nsIRilNetworkInterface)) { + debug("Error! Mobile network should be an nsIRilNetworkInterface!"); + return null; + } + + let rilNetwork = aNetwork.QueryInterface(Ci.nsIRilNetworkInterface); + id = rilNetwork.iccId; } let netId = this.getNetworkId(id, aNetwork.type); From b517671024654a838ded6dad2959007d93ba87f5 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Tue, 29 Oct 2013 04:16:24 -0700 Subject: [PATCH 20/29] Bumping gaia.json for 2 gaia-central revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/b9ca53fe9549 Author: Rex KM Lee Desc: Merge pull request #13165 from rexboy7/fix-bug930944 Bug 930944 - [System] Don't turn screen off after poweroff animation ======== https://hg.mozilla.org/integration/gaia-central/rev/9add16ac90f3 Author: Rex Lee Desc: Bug 930944 - [System] Don't turn screen off after poweroff animation --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index f8fe9d74d7a86..d35572b65cc9d 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "9621d106a3cc469f2170533edc41fb8c92a9c7bb", + "revision": "b9ca53fe9549d230b666d42852470fce002d21ee", "repo_path": "/integration/gaia-central" } From b78f72e864ee84ff71bbb72dae83f0d0d614a85b Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Tue, 29 Oct 2013 05:15:28 -0700 Subject: [PATCH 21/29] Bumping gaia.json for 2 gaia-central revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/6d9dda570404 Author: Zac Desc: Merge pull request #13121 from anah/bug921424 Bug 921424 - Replace wait for landing page after unlocking with wait for displayed app to be homescreen ======== https://hg.mozilla.org/integration/gaia-central/rev/ba50c07ee49a Author: Ana Hristova Desc: Bug 921424 - Replace wait for landing page after unlocking with wait for displayed app to be homescreen --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index d35572b65cc9d..7da02bf3b9f77 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "b9ca53fe9549d230b666d42852470fce002d21ee", + "revision": "6d9dda570404795a91ed5eccb138fa347e1b84c0", "repo_path": "/integration/gaia-central" } From 99c5117a3442af64782843db3657dd1009a30c28 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Tue, 29 Oct 2013 05:30:24 -0700 Subject: [PATCH 22/29] Bumping gaia.json for 1 gaia-central revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/c6c75a2e1654 Author: Zac Campbell Desc: Revert "Bug 921424 - Replace wait for landing page after unlocking with wait for displayed app to be homescreen" This reverts commit 381faaba87ebc6c743b3a3ef46d8b5d3b27e05ec. --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 7da02bf3b9f77..76970a102b622 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "6d9dda570404795a91ed5eccb138fa347e1b84c0", + "revision": "c6c75a2e1654bf2c2089a746ef73cae81dfa270c", "repo_path": "/integration/gaia-central" } From 202dee73a2e76d49f6dab6ab3b1a313f09b88d90 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Tue, 29 Oct 2013 07:05:26 -0700 Subject: [PATCH 23/29] Bumping gaia.json for 2 gaia-central revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/57b0fc0c1199 Author: EragonJ Desc: Merge pull request #12213 from EragonJ/bug-911681 Bug 911681 - [FTU] replace tutorial images for large device ======== https://hg.mozilla.org/integration/gaia-central/rev/b30446d3a85b Author: EragonJ Desc: Bug 911681 - [FTU] replace tutorial images for large device - use IAC - add IAC handler for system app - add IAC handler tests - add tablet support - add TutorialSteps for two devices - add Tutorial related tests - update media_playback to use IAC handler --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 76970a102b622..14895207f25ca 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "c6c75a2e1654bf2c2089a746ef73cae81dfa270c", + "revision": "57b0fc0c1199b3ee2501069eb2a9de0f15a12c20", "repo_path": "/integration/gaia-central" } From 71c09b41d7a5d59c31046793f2006055083c1ece Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Tue, 29 Oct 2013 07:40:24 -0700 Subject: [PATCH 24/29] Bumping gaia.json for 4 gaia-central revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/7b8b98b2b557 Author: Etienne Segonzac Desc: Merge pull request #13090 from etiennesegonzac/bug-917222-dialing-twice Bug 917222 - Making sure we're never dialing the same number twice. r=rik ======== https://hg.mozilla.org/integration/gaia-central/rev/dc0d21d0b8ba Author: Etienne Segonzac Desc: Bug 917222 - Making sure we're never dialing the same number twice. r=rik ======== https://hg.mozilla.org/integration/gaia-central/rev/4bc5d43f27c4 Author: Pavel Ivanov Desc: Merge pull request #13045 from pivanov/bug-929921 Bug 929921 - [Settings-Passcode] Screen Update ======== https://hg.mozilla.org/integration/gaia-central/rev/918886225cbc Author: Pavel Ivanov Desc: Bug 929921 - [Settings-Passcode] Screen Update --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 14895207f25ca..c0a80d64eaabe 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "57b0fc0c1199b3ee2501069eb2a9de0f15a12c20", + "revision": "7b8b98b2b5575b48ca4e3d9573b203264c8f5d42", "repo_path": "/integration/gaia-central" } From cde3fa77beaf3923d27dae95df48dd123398a2ad Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Tue, 29 Oct 2013 07:50:24 -0700 Subject: [PATCH 25/29] Bumping gaia.json for 2 gaia-central revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/744f062af344 Author: Zac Desc: Merge pull request #13067 from AndreiH/bug930042 Bug 930042 - Minor enhancement to test_sms_add_contact ======== https://hg.mozilla.org/integration/gaia-central/rev/ccbd86c0af0f Author: Andrei Hutusoru Desc: Bug 930042 - Minor enhancement to test_sms_add_contact --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index c0a80d64eaabe..ab1f09bac24ea 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "7b8b98b2b5575b48ca4e3d9573b203264c8f5d42", + "revision": "744f062af3441df27e5ae7740482ab42d49ca479", "repo_path": "/integration/gaia-central" } From 211e06c20b81a058119f15f2671eb322abeb6712 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Tue, 29 Oct 2013 08:25:24 -0700 Subject: [PATCH 26/29] Bumping gaia.json for 2 gaia-central revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/6930dd1da9f1 Author: Jose M. Cantera Desc: Merge pull request #13138 from jmcanterafonseca/fb_datastore_final Bug 923637 - Use DataStore instead of indexedDB in the fb_data.js module ======== https://hg.mozilla.org/integration/gaia-central/rev/e6e229c2c9ee Author: Jose M. Cantera Desc: Bug 923637 - Use DataStore instead of indexedDB in the fb_data.js module --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index ab1f09bac24ea..eb7a1c2f63bd5 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "744f062af3441df27e5ae7740482ab42d49ca479", + "revision": "6930dd1da9f19087cd1950402e819550ce669255", "repo_path": "/integration/gaia-central" } From b6da01e6f1ee79e836349f0af2847f17bffe5e38 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Tue, 29 Oct 2013 08:40:25 -0700 Subject: [PATCH 27/29] Bumping gaia.json for 2 gaia-central revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/c97a6a8850ae Author: Ben Kelly Desc: Merge pull request #13043 from wanderview/contacts-size-reflow Bug 921685: Read device geometry info from cookie to avoid sync reflows. r=arcturus ======== https://hg.mozilla.org/integration/gaia-central/rev/1a35f8059551 Author: Ben Kelly Desc: Bug 921685: Read device geometry info from cookie to avoid sync reflows. --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index eb7a1c2f63bd5..70595f894f18c 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "6930dd1da9f19087cd1950402e819550ce669255", + "revision": "c97a6a8850aeacc5bbe7427ae34113132d4b1c78", "repo_path": "/integration/gaia-central" } From 1c21e5d346507f8dccddee5794734c5e1d66c827 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Tue, 29 Oct 2013 08:50:26 -0700 Subject: [PATCH 28/29] Bumping gaia.json for 2 gaia-central revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/11e6c5916cef Author: Ben Kelly Desc: Merge pull request #13075 from wanderview/contacts-export-search-select Bug 930693: Fix checkbox select in export search mode. +shepherd r=arcturus ======== https://hg.mozilla.org/integration/gaia-central/rev/f5e529a3db8c Author: Ben Kelly Desc: Bug 930693: Fix checkbox select in export search mode. +shepherd --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 70595f894f18c..59ee1c2ac5bef 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "c97a6a8850aeacc5bbe7427ae34113132d4b1c78", + "revision": "11e6c5916cef94f6094ab90d21a14b49c3b2fd38", "repo_path": "/integration/gaia-central" } From 38de8ae86d8c15947828dc4a872c575f13949d2b Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Tue, 29 Oct 2013 17:19:02 +0100 Subject: [PATCH 29/29] Bug 930952: Dispatch DBus messages after reading socket, r=qdot DBusWatcher::Poll currently breaks after reading DBus data from the socket. Thus, it never processes the data and dispatches the DBus messages. This patch fixes the code to dispatch DBus messages after reading the DBus socket. --- ipc/dbus/DBusThread.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/ipc/dbus/DBusThread.cpp b/ipc/dbus/DBusThread.cpp index 308af52f24c4a..bc99586ebd76a 100644 --- a/ipc/dbus/DBusThread.cpp +++ b/ipc/dbus/DBusThread.cpp @@ -253,18 +253,19 @@ DBusWatcher::Poll() } } else { short events = mPollData[i].revents; - unsigned int flags = UnixEventsToDBusFlags(events); - dbus_watch_handle(mWatchData[i], flags); mPollData[i].revents = 0; + + dbus_watch_handle(mWatchData[i], UnixEventsToDBusFlags(events)); + + DBusDispatchStatus dbusDispatchStatus; + do { + dbusDispatchStatus = dbus_connection_dispatch(GetConnection()); + } while (dbusDispatchStatus == DBUS_DISPATCH_DATA_REMAINS); + // Break at this point since we don't know if the operation // was destructive break; } - - DBusDispatchStatus dbusDispatchStatus; - do { - dbusDispatchStatus = dbus_connection_dispatch(GetConnection()); - } while (dbusDispatchStatus == DBUS_DISPATCH_DATA_REMAINS); } ++i;