mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 9bd4fcd6d084 (bug 864485)
This commit is contained in:
parent
342d44f56a
commit
983620f4cb
@ -164,6 +164,7 @@
|
|||||||
@BINPATH@/components/dom_base.xpt
|
@BINPATH@/components/dom_base.xpt
|
||||||
@BINPATH@/components/dom_system.xpt
|
@BINPATH@/components/dom_system.xpt
|
||||||
#ifdef MOZ_B2G_RIL
|
#ifdef MOZ_B2G_RIL
|
||||||
|
@BINPATH@/components/dom_telephony.xpt
|
||||||
@BINPATH@/components/dom_voicemail.xpt
|
@BINPATH@/components/dom_voicemail.xpt
|
||||||
@BINPATH@/components/dom_wifi.xpt
|
@BINPATH@/components/dom_wifi.xpt
|
||||||
@BINPATH@/components/dom_system_gonk.xpt
|
@BINPATH@/components/dom_system_gonk.xpt
|
||||||
@ -202,7 +203,6 @@
|
|||||||
@BINPATH@/components/dom_mobilemessage.xpt
|
@BINPATH@/components/dom_mobilemessage.xpt
|
||||||
@BINPATH@/components/dom_storage.xpt
|
@BINPATH@/components/dom_storage.xpt
|
||||||
@BINPATH@/components/dom_stylesheets.xpt
|
@BINPATH@/components/dom_stylesheets.xpt
|
||||||
@BINPATH@/components/dom_telephony.xpt
|
|
||||||
@BINPATH@/components/dom_threads.xpt
|
@BINPATH@/components/dom_threads.xpt
|
||||||
@BINPATH@/components/dom_traversal.xpt
|
@BINPATH@/components/dom_traversal.xpt
|
||||||
@BINPATH@/components/dom_views.xpt
|
@BINPATH@/components/dom_views.xpt
|
||||||
|
@ -176,6 +176,7 @@
|
|||||||
@BINPATH@/components/dom_base.xpt
|
@BINPATH@/components/dom_base.xpt
|
||||||
@BINPATH@/components/dom_system.xpt
|
@BINPATH@/components/dom_system.xpt
|
||||||
#ifdef MOZ_B2G_RIL
|
#ifdef MOZ_B2G_RIL
|
||||||
|
@BINPATH@/components/dom_telephony.xpt
|
||||||
@BINPATH@/components/dom_voicemail.xpt
|
@BINPATH@/components/dom_voicemail.xpt
|
||||||
@BINPATH@/components/dom_wifi.xpt
|
@BINPATH@/components/dom_wifi.xpt
|
||||||
@BINPATH@/components/dom_system_gonk.xpt
|
@BINPATH@/components/dom_system_gonk.xpt
|
||||||
@ -211,7 +212,6 @@
|
|||||||
@BINPATH@/components/dom_mobilemessage.xpt
|
@BINPATH@/components/dom_mobilemessage.xpt
|
||||||
@BINPATH@/components/dom_storage.xpt
|
@BINPATH@/components/dom_storage.xpt
|
||||||
@BINPATH@/components/dom_stylesheets.xpt
|
@BINPATH@/components/dom_stylesheets.xpt
|
||||||
@BINPATH@/components/dom_telephony.xpt
|
|
||||||
@BINPATH@/components/dom_traversal.xpt
|
@BINPATH@/components/dom_traversal.xpt
|
||||||
#ifdef MOZ_WEBSPEECH
|
#ifdef MOZ_WEBSPEECH
|
||||||
@BINPATH@/components/dom_webspeechrecognition.xpt
|
@BINPATH@/components/dom_webspeechrecognition.xpt
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
#include "MediaManager.h"
|
#include "MediaManager.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef MOZ_B2G_RIL
|
#ifdef MOZ_B2G_RIL
|
||||||
#include "mozilla/dom/telephony/Telephony.h"
|
#include "Telephony.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef MOZ_B2G_BT
|
#ifdef MOZ_B2G_BT
|
||||||
#include "BluetoothManager.h"
|
#include "BluetoothManager.h"
|
||||||
|
@ -168,12 +168,12 @@ DOMInterfaces = {
|
|||||||
|
|
||||||
'CallEvent': {
|
'CallEvent': {
|
||||||
'nativeType': 'mozilla::dom::telephony::CallEvent',
|
'nativeType': 'mozilla::dom::telephony::CallEvent',
|
||||||
'headerFile': 'mozilla/dom/telephony/CallEvent.h',
|
'headerFile': 'CallEvent.h',
|
||||||
},
|
},
|
||||||
|
|
||||||
'CallsList': {
|
'CallsList': {
|
||||||
'nativeType': 'mozilla::dom::telephony::CallsList',
|
'nativeType': 'mozilla::dom::telephony::CallsList',
|
||||||
'headerFile': 'mozilla/dom/telephony/CallsList.h',
|
'headerFile': 'CallsList.h',
|
||||||
},
|
},
|
||||||
|
|
||||||
'CameraControl': {
|
'CameraControl': {
|
||||||
@ -1162,17 +1162,17 @@ DOMInterfaces = {
|
|||||||
|
|
||||||
'Telephony' : {
|
'Telephony' : {
|
||||||
'nativeType': 'mozilla::dom::telephony::Telephony',
|
'nativeType': 'mozilla::dom::telephony::Telephony',
|
||||||
'headerFile': 'mozilla/dom/telephony/Telephony.h',
|
'headerFile': 'Telephony.h',
|
||||||
},
|
},
|
||||||
|
|
||||||
'TelephonyCall' : {
|
'TelephonyCall' : {
|
||||||
'nativeType': 'mozilla::dom::telephony::TelephonyCall',
|
'nativeType': 'mozilla::dom::telephony::TelephonyCall',
|
||||||
'headerFile': 'mozilla/dom/telephony/TelephonyCall.h',
|
'headerFile': 'TelephonyCall.h',
|
||||||
},
|
},
|
||||||
|
|
||||||
'TelephonyCallGroup' : {
|
'TelephonyCallGroup' : {
|
||||||
'nativeType': 'mozilla::dom::telephony::TelephonyCallGroup',
|
'nativeType': 'mozilla::dom::telephony::TelephonyCallGroup',
|
||||||
'headerFile': 'mozilla/dom/telephony/TelephonyCallGroup.h',
|
'headerFile': 'TelephonyCallGroup.h',
|
||||||
},
|
},
|
||||||
|
|
||||||
'Text': {
|
'Text': {
|
||||||
|
@ -1479,7 +1479,7 @@ BluetoothHfpManager::OnConnectSuccess(BluetoothSocket* aSocket)
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsITelephonyProvider> provider =
|
nsCOMPtr<nsITelephonyProvider> provider =
|
||||||
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
|
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
|
||||||
NS_ENSURE_TRUE_VOID(provider);
|
NS_ENSURE_TRUE_VOID(provider);
|
||||||
provider->EnumerateCalls(mListener->GetListener());
|
provider->EnumerateCalls(mListener->GetListener());
|
||||||
|
|
||||||
|
@ -61,11 +61,13 @@ TelephonyListener::EnumerateCallState(uint32_t aCallIndex,
|
|||||||
bool aIsActive,
|
bool aIsActive,
|
||||||
bool aIsOutgoing,
|
bool aIsOutgoing,
|
||||||
bool aIsEmergency,
|
bool aIsEmergency,
|
||||||
bool aIsConference)
|
bool aIsConference,
|
||||||
|
bool* aResult)
|
||||||
{
|
{
|
||||||
BluetoothHfpManager* hfp = BluetoothHfpManager::Get();
|
BluetoothHfpManager* hfp = BluetoothHfpManager::Get();
|
||||||
hfp->HandleCallStateChanged(aCallIndex, aCallState, EmptyString(), aNumber,
|
hfp->HandleCallStateChanged(aCallIndex, aCallState, EmptyString(), aNumber,
|
||||||
aIsOutgoing, false);
|
aIsOutgoing, false);
|
||||||
|
*aResult = true;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,10 +117,10 @@ bool
|
|||||||
BluetoothTelephonyListener::StartListening()
|
BluetoothTelephonyListener::StartListening()
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsITelephonyProvider> provider =
|
nsCOMPtr<nsITelephonyProvider> provider =
|
||||||
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
|
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
|
||||||
NS_ENSURE_TRUE(provider, false);
|
NS_ENSURE_TRUE(provider, false);
|
||||||
|
|
||||||
nsresult rv = provider->RegisterListener(mTelephonyListener);
|
nsresult rv = provider->RegisterTelephonyMsg(mTelephonyListener);
|
||||||
NS_ENSURE_SUCCESS(rv, false);
|
NS_ENSURE_SUCCESS(rv, false);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -128,10 +130,10 @@ bool
|
|||||||
BluetoothTelephonyListener::StopListening()
|
BluetoothTelephonyListener::StopListening()
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsITelephonyProvider> provider =
|
nsCOMPtr<nsITelephonyProvider> provider =
|
||||||
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
|
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
|
||||||
NS_ENSURE_TRUE(provider, false);
|
NS_ENSURE_TRUE(provider, false);
|
||||||
|
|
||||||
nsresult rv = provider->UnregisterListener(mTelephonyListener);
|
nsresult rv = provider->UnregisterTelephonyMsg(mTelephonyListener);
|
||||||
|
|
||||||
return NS_FAILED(rv) ? false : true;
|
return NS_FAILED(rv) ? false : true;
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,7 @@ DOM_SRCDIRS = \
|
|||||||
ifdef MOZ_B2G_RIL
|
ifdef MOZ_B2G_RIL
|
||||||
DOM_SRCDIRS += \
|
DOM_SRCDIRS += \
|
||||||
dom/system/gonk \
|
dom/system/gonk \
|
||||||
|
dom/telephony \
|
||||||
dom/wifi \
|
dom/wifi \
|
||||||
dom/icc/src \
|
dom/icc/src \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
@ -96,7 +96,6 @@
|
|||||||
|
|
||||||
#include "mozilla/dom/indexedDB/PIndexedDBChild.h"
|
#include "mozilla/dom/indexedDB/PIndexedDBChild.h"
|
||||||
#include "mozilla/dom/mobilemessage/SmsChild.h"
|
#include "mozilla/dom/mobilemessage/SmsChild.h"
|
||||||
#include "mozilla/dom/telephony/TelephonyChild.h"
|
|
||||||
#include "mozilla/dom/devicestorage/DeviceStorageRequestChild.h"
|
#include "mozilla/dom/devicestorage/DeviceStorageRequestChild.h"
|
||||||
#include "mozilla/dom/bluetooth/PBluetoothChild.h"
|
#include "mozilla/dom/bluetooth/PBluetoothChild.h"
|
||||||
#include "mozilla/dom/PFMRadioChild.h"
|
#include "mozilla/dom/PFMRadioChild.h"
|
||||||
@ -127,7 +126,6 @@ using namespace mozilla::dom::devicestorage;
|
|||||||
using namespace mozilla::dom::ipc;
|
using namespace mozilla::dom::ipc;
|
||||||
using namespace mozilla::dom::mobilemessage;
|
using namespace mozilla::dom::mobilemessage;
|
||||||
using namespace mozilla::dom::indexedDB;
|
using namespace mozilla::dom::indexedDB;
|
||||||
using namespace mozilla::dom::telephony;
|
|
||||||
using namespace mozilla::hal_sandbox;
|
using namespace mozilla::hal_sandbox;
|
||||||
using namespace mozilla::ipc;
|
using namespace mozilla::ipc;
|
||||||
using namespace mozilla::layers;
|
using namespace mozilla::layers;
|
||||||
@ -921,19 +919,6 @@ ContentChild::DeallocPSmsChild(PSmsChild* aSms)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PTelephonyChild*
|
|
||||||
ContentChild::AllocPTelephonyChild()
|
|
||||||
{
|
|
||||||
MOZ_CRASH("No one should be allocating PTelephonyChild actors");
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
ContentChild::DeallocPTelephonyChild(PTelephonyChild* aActor)
|
|
||||||
{
|
|
||||||
delete aActor;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
PStorageChild*
|
PStorageChild*
|
||||||
ContentChild::AllocPStorageChild()
|
ContentChild::AllocPStorageChild()
|
||||||
{
|
{
|
||||||
|
@ -152,9 +152,6 @@ public:
|
|||||||
virtual PSmsChild* AllocPSmsChild();
|
virtual PSmsChild* AllocPSmsChild();
|
||||||
virtual bool DeallocPSmsChild(PSmsChild*);
|
virtual bool DeallocPSmsChild(PSmsChild*);
|
||||||
|
|
||||||
virtual PTelephonyChild* AllocPTelephonyChild();
|
|
||||||
virtual bool DeallocPTelephonyChild(PTelephonyChild*);
|
|
||||||
|
|
||||||
virtual PStorageChild* AllocPStorageChild();
|
virtual PStorageChild* AllocPStorageChild();
|
||||||
virtual bool DeallocPStorageChild(PStorageChild* aActor);
|
virtual bool DeallocPStorageChild(PStorageChild* aActor);
|
||||||
|
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
#include "mozilla/dom/bluetooth/PBluetoothParent.h"
|
#include "mozilla/dom/bluetooth/PBluetoothParent.h"
|
||||||
#include "mozilla/dom/PFMRadioParent.h"
|
#include "mozilla/dom/PFMRadioParent.h"
|
||||||
#include "mozilla/dom/devicestorage/DeviceStorageRequestParent.h"
|
#include "mozilla/dom/devicestorage/DeviceStorageRequestParent.h"
|
||||||
#include "mozilla/dom/telephony/TelephonyParent.h"
|
|
||||||
#include "SmsParent.h"
|
#include "SmsParent.h"
|
||||||
#include "mozilla/Hal.h"
|
#include "mozilla/Hal.h"
|
||||||
#include "mozilla/hal_sandbox/PHalParent.h"
|
#include "mozilla/hal_sandbox/PHalParent.h"
|
||||||
@ -148,7 +147,6 @@ using namespace mozilla::dom::devicestorage;
|
|||||||
using namespace mozilla::dom::indexedDB;
|
using namespace mozilla::dom::indexedDB;
|
||||||
using namespace mozilla::dom::power;
|
using namespace mozilla::dom::power;
|
||||||
using namespace mozilla::dom::mobilemessage;
|
using namespace mozilla::dom::mobilemessage;
|
||||||
using namespace mozilla::dom::telephony;
|
|
||||||
using namespace mozilla::hal;
|
using namespace mozilla::hal;
|
||||||
using namespace mozilla::idl;
|
using namespace mozilla::idl;
|
||||||
using namespace mozilla::ipc;
|
using namespace mozilla::ipc;
|
||||||
@ -2248,25 +2246,6 @@ ContentParent::DeallocPSmsParent(PSmsParent* aSms)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PTelephonyParent*
|
|
||||||
ContentParent::AllocPTelephonyParent()
|
|
||||||
{
|
|
||||||
if (!AssertAppProcessPermission(this, "telephony")) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
TelephonyParent* actor = new TelephonyParent();
|
|
||||||
NS_ADDREF(actor);
|
|
||||||
return actor;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
ContentParent::DeallocPTelephonyParent(PTelephonyParent* aActor)
|
|
||||||
{
|
|
||||||
static_cast<TelephonyParent*>(aActor)->Release();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
PStorageParent*
|
PStorageParent*
|
||||||
ContentParent::AllocPStorageParent()
|
ContentParent::AllocPStorageParent()
|
||||||
{
|
{
|
||||||
|
@ -321,9 +321,6 @@ private:
|
|||||||
virtual PSmsParent* AllocPSmsParent();
|
virtual PSmsParent* AllocPSmsParent();
|
||||||
virtual bool DeallocPSmsParent(PSmsParent*);
|
virtual bool DeallocPSmsParent(PSmsParent*);
|
||||||
|
|
||||||
virtual PTelephonyParent* AllocPTelephonyParent();
|
|
||||||
virtual bool DeallocPTelephonyParent(PTelephonyParent*);
|
|
||||||
|
|
||||||
virtual PStorageParent* AllocPStorageParent();
|
virtual PStorageParent* AllocPStorageParent();
|
||||||
virtual bool DeallocPStorageParent(PStorageParent* aActor);
|
virtual bool DeallocPStorageParent(PStorageParent* aActor);
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@ LOCAL_INCLUDES += $(VPATH:%=-I%)
|
|||||||
|
|
||||||
ifdef MOZ_B2G_RIL
|
ifdef MOZ_B2G_RIL
|
||||||
LOCAL_INCLUDES += \
|
LOCAL_INCLUDES += \
|
||||||
|
-I$(topsrcdir)/dom/telephony \
|
||||||
-I$(topsrcdir)/dom/system/gonk \
|
-I$(topsrcdir)/dom/system/gonk \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
endif
|
endif
|
||||||
|
@ -72,8 +72,7 @@ PARALLEL_DIRS += [
|
|||||||
'camera',
|
'camera',
|
||||||
'audiochannel',
|
'audiochannel',
|
||||||
'promise',
|
'promise',
|
||||||
'wappush',
|
'wappush'
|
||||||
'telephony',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
if CONFIG['OS_ARCH'] == 'WINNT':
|
if CONFIG['OS_ARCH'] == 'WINNT':
|
||||||
@ -81,6 +80,7 @@ if CONFIG['OS_ARCH'] == 'WINNT':
|
|||||||
|
|
||||||
if CONFIG['MOZ_B2G_RIL']:
|
if CONFIG['MOZ_B2G_RIL']:
|
||||||
PARALLEL_DIRS += [
|
PARALLEL_DIRS += [
|
||||||
|
'telephony',
|
||||||
'wifi',
|
'wifi',
|
||||||
'icc',
|
'icc',
|
||||||
'cellbroadcast',
|
'cellbroadcast',
|
||||||
|
@ -26,6 +26,7 @@ include $(topsrcdir)/dom/dom-config.mk
|
|||||||
LOCAL_INCLUDES = \
|
LOCAL_INCLUDES = \
|
||||||
-I$(topsrcdir)/dom/base \
|
-I$(topsrcdir)/dom/base \
|
||||||
-I$(topsrcdir)/dom/src/geolocation \
|
-I$(topsrcdir)/dom/src/geolocation \
|
||||||
|
-I$(topsrcdir)/dom/telephony \
|
||||||
-I$(topsrcdir)/dom/wifi \
|
-I$(topsrcdir)/dom/wifi \
|
||||||
-I$(topsrcdir)/dom/bluetooth \
|
-I$(topsrcdir)/dom/bluetooth \
|
||||||
-I$(topsrcdir)/content/events/src \
|
-I$(topsrcdir)/content/events/src \
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
USING_TELEPHONY_NAMESPACE
|
USING_TELEPHONY_NAMESPACE
|
||||||
using namespace mozilla::dom;
|
using namespace mozilla::dom;
|
||||||
using mozilla::ErrorResult;
|
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
already_AddRefed<CallEvent>
|
already_AddRefed<CallEvent>
|
||||||
|
@ -5,18 +5,11 @@
|
|||||||
DEPTH = @DEPTH@
|
DEPTH = @DEPTH@
|
||||||
topsrcdir = @top_srcdir@
|
topsrcdir = @top_srcdir@
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
VPATH = \
|
VPATH = @srcdir@
|
||||||
$(srcdir) \
|
|
||||||
$(srcdir)/ipc \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
|
||||||
include $(topsrcdir)/dom/dom-config.mk
|
include $(topsrcdir)/dom/dom-config.mk
|
||||||
|
|
||||||
# Add VPATH to LOCAL_INCLUDES so we are going to include the correct backend
|
|
||||||
# subdirectory (and the ipc one).
|
|
||||||
LOCAL_INCLUDES = $(VPATH:%=-I%)
|
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
include $(topsrcdir)/config/rules.mk
|
||||||
include $(topsrcdir)/ipc/chromium/chromium-config.mk
|
|
||||||
|
@ -24,9 +24,10 @@
|
|||||||
#include "TelephonyCall.h"
|
#include "TelephonyCall.h"
|
||||||
#include "TelephonyCallGroup.h"
|
#include "TelephonyCallGroup.h"
|
||||||
|
|
||||||
|
#define NS_RILCONTENTHELPER_CONTRACTID "@mozilla.org/ril/content-helper;1"
|
||||||
|
|
||||||
USING_TELEPHONY_NAMESPACE
|
USING_TELEPHONY_NAMESPACE
|
||||||
using namespace mozilla::dom;
|
using namespace mozilla::dom;
|
||||||
using mozilla::ErrorResult;
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@ -50,8 +51,6 @@ public:
|
|||||||
MOZ_ASSERT(mTelephony);
|
MOZ_ASSERT(mTelephony);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~Listener() {}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Disconnect()
|
Disconnect()
|
||||||
{
|
{
|
||||||
@ -112,7 +111,7 @@ Telephony::Shutdown()
|
|||||||
mListener->Disconnect();
|
mListener->Disconnect();
|
||||||
|
|
||||||
if (mProvider) {
|
if (mProvider) {
|
||||||
mProvider->UnregisterListener(mListener);
|
mProvider->UnregisterTelephonyMsg(mListener);
|
||||||
mProvider = nullptr;
|
mProvider = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,7 +132,7 @@ Telephony::Create(nsPIDOMWindow* aOwner, ErrorResult& aRv)
|
|||||||
NS_ASSERTION(aOwner, "Null owner!");
|
NS_ASSERTION(aOwner, "Null owner!");
|
||||||
|
|
||||||
nsCOMPtr<nsITelephonyProvider> ril =
|
nsCOMPtr<nsITelephonyProvider> ril =
|
||||||
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
|
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
|
||||||
if (!ril) {
|
if (!ril) {
|
||||||
aRv.Throw(NS_ERROR_UNEXPECTED);
|
aRv.Throw(NS_ERROR_UNEXPECTED);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -166,7 +165,7 @@ Telephony::Create(nsPIDOMWindow* aOwner, ErrorResult& aRv)
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
rv = ril->RegisterListener(telephony->mListener);
|
rv = ril->RegisterTelephonyMsg(telephony->mListener);
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
aRv.Throw(rv);
|
aRv.Throw(rv);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -223,7 +222,12 @@ Telephony::DialInternal(bool isEmergency,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult rv = mProvider->Dial(aNumber, isEmergency);
|
nsresult rv;
|
||||||
|
if (isEmergency) {
|
||||||
|
rv = mProvider->DialEmergency(aNumber);
|
||||||
|
} else {
|
||||||
|
rv = mProvider->Dial(aNumber);
|
||||||
|
}
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
aRv.Throw(rv);
|
aRv.Throw(rv);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -587,7 +591,7 @@ NS_IMETHODIMP
|
|||||||
Telephony::EnumerateCallState(uint32_t aCallIndex, uint16_t aCallState,
|
Telephony::EnumerateCallState(uint32_t aCallIndex, uint16_t aCallState,
|
||||||
const nsAString& aNumber, bool aIsActive,
|
const nsAString& aNumber, bool aIsActive,
|
||||||
bool aIsOutgoing, bool aIsEmergency,
|
bool aIsOutgoing, bool aIsEmergency,
|
||||||
bool aIsConference)
|
bool aIsConference, bool* aContinue)
|
||||||
{
|
{
|
||||||
nsRefPtr<TelephonyCall> call;
|
nsRefPtr<TelephonyCall> call;
|
||||||
|
|
||||||
@ -599,10 +603,12 @@ Telephony::EnumerateCallState(uint32_t aCallIndex, uint16_t aCallState,
|
|||||||
call = aIsConference ? mGroup->GetCall(aCallIndex) : GetCall(aCallIndex);
|
call = aIsConference ? mGroup->GetCall(aCallIndex) : GetCall(aCallIndex);
|
||||||
if (call) {
|
if (call) {
|
||||||
// We have the call either in mCalls or in mGroup. Skip it.
|
// We have the call either in mCalls or in mGroup. Skip it.
|
||||||
|
*aContinue = true;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MoveCall(aCallIndex, aIsConference)) {
|
if (MoveCall(aCallIndex, aIsConference)) {
|
||||||
|
*aContinue = true;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -616,6 +622,7 @@ Telephony::EnumerateCallState(uint32_t aCallIndex, uint16_t aCallState,
|
|||||||
mCalls.Contains(call),
|
mCalls.Contains(call),
|
||||||
"Should have auto-added new call!");
|
"Should have auto-added new call!");
|
||||||
|
|
||||||
|
*aContinue = true;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
USING_TELEPHONY_NAMESPACE
|
USING_TELEPHONY_NAMESPACE
|
||||||
using namespace mozilla::dom;
|
using namespace mozilla::dom;
|
||||||
using mozilla::ErrorResult;
|
|
||||||
|
|
||||||
// static
|
// static
|
||||||
already_AddRefed<TelephonyCall>
|
already_AddRefed<TelephonyCall>
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
USING_TELEPHONY_NAMESPACE
|
USING_TELEPHONY_NAMESPACE
|
||||||
using namespace mozilla::dom;
|
using namespace mozilla::dom;
|
||||||
using mozilla::ErrorResult;
|
|
||||||
|
|
||||||
TelephonyCallGroup::TelephonyCallGroup()
|
TelephonyCallGroup::TelephonyCallGroup()
|
||||||
: mCallState(nsITelephonyProvider::CALL_STATE_UNKNOWN)
|
: mCallState(nsITelephonyProvider::CALL_STATE_UNKNOWN)
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
||||||
|
|
||||||
#include "mozilla/dom/telephony/TelephonyFactory.h"
|
|
||||||
#include "nsServiceManagerUtils.h"
|
|
||||||
#include "nsXULAppAPI.h"
|
|
||||||
#include "TelephonyIPCProvider.h"
|
|
||||||
|
|
||||||
USING_TELEPHONY_NAMESPACE
|
|
||||||
|
|
||||||
/* static */ already_AddRefed<nsITelephonyProvider>
|
|
||||||
TelephonyFactory::CreateTelephonyProvider()
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsITelephonyProvider> provider;
|
|
||||||
|
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
|
||||||
provider = new TelephonyIPCProvider();
|
|
||||||
}
|
|
||||||
|
|
||||||
return provider.forget();
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
||||||
|
|
||||||
#ifndef mozilla_dom_telephony_TelephonyFactory_h
|
|
||||||
#define mozilla_dom_telephony_TelephonyFactory_h
|
|
||||||
|
|
||||||
#include "nsCOMPtr.h"
|
|
||||||
#include "mozilla/dom/telephony/TelephonyCommon.h"
|
|
||||||
|
|
||||||
class nsITelephonyProvider;
|
|
||||||
|
|
||||||
BEGIN_TELEPHONY_NAMESPACE
|
|
||||||
|
|
||||||
class TelephonyFactory
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static already_AddRefed<nsITelephonyProvider> CreateTelephonyProvider();
|
|
||||||
};
|
|
||||||
|
|
||||||
END_TELEPHONY_NAMESPACE
|
|
||||||
|
|
||||||
#endif // mozilla_dom_telephony_TelephonyFactory_h
|
|
@ -1,130 +0,0 @@
|
|||||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
||||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
||||||
|
|
||||||
#include "TelephonyChild.h"
|
|
||||||
|
|
||||||
USING_TELEPHONY_NAMESPACE
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* TelephonyChild
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
TelephonyChild::TelephonyChild(nsITelephonyListener* aListener)
|
|
||||||
: mListener(aListener)
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(aListener);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
TelephonyChild::ActorDestroy(ActorDestroyReason aWhy)
|
|
||||||
{
|
|
||||||
mListener = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
PTelephonyRequestChild*
|
|
||||||
TelephonyChild::AllocPTelephonyRequestChild()
|
|
||||||
{
|
|
||||||
MOZ_CRASH("Caller is supposed to manually construct a request!");
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyChild::DeallocPTelephonyRequestChild(PTelephonyRequestChild* aActor)
|
|
||||||
{
|
|
||||||
delete aActor;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyChild::RecvNotifyCallError(const int32_t& aCallIndex,
|
|
||||||
const nsString& aError)
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(mListener);
|
|
||||||
|
|
||||||
mListener->NotifyError(aCallIndex, aError);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyChild::RecvNotifyCallStateChanged(const IPCCallStateData& aData)
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(mListener);
|
|
||||||
|
|
||||||
mListener->CallStateChanged(aData.callIndex(),
|
|
||||||
aData.callState(),
|
|
||||||
aData.number(),
|
|
||||||
aData.isActive(),
|
|
||||||
aData.isOutGoing(),
|
|
||||||
aData.isEmergency(),
|
|
||||||
aData.isConference());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyChild::RecvNotifyCdmaCallWaiting(const nsString& aNumber)
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(mListener);
|
|
||||||
|
|
||||||
mListener->NotifyCdmaCallWaiting(aNumber);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyChild::RecvNotifyConferenceCallStateChanged(const uint16_t& aCallState)
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(mListener);
|
|
||||||
|
|
||||||
mListener->ConferenceCallStateChanged(aCallState);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyChild::RecvNotifySupplementaryService(const int32_t& aCallIndex,
|
|
||||||
const uint16_t& aNotification)
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(mListener);
|
|
||||||
|
|
||||||
mListener->SupplementaryServiceNotification(aCallIndex, aNotification);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* TelephonyRequestChild
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
TelephonyRequestChild::TelephonyRequestChild(nsITelephonyListener* aListener)
|
|
||||||
: mListener(aListener)
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(aListener);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
TelephonyRequestChild::ActorDestroy(ActorDestroyReason aWhy)
|
|
||||||
{
|
|
||||||
mListener = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyRequestChild::Recv__delete__()
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(mListener);
|
|
||||||
|
|
||||||
mListener->EnumerateCallStateComplete();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyRequestChild::RecvNotifyEnumerateCallState(const IPCCallStateData& aData)
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(mListener);
|
|
||||||
|
|
||||||
mListener->EnumerateCallState(aData.callIndex(),
|
|
||||||
aData.callState(),
|
|
||||||
aData.number(),
|
|
||||||
aData.isActive(),
|
|
||||||
aData.isOutGoing(),
|
|
||||||
aData.isEmergency(),
|
|
||||||
aData.isConference());
|
|
||||||
return true;
|
|
||||||
}
|
|
@ -1,77 +0,0 @@
|
|||||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
||||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
||||||
|
|
||||||
#ifndef mozilla_dom_telephony_TelephonyChild_h
|
|
||||||
#define mozilla_dom_telephony_TelephonyChild_h
|
|
||||||
|
|
||||||
#include "mozilla/dom/telephony/TelephonyCommon.h"
|
|
||||||
#include "mozilla/dom/telephony/PTelephonyChild.h"
|
|
||||||
#include "mozilla/dom/telephony/PTelephonyRequestChild.h"
|
|
||||||
#include "nsITelephonyProvider.h"
|
|
||||||
|
|
||||||
BEGIN_TELEPHONY_NAMESPACE
|
|
||||||
|
|
||||||
class TelephonyChild : public PTelephonyChild
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
TelephonyChild(nsITelephonyListener* aListener);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual ~TelephonyChild() {}
|
|
||||||
|
|
||||||
virtual void
|
|
||||||
ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual PTelephonyRequestChild*
|
|
||||||
AllocPTelephonyRequestChild() MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
DeallocPTelephonyRequestChild(PTelephonyRequestChild* aActor) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvNotifyCallError(const int32_t& aCallIndex,
|
|
||||||
const nsString& aError) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvNotifyCallStateChanged(const IPCCallStateData& aData) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvNotifyCdmaCallWaiting(const nsString& aNumber) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvNotifyConferenceCallStateChanged(const uint16_t& aCallState) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvNotifySupplementaryService(const int32_t& aCallIndex,
|
|
||||||
const uint16_t& aNotification) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
private:
|
|
||||||
nsCOMPtr<nsITelephonyListener> mListener;
|
|
||||||
};
|
|
||||||
|
|
||||||
class TelephonyRequestChild : public PTelephonyRequestChild
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
TelephonyRequestChild(nsITelephonyListener* aListener);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual ~TelephonyRequestChild() {}
|
|
||||||
|
|
||||||
virtual void
|
|
||||||
ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
Recv__delete__() MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvNotifyEnumerateCallState(const IPCCallStateData& aData) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
private:
|
|
||||||
nsCOMPtr<nsITelephonyListener> mListener;
|
|
||||||
};
|
|
||||||
|
|
||||||
END_TELEPHONY_NAMESPACE
|
|
||||||
|
|
||||||
#endif // mozilla_dom_telephony_TelephonyChild_h
|
|
@ -1,258 +0,0 @@
|
|||||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
||||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
||||||
|
|
||||||
#include "mozilla/dom/ContentChild.h"
|
|
||||||
#include "TelephonyChild.h"
|
|
||||||
#include "TelephonyIPCProvider.h"
|
|
||||||
|
|
||||||
USING_TELEPHONY_NAMESPACE
|
|
||||||
using namespace mozilla::dom;
|
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS2(TelephonyIPCProvider,
|
|
||||||
nsITelephonyProvider,
|
|
||||||
nsITelephonyListener)
|
|
||||||
|
|
||||||
TelephonyIPCProvider::TelephonyIPCProvider()
|
|
||||||
{
|
|
||||||
// Deallocated in ContentChild::DeallocPTelephonyChild().
|
|
||||||
mPTelephonyChild = new TelephonyChild(this);
|
|
||||||
ContentChild::GetSingleton()->SendPTelephonyConstructor(mPTelephonyChild);
|
|
||||||
}
|
|
||||||
|
|
||||||
TelephonyIPCProvider::~TelephonyIPCProvider()
|
|
||||||
{
|
|
||||||
mPTelephonyChild->Send__delete__(mPTelephonyChild);
|
|
||||||
mPTelephonyChild = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Implementation of nsITelephonyProvider.
|
|
||||||
*/
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::RegisterListener(nsITelephonyListener *aListener)
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(!mListeners.Contains(aListener));
|
|
||||||
|
|
||||||
// nsTArray doesn't fail.
|
|
||||||
mListeners.AppendElement(aListener);
|
|
||||||
|
|
||||||
if (mListeners.Length() == 1) {
|
|
||||||
mPTelephonyChild->SendRegisterListener();
|
|
||||||
}
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::UnregisterListener(nsITelephonyListener *aListener)
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(mListeners.Contains(aListener));
|
|
||||||
|
|
||||||
// We always have the element here, so it can't fail.
|
|
||||||
mListeners.RemoveElement(aListener);
|
|
||||||
|
|
||||||
if (!mListeners.Length()) {
|
|
||||||
mPTelephonyChild->SendUnregisterListener();
|
|
||||||
}
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::EnumerateCalls(nsITelephonyListener *aListener)
|
|
||||||
{
|
|
||||||
// Life time of newly allocated TelephonyRequestChild instance is managed by
|
|
||||||
// IPDL itself.
|
|
||||||
TelephonyRequestChild* actor = new TelephonyRequestChild(aListener);
|
|
||||||
mPTelephonyChild->SendPTelephonyRequestConstructor(actor);
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::Dial(const nsAString& aNumber,
|
|
||||||
bool aIsEmergency)
|
|
||||||
{
|
|
||||||
mPTelephonyChild->SendDialCall(nsString(aNumber), aIsEmergency);
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::HangUp(uint32_t aCallIndex)
|
|
||||||
{
|
|
||||||
mPTelephonyChild->SendHangUpCall(aCallIndex);
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::AnswerCall(uint32_t aCallIndex)
|
|
||||||
{
|
|
||||||
mPTelephonyChild->SendAnswerCall(aCallIndex);
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::RejectCall(uint32_t aCallIndex)
|
|
||||||
{
|
|
||||||
mPTelephonyChild->SendRejectCall(aCallIndex);
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::HoldCall(uint32_t aCallIndex)
|
|
||||||
{
|
|
||||||
mPTelephonyChild->SendHoldCall(aCallIndex);
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::ResumeCall(uint32_t aCallIndex)
|
|
||||||
{
|
|
||||||
mPTelephonyChild->SendResumeCall(aCallIndex);
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::ConferenceCall()
|
|
||||||
{
|
|
||||||
mPTelephonyChild->SendConferenceCall();
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::SeparateCall(uint32_t aCallIndex)
|
|
||||||
{
|
|
||||||
mPTelephonyChild->SendSeparateCall(aCallIndex);
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::HoldConference()
|
|
||||||
{
|
|
||||||
mPTelephonyChild->SendHoldConference();
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::ResumeConference()
|
|
||||||
{
|
|
||||||
mPTelephonyChild->SendResumeConference();
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::StartTone(const nsAString& aDtmfChar)
|
|
||||||
{
|
|
||||||
mPTelephonyChild->SendStartTone(nsString(aDtmfChar));
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::StopTone()
|
|
||||||
{
|
|
||||||
mPTelephonyChild->SendStopTone();
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::GetMicrophoneMuted(bool* aMuted)
|
|
||||||
{
|
|
||||||
mPTelephonyChild->SendGetMicrophoneMuted(aMuted);
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::SetMicrophoneMuted(bool aMuted)
|
|
||||||
{
|
|
||||||
mPTelephonyChild->SendSetMicrophoneMuted(aMuted);
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::GetSpeakerEnabled(bool* aEnabled)
|
|
||||||
{
|
|
||||||
mPTelephonyChild->SendGetSpeakerEnabled(aEnabled);
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::SetSpeakerEnabled(bool aEnabled)
|
|
||||||
{
|
|
||||||
mPTelephonyChild->SendSetSpeakerEnabled(aEnabled);
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
// nsITelephonyListener
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::CallStateChanged(uint32_t aCallIndex,
|
|
||||||
uint16_t aCallState,
|
|
||||||
const nsAString& aNumber,
|
|
||||||
bool aIsActive,
|
|
||||||
bool aIsOutgoing,
|
|
||||||
bool aIsEmergency,
|
|
||||||
bool aIsConference)
|
|
||||||
{
|
|
||||||
for (uint32_t i = 0; i < mListeners.Length(); i++) {
|
|
||||||
mListeners[i]->CallStateChanged(aCallIndex, aCallState, aNumber,
|
|
||||||
aIsActive, aIsOutgoing, aIsEmergency,
|
|
||||||
aIsConference);
|
|
||||||
}
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::ConferenceCallStateChanged(uint16_t aCallState)
|
|
||||||
{
|
|
||||||
for (uint32_t i = 0; i < mListeners.Length(); i++) {
|
|
||||||
mListeners[i]->ConferenceCallStateChanged(aCallState);
|
|
||||||
}
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::EnumerateCallStateComplete()
|
|
||||||
{
|
|
||||||
MOZ_CRASH("Not a EnumerateCalls request!");
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::EnumerateCallState(uint32_t aCallIndex,
|
|
||||||
uint16_t aCallState,
|
|
||||||
const nsAString& aNumber,
|
|
||||||
bool aIsActive,
|
|
||||||
bool aIsOutgoing,
|
|
||||||
bool aIsEmergency,
|
|
||||||
bool aIsConference)
|
|
||||||
{
|
|
||||||
MOZ_CRASH("Not a EnumerateCalls request!");
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::NotifyCdmaCallWaiting(const nsAString& aNumber)
|
|
||||||
{
|
|
||||||
for (uint32_t i = 0; i < mListeners.Length(); i++) {
|
|
||||||
mListeners[i]->NotifyCdmaCallWaiting(aNumber);
|
|
||||||
}
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::NotifyError(int32_t aCallIndex,
|
|
||||||
const nsAString& aError)
|
|
||||||
{
|
|
||||||
for (uint32_t i = 0; i < mListeners.Length(); i++) {
|
|
||||||
mListeners[i]->NotifyError(aCallIndex, aError);
|
|
||||||
}
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyIPCProvider::SupplementaryServiceNotification(int32_t aCallIndex,
|
|
||||||
uint16_t aNotification)
|
|
||||||
{
|
|
||||||
for (uint32_t i = 0; i < mListeners.Length(); i++) {
|
|
||||||
mListeners[i]->SupplementaryServiceNotification(aCallIndex, aNotification);
|
|
||||||
}
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
||||||
|
|
||||||
#ifndef mozilla_dom_telephony_TelephonyIPCProvider_h
|
|
||||||
#define mozilla_dom_telephony_TelephonyIPCProvider_h
|
|
||||||
|
|
||||||
#include "mozilla/dom/telephony/TelephonyCommon.h"
|
|
||||||
#include "mozilla/Attributes.h"
|
|
||||||
#include "nsITelephonyProvider.h"
|
|
||||||
|
|
||||||
BEGIN_TELEPHONY_NAMESPACE
|
|
||||||
|
|
||||||
class PTelephonyChild;
|
|
||||||
|
|
||||||
class TelephonyIPCProvider MOZ_FINAL : public nsITelephonyProvider
|
|
||||||
, public nsITelephonyListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
NS_DECL_ISUPPORTS
|
|
||||||
NS_DECL_NSITELEPHONYPROVIDER
|
|
||||||
NS_DECL_NSITELEPHONYLISTENER
|
|
||||||
|
|
||||||
TelephonyIPCProvider();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual ~TelephonyIPCProvider();
|
|
||||||
|
|
||||||
private:
|
|
||||||
nsTArray<nsCOMPtr<nsITelephonyListener> > mListeners;
|
|
||||||
PTelephonyChild* mPTelephonyChild;
|
|
||||||
};
|
|
||||||
|
|
||||||
END_TELEPHONY_NAMESPACE
|
|
||||||
|
|
||||||
#endif // mozilla_dom_telephony_TelephonyIPCProvider_h
|
|
@ -1,448 +0,0 @@
|
|||||||
/* -*- Mode: C++ tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
||||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
||||||
|
|
||||||
#include "TelephonyParent.h"
|
|
||||||
|
|
||||||
USING_TELEPHONY_NAMESPACE
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* TelephonyParent
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS1(TelephonyParent, nsITelephonyListener)
|
|
||||||
|
|
||||||
TelephonyParent::TelephonyParent()
|
|
||||||
: mActorDestroyed(false)
|
|
||||||
, mRegistered(false)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
TelephonyParent::ActorDestroy(ActorDestroyReason why)
|
|
||||||
{
|
|
||||||
// The child process could die before this asynchronous notification, in which
|
|
||||||
// case ActorDestroy() was called and mActorDestroyed is set to true. Return
|
|
||||||
// an error here to avoid sending a message to the dead process.
|
|
||||||
mActorDestroyed = true;
|
|
||||||
|
|
||||||
// Try to unregister listener if we're still registered.
|
|
||||||
RecvUnregisterListener();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyParent::RecvPTelephonyRequestConstructor(PTelephonyRequestParent* aActor)
|
|
||||||
{
|
|
||||||
TelephonyRequestParent* actor = static_cast<TelephonyRequestParent*>(aActor);
|
|
||||||
|
|
||||||
return actor->DoRequest();
|
|
||||||
}
|
|
||||||
|
|
||||||
PTelephonyRequestParent*
|
|
||||||
TelephonyParent::AllocPTelephonyRequestParent()
|
|
||||||
{
|
|
||||||
TelephonyRequestParent* actor = new TelephonyRequestParent();
|
|
||||||
// Add an extra ref for IPDL. Will be released in
|
|
||||||
// TelephonyParent::DeallocPTelephonyRequestParent().
|
|
||||||
NS_ADDREF(actor);
|
|
||||||
|
|
||||||
return actor;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyParent::DeallocPTelephonyRequestParent(PTelephonyRequestParent* aActor)
|
|
||||||
{
|
|
||||||
// TelephonyRequestParent is refcounted, must not be freed manually.
|
|
||||||
static_cast<TelephonyRequestParent*>(aActor)->Release();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyParent::Recv__delete__()
|
|
||||||
{
|
|
||||||
return true; // Unregister listener in TelephonyParent::ActorDestroy().
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyParent::RecvRegisterListener()
|
|
||||||
{
|
|
||||||
NS_ENSURE_TRUE(!mRegistered, true);
|
|
||||||
|
|
||||||
nsCOMPtr<nsITelephonyProvider> provider =
|
|
||||||
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
|
|
||||||
NS_ENSURE_TRUE(provider, true);
|
|
||||||
|
|
||||||
mRegistered = NS_SUCCEEDED(provider->RegisterListener(this));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyParent::RecvUnregisterListener()
|
|
||||||
{
|
|
||||||
NS_ENSURE_TRUE(mRegistered, true);
|
|
||||||
|
|
||||||
nsCOMPtr<nsITelephonyProvider> provider =
|
|
||||||
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
|
|
||||||
NS_ENSURE_TRUE(provider, true);
|
|
||||||
|
|
||||||
mRegistered = !NS_SUCCEEDED(provider->UnregisterListener(this));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyParent::RecvDialCall(const nsString& aNumber,
|
|
||||||
const bool& aIsEmergency)
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsITelephonyProvider> provider =
|
|
||||||
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
|
|
||||||
NS_ENSURE_TRUE(provider, true);
|
|
||||||
|
|
||||||
provider->Dial(aNumber, aIsEmergency);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyParent::RecvHangUpCall(const uint32_t& aCallIndex)
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsITelephonyProvider> provider =
|
|
||||||
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
|
|
||||||
NS_ENSURE_TRUE(provider, true);
|
|
||||||
|
|
||||||
provider->HangUp(aCallIndex);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyParent::RecvAnswerCall(const uint32_t& aCallIndex)
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsITelephonyProvider> provider =
|
|
||||||
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
|
|
||||||
NS_ENSURE_TRUE(provider, true);
|
|
||||||
|
|
||||||
provider->AnswerCall(aCallIndex);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyParent::RecvRejectCall(const uint32_t& aCallIndex)
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsITelephonyProvider> provider =
|
|
||||||
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
|
|
||||||
NS_ENSURE_TRUE(provider, true);
|
|
||||||
|
|
||||||
provider->RejectCall(aCallIndex);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyParent::RecvHoldCall(const uint32_t& aCallIndex)
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsITelephonyProvider> provider =
|
|
||||||
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
|
|
||||||
NS_ENSURE_TRUE(provider, true);
|
|
||||||
|
|
||||||
provider->HoldCall(aCallIndex);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyParent::RecvResumeCall(const uint32_t& aCallIndex)
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsITelephonyProvider> provider =
|
|
||||||
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
|
|
||||||
NS_ENSURE_TRUE(provider, true);
|
|
||||||
|
|
||||||
provider->ResumeCall(aCallIndex);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyParent::RecvConferenceCall()
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsITelephonyProvider> provider =
|
|
||||||
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
|
|
||||||
NS_ENSURE_TRUE(provider, true);
|
|
||||||
|
|
||||||
provider->ConferenceCall();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyParent::RecvSeparateCall(const uint32_t& aCallState)
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsITelephonyProvider> provider =
|
|
||||||
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
|
|
||||||
NS_ENSURE_TRUE(provider, true);
|
|
||||||
|
|
||||||
provider->SeparateCall(aCallState);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyParent::RecvHoldConference()
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsITelephonyProvider> provider =
|
|
||||||
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
|
|
||||||
NS_ENSURE_TRUE(provider, true);
|
|
||||||
|
|
||||||
provider->HoldConference();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyParent::RecvResumeConference()
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsITelephonyProvider> provider =
|
|
||||||
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
|
|
||||||
NS_ENSURE_TRUE(provider, true);
|
|
||||||
|
|
||||||
provider->ResumeConference();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyParent::RecvStartTone(const nsString& aTone)
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsITelephonyProvider> provider =
|
|
||||||
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
|
|
||||||
NS_ENSURE_TRUE(provider, true);
|
|
||||||
|
|
||||||
provider->StartTone(aTone);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyParent::RecvStopTone()
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsITelephonyProvider> provider =
|
|
||||||
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
|
|
||||||
NS_ENSURE_TRUE(provider, true);
|
|
||||||
|
|
||||||
provider->StopTone();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyParent::RecvGetMicrophoneMuted(bool* aMuted)
|
|
||||||
{
|
|
||||||
*aMuted = false;
|
|
||||||
|
|
||||||
nsCOMPtr<nsITelephonyProvider> provider =
|
|
||||||
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
|
|
||||||
NS_ENSURE_TRUE(provider, true);
|
|
||||||
|
|
||||||
provider->GetMicrophoneMuted(aMuted);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyParent::RecvSetMicrophoneMuted(const bool& aMuted)
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsITelephonyProvider> provider =
|
|
||||||
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
|
|
||||||
NS_ENSURE_TRUE(provider, true);
|
|
||||||
|
|
||||||
provider->SetMicrophoneMuted(aMuted);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyParent::RecvGetSpeakerEnabled(bool* aEnabled)
|
|
||||||
{
|
|
||||||
*aEnabled = false;
|
|
||||||
|
|
||||||
nsCOMPtr<nsITelephonyProvider> provider =
|
|
||||||
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
|
|
||||||
NS_ENSURE_TRUE(provider, true);
|
|
||||||
|
|
||||||
provider->GetSpeakerEnabled(aEnabled);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyParent::RecvSetSpeakerEnabled(const bool& aEnabled)
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsITelephonyProvider> provider =
|
|
||||||
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
|
|
||||||
NS_ENSURE_TRUE(provider, true);
|
|
||||||
|
|
||||||
provider->SetSpeakerEnabled(aEnabled);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// nsITelephonyListener
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyParent::CallStateChanged(uint32_t aCallIndex,
|
|
||||||
uint16_t aCallState,
|
|
||||||
const nsAString& aNumber,
|
|
||||||
bool aIsActive,
|
|
||||||
bool aIsOutgoing,
|
|
||||||
bool aIsEmergency,
|
|
||||||
bool aIsConference)
|
|
||||||
{
|
|
||||||
NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
IPCCallStateData data(aCallIndex, aCallState, nsString(aNumber), aIsActive,
|
|
||||||
aIsOutgoing, aIsEmergency, aIsConference);
|
|
||||||
return SendNotifyCallStateChanged(data) ? NS_OK : NS_ERROR_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyParent::ConferenceCallStateChanged(uint16_t aCallState)
|
|
||||||
{
|
|
||||||
NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
return SendNotifyConferenceCallStateChanged(aCallState) ? NS_OK
|
|
||||||
: NS_ERROR_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyParent::EnumerateCallStateComplete()
|
|
||||||
{
|
|
||||||
MOZ_CRASH("Not a EnumerateCalls request!");
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyParent::EnumerateCallState(uint32_t aCallIndex,
|
|
||||||
uint16_t aCallState,
|
|
||||||
const nsAString& aNumber,
|
|
||||||
bool aIsActive,
|
|
||||||
bool aIsOutgoing,
|
|
||||||
bool aIsEmergency,
|
|
||||||
bool aIsConference)
|
|
||||||
{
|
|
||||||
MOZ_CRASH("Not a EnumerateCalls request!");
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyParent::NotifyCdmaCallWaiting(const nsAString& aNumber)
|
|
||||||
{
|
|
||||||
NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
return SendNotifyCdmaCallWaiting(nsString(aNumber)) ? NS_OK
|
|
||||||
: NS_ERROR_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyParent::NotifyError(int32_t aCallIndex,
|
|
||||||
const nsAString& aError)
|
|
||||||
{
|
|
||||||
NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
return SendNotifyCallError(aCallIndex, nsString(aError)) ? NS_OK
|
|
||||||
: NS_ERROR_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyParent::SupplementaryServiceNotification(int32_t aCallIndex,
|
|
||||||
uint16_t aNotification)
|
|
||||||
{
|
|
||||||
NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
return SendNotifySupplementaryService(aCallIndex, aNotification)
|
|
||||||
? NS_OK : NS_ERROR_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* TelephonyRequestParent
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS1(TelephonyRequestParent, nsITelephonyListener)
|
|
||||||
|
|
||||||
TelephonyRequestParent::TelephonyRequestParent()
|
|
||||||
: mActorDestroyed(false)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
TelephonyRequestParent::ActorDestroy(ActorDestroyReason why)
|
|
||||||
{
|
|
||||||
// The child process could die before this asynchronous notification, in which
|
|
||||||
// case ActorDestroy() was called and mActorDestroyed is set to true. Return
|
|
||||||
// an error here to avoid sending a message to the dead process.
|
|
||||||
mActorDestroyed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
TelephonyRequestParent::DoRequest()
|
|
||||||
{
|
|
||||||
nsresult rv = NS_ERROR_FAILURE;
|
|
||||||
|
|
||||||
nsCOMPtr<nsITelephonyProvider> provider =
|
|
||||||
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
|
|
||||||
if (provider) {
|
|
||||||
rv = provider->EnumerateCalls(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (NS_FAILED(rv)) {
|
|
||||||
return NS_SUCCEEDED(EnumerateCallStateComplete());
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// nsITelephonyListener
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyRequestParent::CallStateChanged(uint32_t aCallIndex,
|
|
||||||
uint16_t aCallState,
|
|
||||||
const nsAString& aNumber,
|
|
||||||
bool aIsActive,
|
|
||||||
bool aIsOutgoing,
|
|
||||||
bool aIsEmergency,
|
|
||||||
bool aIsConference)
|
|
||||||
{
|
|
||||||
MOZ_CRASH("Not a TelephonyParent!");
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyRequestParent::ConferenceCallStateChanged(uint16_t aCallState)
|
|
||||||
{
|
|
||||||
MOZ_CRASH("Not a TelephonyParent!");
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyRequestParent::EnumerateCallStateComplete()
|
|
||||||
{
|
|
||||||
NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
return Send__delete__(this) ? NS_OK : NS_ERROR_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyRequestParent::EnumerateCallState(uint32_t aCallIndex,
|
|
||||||
uint16_t aCallState,
|
|
||||||
const nsAString& aNumber,
|
|
||||||
bool aIsActive,
|
|
||||||
bool aIsOutgoing,
|
|
||||||
bool aIsEmergency,
|
|
||||||
bool aIsConference)
|
|
||||||
{
|
|
||||||
NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
IPCCallStateData data(aCallIndex, aCallState, nsString(aNumber), aIsActive,
|
|
||||||
aIsOutgoing, aIsEmergency, aIsConference);
|
|
||||||
return SendNotifyEnumerateCallState(data) ? NS_OK : NS_ERROR_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyRequestParent::NotifyCdmaCallWaiting(const nsAString& aNumber)
|
|
||||||
{
|
|
||||||
MOZ_CRASH("Not a TelephonyParent!");
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyRequestParent::NotifyError(int32_t aCallIndex,
|
|
||||||
const nsAString& aError)
|
|
||||||
{
|
|
||||||
MOZ_CRASH("Not a TelephonyParent!");
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
TelephonyRequestParent::SupplementaryServiceNotification(int32_t aCallIndex,
|
|
||||||
uint16_t aNotification)
|
|
||||||
{
|
|
||||||
MOZ_CRASH("Not a TelephonyParent!");
|
|
||||||
}
|
|
@ -1,128 +0,0 @@
|
|||||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
||||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
||||||
|
|
||||||
#ifndef mozilla_dom_telephony_TelephonyParent_h
|
|
||||||
#define mozilla_dom_telephony_TelephonyParent_h
|
|
||||||
|
|
||||||
#include "mozilla/dom/telephony/TelephonyCommon.h"
|
|
||||||
#include "mozilla/dom/telephony/PTelephonyParent.h"
|
|
||||||
#include "mozilla/dom/telephony/PTelephonyRequestParent.h"
|
|
||||||
#include "nsITelephonyProvider.h"
|
|
||||||
|
|
||||||
BEGIN_TELEPHONY_NAMESPACE
|
|
||||||
|
|
||||||
class TelephonyParent : public PTelephonyParent
|
|
||||||
, public nsITelephonyListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
NS_DECL_ISUPPORTS
|
|
||||||
NS_DECL_NSITELEPHONYLISTENER
|
|
||||||
|
|
||||||
TelephonyParent();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual ~TelephonyParent() {}
|
|
||||||
|
|
||||||
virtual void
|
|
||||||
ActorDestroy(ActorDestroyReason why);
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvPTelephonyRequestConstructor(PTelephonyRequestParent* aActor) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual PTelephonyRequestParent*
|
|
||||||
AllocPTelephonyRequestParent() MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
DeallocPTelephonyRequestParent(PTelephonyRequestParent* aActor) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
Recv__delete__() MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvRegisterListener() MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvUnregisterListener() MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvDialCall(const nsString& aNumber,
|
|
||||||
const bool& aIsEmergency) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvHangUpCall(const uint32_t& aCallIndex) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvAnswerCall(const uint32_t& aCallIndex) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvRejectCall(const uint32_t& aCallIndex) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvHoldCall(const uint32_t& aCallIndex) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvResumeCall(const uint32_t& aCallIndex) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvConferenceCall() MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvSeparateCall(const uint32_t& callIndex) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvHoldConference() MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvResumeConference() MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvStartTone(const nsString& aTone) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvStopTone() MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvGetMicrophoneMuted(bool* aMuted) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvSetMicrophoneMuted(const bool& aMuted) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvGetSpeakerEnabled(bool* aEnabled) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvSetSpeakerEnabled(const bool& aEnabled) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool mActorDestroyed;
|
|
||||||
bool mRegistered;
|
|
||||||
};
|
|
||||||
|
|
||||||
class TelephonyRequestParent : public PTelephonyRequestParent
|
|
||||||
, public nsITelephonyListener
|
|
||||||
{
|
|
||||||
friend class TelephonyParent;
|
|
||||||
|
|
||||||
public:
|
|
||||||
NS_DECL_ISUPPORTS
|
|
||||||
NS_DECL_NSITELEPHONYLISTENER
|
|
||||||
|
|
||||||
protected:
|
|
||||||
TelephonyRequestParent();
|
|
||||||
virtual ~TelephonyRequestParent() {}
|
|
||||||
|
|
||||||
virtual void
|
|
||||||
ActorDestroy(ActorDestroyReason why);
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool mActorDestroyed;
|
|
||||||
|
|
||||||
bool
|
|
||||||
DoRequest();
|
|
||||||
};
|
|
||||||
|
|
||||||
END_TELEPHONY_NAMESPACE
|
|
||||||
|
|
||||||
#endif /* mozilla_dom_telephony_TelephonyParent_h */
|
|
@ -12,34 +12,12 @@ XPIDL_MODULE = 'dom_telephony'
|
|||||||
|
|
||||||
MODULE = 'dom'
|
MODULE = 'dom'
|
||||||
|
|
||||||
EXPORTS.mozilla.dom.telephony += [
|
|
||||||
'CallEvent.h',
|
|
||||||
'CallsList.h',
|
|
||||||
'Telephony.h',
|
|
||||||
'TelephonyCall.h',
|
|
||||||
'TelephonyCallGroup.h',
|
|
||||||
'TelephonyCommon.h',
|
|
||||||
'TelephonyFactory.h',
|
|
||||||
'ipc/TelephonyChild.h',
|
|
||||||
'ipc/TelephonyParent.h',
|
|
||||||
]
|
|
||||||
|
|
||||||
CPP_SOURCES += [
|
CPP_SOURCES += [
|
||||||
'CallEvent.cpp',
|
'CallEvent.cpp',
|
||||||
'CallsList.cpp',
|
'CallsList.cpp',
|
||||||
'Telephony.cpp',
|
'Telephony.cpp',
|
||||||
'TelephonyCall.cpp',
|
'TelephonyCall.cpp',
|
||||||
'TelephonyCallGroup.cpp',
|
'TelephonyCallGroup.cpp',
|
||||||
'TelephonyChild.cpp',
|
|
||||||
'TelephonyFactory.cpp',
|
|
||||||
'TelephonyIPCProvider.cpp',
|
|
||||||
'TelephonyParent.cpp',
|
|
||||||
]
|
|
||||||
|
|
||||||
IPDL_SOURCES += [
|
|
||||||
'ipc/PTelephony.ipdl',
|
|
||||||
'ipc/PTelephonyRequest.ipdl',
|
|
||||||
'ipc/TelephonyTypes.ipdlh'
|
|
||||||
]
|
]
|
||||||
|
|
||||||
FAIL_ON_WARNINGS = True
|
FAIL_ON_WARNINGS = True
|
||||||
@ -47,3 +25,4 @@ FAIL_ON_WARNINGS = True
|
|||||||
LIBXUL_LIBRARY = True
|
LIBXUL_LIBRARY = True
|
||||||
|
|
||||||
LIBRARY_NAME = 'domtelephony_s'
|
LIBRARY_NAME = 'domtelephony_s'
|
||||||
|
|
||||||
|
@ -34,8 +34,6 @@ webidl_files = \
|
|||||||
BiquadFilterNode.webidl \
|
BiquadFilterNode.webidl \
|
||||||
Blob.webidl \
|
Blob.webidl \
|
||||||
BrowserElementDictionaries.webidl \
|
BrowserElementDictionaries.webidl \
|
||||||
CallEvent.webidl \
|
|
||||||
CallsList.webidl \
|
|
||||||
CameraControl.webidl \
|
CameraControl.webidl \
|
||||||
CameraManager.webidl \
|
CameraManager.webidl \
|
||||||
CanvasRenderingContext2D.webidl \
|
CanvasRenderingContext2D.webidl \
|
||||||
@ -361,9 +359,6 @@ webidl_files = \
|
|||||||
SVGViewElement.webidl \
|
SVGViewElement.webidl \
|
||||||
SVGZoomAndPan.webidl \
|
SVGZoomAndPan.webidl \
|
||||||
SVGZoomEvent.webidl \
|
SVGZoomEvent.webidl \
|
||||||
Telephony.webidl \
|
|
||||||
TelephonyCall.webidl \
|
|
||||||
TelephonyCallGroup.webidl \
|
|
||||||
Text.webidl \
|
Text.webidl \
|
||||||
TextDecoder.webidl \
|
TextDecoder.webidl \
|
||||||
TextEncoder.webidl \
|
TextEncoder.webidl \
|
||||||
@ -450,8 +445,12 @@ endif
|
|||||||
|
|
||||||
ifdef MOZ_B2G_RIL
|
ifdef MOZ_B2G_RIL
|
||||||
webidl_files += \
|
webidl_files += \
|
||||||
|
CallsList.webidl \
|
||||||
MozStkCommandEvent.webidl \
|
MozStkCommandEvent.webidl \
|
||||||
MozVoicemail.webidl \
|
MozVoicemail.webidl \
|
||||||
|
Telephony.webidl \
|
||||||
|
TelephonyCall.webidl \
|
||||||
|
TelephonyCallGroup.webidl \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -496,6 +495,7 @@ endif
|
|||||||
|
|
||||||
ifdef MOZ_B2G_RIL
|
ifdef MOZ_B2G_RIL
|
||||||
webidl_files += \
|
webidl_files += \
|
||||||
|
CallEvent.webidl \
|
||||||
CFStateChangeEvent.webidl \
|
CFStateChangeEvent.webidl \
|
||||||
DataErrorEvent.webidl \
|
DataErrorEvent.webidl \
|
||||||
IccCardLockErrorEvent.webidl \
|
IccCardLockErrorEvent.webidl \
|
||||||
|
@ -66,7 +66,6 @@ SHARED_LIBRARY_LIBS = \
|
|||||||
$(DEPTH)/dom/promise/$(LIB_PREFIX)dompromise_s.$(LIB_SUFFIX) \
|
$(DEPTH)/dom/promise/$(LIB_PREFIX)dompromise_s.$(LIB_SUFFIX) \
|
||||||
$(DEPTH)/dom/src/notification/$(LIB_PREFIX)jsdomnotification_s.$(LIB_SUFFIX) \
|
$(DEPTH)/dom/src/notification/$(LIB_PREFIX)jsdomnotification_s.$(LIB_SUFFIX) \
|
||||||
$(DEPTH)/dom/system/$(LIB_PREFIX)domsystem_s.$(LIB_SUFFIX) \
|
$(DEPTH)/dom/system/$(LIB_PREFIX)domsystem_s.$(LIB_SUFFIX) \
|
||||||
$(DEPTH)/dom/telephony/$(LIB_PREFIX)domtelephony_s.$(LIB_SUFFIX) \
|
|
||||||
$(DEPTH)/dom/workers/$(LIB_PREFIX)domworkers_s.$(LIB_SUFFIX) \
|
$(DEPTH)/dom/workers/$(LIB_PREFIX)domworkers_s.$(LIB_SUFFIX) \
|
||||||
$(DEPTH)/dom/indexedDB/$(LIB_PREFIX)dom_indexeddb_s.$(LIB_SUFFIX) \
|
$(DEPTH)/dom/indexedDB/$(LIB_PREFIX)dom_indexeddb_s.$(LIB_SUFFIX) \
|
||||||
$(DEPTH)/dom/indexedDB/ipc/$(LIB_PREFIX)dom_indexeddb_ipc_s.$(LIB_SUFFIX) \
|
$(DEPTH)/dom/indexedDB/ipc/$(LIB_PREFIX)dom_indexeddb_ipc_s.$(LIB_SUFFIX) \
|
||||||
@ -137,6 +136,7 @@ SHARED_LIBRARY_LIBS += $(DEPTH)/dom/camera/$(LIB_PREFIX)domcamera_s.$(LIB_SUFFIX
|
|||||||
ifdef MOZ_B2G_RIL #{
|
ifdef MOZ_B2G_RIL #{
|
||||||
SHARED_LIBRARY_LIBS += \
|
SHARED_LIBRARY_LIBS += \
|
||||||
$(DEPTH)/dom/system/gonk/$(LIB_PREFIX)domsystemgonk_s.$(LIB_SUFFIX) \
|
$(DEPTH)/dom/system/gonk/$(LIB_PREFIX)domsystemgonk_s.$(LIB_SUFFIX) \
|
||||||
|
$(DEPTH)/dom/telephony/$(LIB_PREFIX)domtelephony_s.$(LIB_SUFFIX) \
|
||||||
$(DEPTH)/dom/icc/src/$(LIB_PREFIX)dom_icc_s.$(LIB_SUFFIX) \
|
$(DEPTH)/dom/icc/src/$(LIB_PREFIX)dom_icc_s.$(LIB_SUFFIX) \
|
||||||
$(DEPTH)/dom/cellbroadcast/src/$(LIB_PREFIX)dom_cellbroadcast_s.$(LIB_SUFFIX) \
|
$(DEPTH)/dom/cellbroadcast/src/$(LIB_PREFIX)dom_cellbroadcast_s.$(LIB_SUFFIX) \
|
||||||
$(DEPTH)/dom/voicemail/$(LIB_PREFIX)domvoicemail_s.$(LIB_SUFFIX) \
|
$(DEPTH)/dom/voicemail/$(LIB_PREFIX)domvoicemail_s.$(LIB_SUFFIX) \
|
||||||
|
@ -230,9 +230,6 @@ static void Shutdown();
|
|||||||
#include "mozilla/dom/alarm/AlarmHalService.h"
|
#include "mozilla/dom/alarm/AlarmHalService.h"
|
||||||
#include "mozilla/dom/time/TimeService.h"
|
#include "mozilla/dom/time/TimeService.h"
|
||||||
|
|
||||||
#include "mozilla/dom/telephony/TelephonyFactory.h"
|
|
||||||
#include "nsITelephonyProvider.h"
|
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_GONK
|
#ifdef MOZ_WIDGET_GONK
|
||||||
#include "GonkGPSGeolocationProvider.h"
|
#include "GonkGPSGeolocationProvider.h"
|
||||||
#endif
|
#endif
|
||||||
@ -241,7 +238,6 @@ static void Shutdown();
|
|||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
using namespace mozilla::dom;
|
using namespace mozilla::dom;
|
||||||
using namespace mozilla::dom::mobilemessage;
|
using namespace mozilla::dom::mobilemessage;
|
||||||
using namespace mozilla::dom::telephony;
|
|
||||||
using mozilla::dom::alarm::AlarmHalService;
|
using mozilla::dom::alarm::AlarmHalService;
|
||||||
using mozilla::dom::indexedDB::IndexedDatabaseManager;
|
using mozilla::dom::indexedDB::IndexedDatabaseManager;
|
||||||
using mozilla::dom::power::PowerManagerService;
|
using mozilla::dom::power::PowerManagerService;
|
||||||
@ -342,8 +338,6 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsVolumeService,
|
|||||||
#endif
|
#endif
|
||||||
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIMediaManagerService,
|
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIMediaManagerService,
|
||||||
MediaManager::GetInstance)
|
MediaManager::GetInstance)
|
||||||
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsITelephonyProvider,
|
|
||||||
TelephonyFactory::CreateTelephonyProvider)
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -817,7 +811,6 @@ NS_DEFINE_NAMED_CID(NS_SYNTHVOICEREGISTRY_CID);
|
|||||||
#ifdef ACCESSIBILITY
|
#ifdef ACCESSIBILITY
|
||||||
NS_DEFINE_NAMED_CID(NS_ACCESSIBILITY_SERVICE_CID);
|
NS_DEFINE_NAMED_CID(NS_ACCESSIBILITY_SERVICE_CID);
|
||||||
#endif
|
#endif
|
||||||
NS_DEFINE_NAMED_CID(TELEPHONY_PROVIDER_CID);
|
|
||||||
|
|
||||||
static nsresult
|
static nsresult
|
||||||
CreateWindowCommandTableConstructor(nsISupports *aOuter,
|
CreateWindowCommandTableConstructor(nsISupports *aOuter,
|
||||||
@ -1100,7 +1093,6 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
|
|||||||
#ifdef ACCESSIBILITY
|
#ifdef ACCESSIBILITY
|
||||||
{ &kNS_ACCESSIBILITY_SERVICE_CID, false, NULL, CreateA11yService },
|
{ &kNS_ACCESSIBILITY_SERVICE_CID, false, NULL, CreateA11yService },
|
||||||
#endif
|
#endif
|
||||||
{ &kTELEPHONY_PROVIDER_CID, false, NULL, nsITelephonyProviderConstructor },
|
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1256,7 +1248,6 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
|
|||||||
{ "@mozilla.org/accessibilityService;1", &kNS_ACCESSIBILITY_SERVICE_CID },
|
{ "@mozilla.org/accessibilityService;1", &kNS_ACCESSIBILITY_SERVICE_CID },
|
||||||
{ "@mozilla.org/accessibleRetrieval;1", &kNS_ACCESSIBILITY_SERVICE_CID },
|
{ "@mozilla.org/accessibleRetrieval;1", &kNS_ACCESSIBILITY_SERVICE_CID },
|
||||||
#endif
|
#endif
|
||||||
{ TELEPHONY_PROVIDER_CONTRACTID, &kTELEPHONY_PROVIDER_CID },
|
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user