From e7594724d05a3f5ebd4a9550b0eb365ec1183fae Mon Sep 17 00:00:00 2001 From: Vicamo Yang Date: Fri, 26 Sep 2014 13:00:23 +0800 Subject: [PATCH] Bug 833229 - 2.b/4: build voicemail by default. r=smaug --- b2g/installer/package-manifest.in | 2 +- browser/installer/package-manifest.in | 1 + dom/base/Navigator.cpp | 16 ++++++++++------ dom/base/Navigator.h | 6 +++--- dom/moz.build | 2 +- dom/webidl/moz.build | 6 +++--- 6 files changed, 19 insertions(+), 14 deletions(-) diff --git a/b2g/installer/package-manifest.in b/b2g/installer/package-manifest.in index 015400e450f..2e17b08b13b 100644 --- a/b2g/installer/package-manifest.in +++ b/b2g/installer/package-manifest.in @@ -159,7 +159,6 @@ @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 @@ -200,6 +199,7 @@ @BINPATH@/components/dom_threads.xpt @BINPATH@/components/dom_traversal.xpt @BINPATH@/components/dom_views.xpt +@BINPATH@/components/dom_voicemail.xpt #ifdef MOZ_WEBSPEECH @BINPATH@/components/dom_webspeechrecognition.xpt #endif diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in index 472873a375f..5f6bb76cc76 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -211,6 +211,7 @@ @BINPATH@/components/dom_stylesheets.xpt @BINPATH@/components/dom_telephony.xpt @BINPATH@/components/dom_traversal.xpt +@BINPATH@/components/dom_voicemail.xpt #ifdef MOZ_WEBSPEECH @BINPATH@/components/dom_webspeechrecognition.xpt #endif diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp index a16f19b8f7d..c9e0d420294 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -36,6 +36,7 @@ #include "mozilla/dom/MobileMessageManager.h" #include "mozilla/dom/ServiceWorkerContainer.h" #include "mozilla/dom/Telephony.h" +#include "mozilla/dom/Voicemail.h" #include "mozilla/Hal.h" #include "nsISiteSpecificUserAgent.h" #include "mozilla/ClearOnShutdown.h" @@ -50,7 +51,6 @@ #include "mozilla/dom/IccManager.h" #include "mozilla/dom/CellBroadcast.h" #include "mozilla/dom/MobileConnectionArray.h" -#include "mozilla/dom/Voicemail.h" #endif #include "nsIIdleObserver.h" #include "nsIPermissionManager.h" @@ -175,12 +175,12 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Navigator) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPowerManager) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMobileMessageManager) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTelephony) + NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mVoicemail) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mConnection) #ifdef MOZ_B2G_RIL NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMobileConnections) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCellBroadcast) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mIccManager) - NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mVoicemail) #endif #ifdef MOZ_B2G_BT NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBluetooth) @@ -251,6 +251,10 @@ Navigator::Invalidate() mTelephony = nullptr; } + if (mVoicemail) { + mVoicemail = nullptr; + } + if (mConnection) { mConnection->Shutdown(); mConnection = nullptr; @@ -269,10 +273,6 @@ Navigator::Invalidate() mIccManager->Shutdown(); mIccManager = nullptr; } - - if (mVoicemail) { - mVoicemail = nullptr; - } #endif #ifdef MOZ_B2G_BT @@ -1651,6 +1651,8 @@ Navigator::GetMozCellBroadcast(ErrorResult& aRv) return mCellBroadcast; } +#endif // MOZ_B2G_RIL + Voicemail* Navigator::GetMozVoicemail(ErrorResult& aRv) { @@ -1669,6 +1671,8 @@ Navigator::GetMozVoicemail(ErrorResult& aRv) return mVoicemail; } +#ifdef MOZ_B2G_RIL + IccManager* Navigator::GetMozIccManager(ErrorResult& aRv) { diff --git a/dom/base/Navigator.h b/dom/base/Navigator.h index 9171fc78fc1..496d6db8124 100644 --- a/dom/base/Navigator.h +++ b/dom/base/Navigator.h @@ -88,11 +88,11 @@ class BluetoothManager; class CellBroadcast; class IccManager; class MobileConnectionArray; -class Voicemail; #endif class PowerManager; class Telephony; +class Voicemail; namespace time { class TimeManager; @@ -221,6 +221,7 @@ public: DesktopNotificationCenter* GetMozNotification(ErrorResult& aRv); MobileMessageManager* GetMozMobileMessage(); Telephony* GetMozTelephony(ErrorResult& aRv); + Voicemail* GetMozVoicemail(ErrorResult& aRv); network::Connection* GetConnection(ErrorResult& aRv); nsDOMCameraManager* GetMozCameras(ErrorResult& aRv); void MozSetMessageHandler(const nsAString& aType, @@ -234,7 +235,6 @@ public: #ifdef MOZ_B2G_RIL MobileConnectionArray* GetMozMobileConnections(ErrorResult& aRv); CellBroadcast* GetMozCellBroadcast(ErrorResult& aRv); - Voicemail* GetMozVoicemail(ErrorResult& aRv); IccManager* GetMozIccManager(ErrorResult& aRv); #endif // MOZ_B2G_RIL #ifdef MOZ_GAMEPAD @@ -331,12 +331,12 @@ private: nsRefPtr mPowerManager; nsRefPtr mMobileMessageManager; nsRefPtr mTelephony; + nsRefPtr mVoicemail; nsRefPtr mConnection; #ifdef MOZ_B2G_RIL nsRefPtr mMobileConnections; nsRefPtr mCellBroadcast; nsRefPtr mIccManager; - nsRefPtr mVoicemail; #endif #ifdef MOZ_B2G_BT nsRefPtr mBluetooth; diff --git a/dom/moz.build b/dom/moz.build index 3f3f57bed5b..a5181d0b14e 100644 --- a/dom/moz.build +++ b/dom/moz.build @@ -90,6 +90,7 @@ DIRS += [ 'promise', 'smil', 'telephony', + 'voicemail', 'inputmethod', 'webidl', 'xbl', @@ -112,7 +113,6 @@ if CONFIG['MOZ_B2G_RIL']: DIRS += [ 'icc', 'cellbroadcast', - 'voicemail', 'wappush', ] diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build index c6789abf44d..b603b4f040d 100644 --- a/dom/webidl/moz.build +++ b/dom/webidl/moz.build @@ -275,6 +275,8 @@ WEBIDL_FILES = [ 'MozSelfSupport.webidl', 'MozTetheringManager.webidl', 'MozTimeManager.webidl', + 'MozVoicemail.webidl', + 'MozVoicemailStatus.webidl', 'MozWakeLock.webidl', 'MutationEvent.webidl', 'MutationObserver.webidl', @@ -605,8 +607,6 @@ if CONFIG['MOZ_B2G_RIL']: 'MozCellBroadcast.webidl', 'MozIcc.webidl', 'MozIccManager.webidl', - 'MozVoicemail.webidl', - 'MozVoicemailStatus.webidl' ] if CONFIG['MOZ_NFC']: @@ -672,6 +672,7 @@ GENERATED_EVENTS_WEBIDL_FILES = [ 'MozSettingsTransactionEvent.webidl', 'MozSmsEvent.webidl', 'MozStkCommandEvent.webidl', + 'MozVoicemailEvent.webidl', 'PageTransitionEvent.webidl', 'PopStateEvent.webidl', 'PopupBlockedEvent.webidl', @@ -725,7 +726,6 @@ if CONFIG['MOZ_B2G_BT']: if CONFIG['MOZ_B2G_RIL']: GENERATED_EVENTS_WEBIDL_FILES += [ 'MozCellBroadcastEvent.webidl', - 'MozVoicemailEvent.webidl', ] if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':