mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1180555 - Handle PBAP replies and pass the results through IPC to PbapManager. r=btian
This commit is contained in:
parent
21d468cf8e
commit
cdf8d7b17d
@ -10,6 +10,7 @@
|
|||||||
#include "BluetoothService.h"
|
#include "BluetoothService.h"
|
||||||
|
|
||||||
#include "mozilla/dom/BluetoothPbapRequestHandleBinding.h"
|
#include "mozilla/dom/BluetoothPbapRequestHandleBinding.h"
|
||||||
|
#include "mozilla/dom/ContentChild.h"
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
using namespace dom;
|
using namespace dom;
|
||||||
@ -49,8 +50,42 @@ already_AddRefed<DOMRequest>
|
|||||||
BluetoothPbapRequestHandle::ReplyTovCardPulling(Blob& aBlob,
|
BluetoothPbapRequestHandle::ReplyTovCardPulling(Blob& aBlob,
|
||||||
ErrorResult& aRv)
|
ErrorResult& aRv)
|
||||||
{
|
{
|
||||||
// TODO: Implement this function (Bug 1180555)
|
nsCOMPtr<nsPIDOMWindow> win = GetParentObject();
|
||||||
return nullptr;
|
if (!win) {
|
||||||
|
aRv.Throw(NS_ERROR_FAILURE);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsRefPtr<DOMRequest> request = new DOMRequest(win);
|
||||||
|
nsRefPtr<BluetoothVoidReplyRunnable> result =
|
||||||
|
new BluetoothVoidReplyRunnable(request);
|
||||||
|
|
||||||
|
BluetoothService* bs = BluetoothService::Get();
|
||||||
|
if (!bs) {
|
||||||
|
aRv.Throw(NS_ERROR_FAILURE);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
||||||
|
// In-process reply
|
||||||
|
bs->ReplyTovCardPulling(&aBlob, result);
|
||||||
|
} else {
|
||||||
|
ContentChild *cc = ContentChild::GetSingleton();
|
||||||
|
if (!cc) {
|
||||||
|
aRv.Throw(NS_ERROR_FAILURE);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
BlobChild* actor = cc->GetOrCreateActorForBlob(&aBlob);
|
||||||
|
if (!actor) {
|
||||||
|
aRv.Throw(NS_ERROR_FAILURE);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
bs->ReplyTovCardPulling(nullptr, actor, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
return request.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<DOMRequest>
|
already_AddRefed<DOMRequest>
|
||||||
@ -58,8 +93,42 @@ BluetoothPbapRequestHandle::ReplyToPhonebookPulling(Blob& aBlob,
|
|||||||
uint16_t phonebookSize,
|
uint16_t phonebookSize,
|
||||||
ErrorResult& aRv)
|
ErrorResult& aRv)
|
||||||
{
|
{
|
||||||
// TODO: Implement this function (Bug 1180555)
|
nsCOMPtr<nsPIDOMWindow> win = GetParentObject();
|
||||||
return nullptr;
|
if (!win) {
|
||||||
|
aRv.Throw(NS_ERROR_FAILURE);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsRefPtr<DOMRequest> request = new DOMRequest(win);
|
||||||
|
nsRefPtr<BluetoothVoidReplyRunnable> result =
|
||||||
|
new BluetoothVoidReplyRunnable(request);
|
||||||
|
|
||||||
|
BluetoothService* bs = BluetoothService::Get();
|
||||||
|
if (!bs) {
|
||||||
|
aRv.Throw(NS_ERROR_FAILURE);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
||||||
|
// In-process reply
|
||||||
|
bs->ReplyToPhonebookPulling(&aBlob, phonebookSize, result);
|
||||||
|
} else {
|
||||||
|
ContentChild *cc = ContentChild::GetSingleton();
|
||||||
|
if (!cc) {
|
||||||
|
aRv.Throw(NS_ERROR_FAILURE);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
BlobChild* actor = cc->GetOrCreateActorForBlob(&aBlob);
|
||||||
|
if (!actor) {
|
||||||
|
aRv.Throw(NS_ERROR_FAILURE);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
bs->ReplyToPhonebookPulling(nullptr, actor, phonebookSize, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
return request.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<DOMRequest>
|
already_AddRefed<DOMRequest>
|
||||||
@ -67,8 +136,42 @@ BluetoothPbapRequestHandle::ReplyTovCardListing(Blob& aBlob,
|
|||||||
uint16_t phonebookSize,
|
uint16_t phonebookSize,
|
||||||
ErrorResult& aRv)
|
ErrorResult& aRv)
|
||||||
{
|
{
|
||||||
// TODO: Implement this function (Bug 1180555)
|
nsCOMPtr<nsPIDOMWindow> win = GetParentObject();
|
||||||
return nullptr;
|
if (!win) {
|
||||||
|
aRv.Throw(NS_ERROR_FAILURE);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsRefPtr<DOMRequest> request = new DOMRequest(win);
|
||||||
|
nsRefPtr<BluetoothVoidReplyRunnable> result =
|
||||||
|
new BluetoothVoidReplyRunnable(request);
|
||||||
|
|
||||||
|
BluetoothService* bs = BluetoothService::Get();
|
||||||
|
if (!bs) {
|
||||||
|
aRv.Throw(NS_ERROR_FAILURE);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
||||||
|
// In-process reply
|
||||||
|
bs->ReplyTovCardListing(&aBlob, phonebookSize, result);
|
||||||
|
} else {
|
||||||
|
ContentChild *cc = ContentChild::GetSingleton();
|
||||||
|
if (!cc) {
|
||||||
|
aRv.Throw(NS_ERROR_FAILURE);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
BlobChild* actor = cc->GetOrCreateActorForBlob(&aBlob);
|
||||||
|
if (!actor) {
|
||||||
|
aRv.Throw(NS_ERROR_FAILURE);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
bs->ReplyTovCardListing(nullptr, actor, phonebookSize, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
return request.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
JSObject*
|
JSObject*
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#include "BluetoothUuid.h"
|
#include "BluetoothUuid.h"
|
||||||
#include "ObexBase.h"
|
#include "ObexBase.h"
|
||||||
|
|
||||||
|
#include "mozilla/dom/ipc/BlobParent.h"
|
||||||
#include "mozilla/RefPtr.h"
|
#include "mozilla/RefPtr.h"
|
||||||
#include "mozilla/Services.h"
|
#include "mozilla/Services.h"
|
||||||
#include "mozilla/StaticPtr.h"
|
#include "mozilla/StaticPtr.h"
|
||||||
@ -752,6 +753,16 @@ BluetoothPbapManager::PackPropertiesMask(uint8_t* aData, int aSize)
|
|||||||
return propSelector;
|
return propSelector;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BluetoothPbapManager::ReplyToPullPhonebook(BlobParent* aActor,
|
||||||
|
uint16_t aPhonebookSize)
|
||||||
|
{
|
||||||
|
nsRefPtr<BlobImpl> impl = aActor->GetBlobImpl();
|
||||||
|
nsRefPtr<Blob> blob = Blob::Create(nullptr, impl);
|
||||||
|
|
||||||
|
ReplyToPullPhonebook(blob.get(), aPhonebookSize);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
BluetoothPbapManager::ReplyToPullPhonebook(Blob* aBlob, uint16_t aPhonebookSize)
|
BluetoothPbapManager::ReplyToPullPhonebook(Blob* aBlob, uint16_t aPhonebookSize)
|
||||||
{
|
{
|
||||||
@ -759,13 +770,31 @@ BluetoothPbapManager::ReplyToPullPhonebook(Blob* aBlob, uint16_t aPhonebookSize)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
BluetoothPbapManager::ReplyToPullvCardListing(
|
BluetoothPbapManager::ReplyToPullvCardListing(BlobParent* aActor,
|
||||||
Blob* aBlob,
|
uint16_t aPhonebookSize)
|
||||||
uint16_t aPhonebookSize)
|
{
|
||||||
|
nsRefPtr<BlobImpl> impl = aActor->GetBlobImpl();
|
||||||
|
nsRefPtr<Blob> blob = Blob::Create(nullptr, impl);
|
||||||
|
|
||||||
|
ReplyToPullvCardListing(blob.get(), aPhonebookSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BluetoothPbapManager::ReplyToPullvCardListing(Blob* aBlob,
|
||||||
|
uint16_t aPhonebookSize)
|
||||||
{
|
{
|
||||||
// TODO: Implement this function (Bug 1180556)
|
// TODO: Implement this function (Bug 1180556)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BluetoothPbapManager::ReplyToPullvCardEntry(BlobParent* aActor)
|
||||||
|
{
|
||||||
|
nsRefPtr<BlobImpl> impl = aActor->GetBlobImpl();
|
||||||
|
nsRefPtr<Blob> blob = Blob::Create(nullptr, impl);
|
||||||
|
|
||||||
|
ReplyToPullvCardEntry(blob.get());
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
BluetoothPbapManager::ReplyToPullvCardEntry(Blob* aBlob)
|
BluetoothPbapManager::ReplyToPullvCardEntry(Blob* aBlob)
|
||||||
{
|
{
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace dom {
|
namespace dom {
|
||||||
class Blob;
|
class Blob;
|
||||||
|
class BlobParent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,8 +63,51 @@ public:
|
|||||||
|
|
||||||
static BluetoothPbapManager* Get();
|
static BluetoothPbapManager* Get();
|
||||||
bool Listen();
|
bool Listen();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reply vCard object to the *IPC* 'pullphonebook' request.
|
||||||
|
*
|
||||||
|
* @param aActor [in] a blob actor containing the vCard objects
|
||||||
|
* @param aPhonebookSize [in] the number of vCard indexes in the blob
|
||||||
|
*/
|
||||||
|
void ReplyToPullPhonebook(BlobParent* aActor, uint16_t aPhonebookSize);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reply vCard object to the *in-process* 'pullphonebook' request.
|
||||||
|
*
|
||||||
|
* @param aBlob [in] a blob contained the vCard objects
|
||||||
|
* @param aPhonebookSize [in] the number of vCard indexes in the blob
|
||||||
|
*/
|
||||||
void ReplyToPullPhonebook(Blob* aBlob, uint16_t aPhonebookSize);
|
void ReplyToPullPhonebook(Blob* aBlob, uint16_t aPhonebookSize);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reply vCard object to the *IPC* 'pullvcardlisting' request.
|
||||||
|
*
|
||||||
|
* @param aActor [in] a blob actor containing the vCard objects
|
||||||
|
* @param aPhonebookSize [in] the number of vCard indexes in the blob
|
||||||
|
*/
|
||||||
|
void ReplyToPullvCardListing(BlobParent* aActor, uint16_t aPhonebookSize);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reply vCard object to the *in-process* 'pullvcardlisting' request.
|
||||||
|
*
|
||||||
|
* @param aBlob [in] a blob contained the vCard objects
|
||||||
|
* @param aPhonebookSize [in] the number of vCard indexes in the blob
|
||||||
|
*/
|
||||||
void ReplyToPullvCardListing(Blob* aBlob, uint16_t aPhonebookSize);
|
void ReplyToPullvCardListing(Blob* aBlob, uint16_t aPhonebookSize);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reply vCard object to the *IPC* 'pullvcardentry' request.
|
||||||
|
*
|
||||||
|
* @param aActor [in] a blob actor containing the vCard objects
|
||||||
|
*/
|
||||||
|
void ReplyToPullvCardEntry(BlobParent* aActor);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reply vCard object to the *in-process* 'pullvcardentry' request.
|
||||||
|
*
|
||||||
|
* @param aBlob [in] a blob contained the vCard objects
|
||||||
|
*/
|
||||||
void ReplyToPullvCardEntry(Blob* aBlob);
|
void ReplyToPullvCardEntry(Blob* aBlob);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -1125,6 +1125,109 @@ BluetoothServiceBluedroid::IsScoConnected(BluetoothReplyRunnable* aRunnable)
|
|||||||
DispatchReplySuccess(aRunnable, BluetoothValue(hfp->IsScoConnected()));
|
DispatchReplySuccess(aRunnable, BluetoothValue(hfp->IsScoConnected()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BluetoothServiceBluedroid::ReplyTovCardPulling(
|
||||||
|
BlobParent* aBlobParent,
|
||||||
|
BlobChild* aBlobChild,
|
||||||
|
BluetoothReplyRunnable* aRunnable)
|
||||||
|
{
|
||||||
|
BluetoothPbapManager* pbap = BluetoothPbapManager::Get();
|
||||||
|
if (!pbap) {
|
||||||
|
DispatchReplyError(aRunnable,
|
||||||
|
NS_LITERAL_STRING("Reply to vCardPulling failed"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
pbap->ReplyToPullvCardEntry(aBlobParent);
|
||||||
|
DispatchReplySuccess(aRunnable);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BluetoothServiceBluedroid::ReplyTovCardPulling(
|
||||||
|
Blob* aBlob,
|
||||||
|
BluetoothReplyRunnable* aRunnable)
|
||||||
|
{
|
||||||
|
BluetoothPbapManager* pbap = BluetoothPbapManager::Get();
|
||||||
|
if (!pbap) {
|
||||||
|
DispatchReplyError(aRunnable,
|
||||||
|
NS_LITERAL_STRING("Reply to vCardPulling failed"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
pbap->ReplyToPullvCardEntry(aBlob);
|
||||||
|
DispatchReplySuccess(aRunnable);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BluetoothServiceBluedroid::ReplyToPhonebookPulling(
|
||||||
|
BlobParent* aBlobParent,
|
||||||
|
BlobChild* aBlobChild,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable)
|
||||||
|
{
|
||||||
|
BluetoothPbapManager* pbap = BluetoothPbapManager::Get();
|
||||||
|
if (!pbap) {
|
||||||
|
DispatchReplyError(aRunnable,
|
||||||
|
NS_LITERAL_STRING("Reply to Phonebook Pulling failed"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
pbap->ReplyToPullPhonebook(aBlobParent, aPhonebookSize);
|
||||||
|
DispatchReplySuccess(aRunnable);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BluetoothServiceBluedroid::ReplyToPhonebookPulling(
|
||||||
|
Blob* aBlob,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable)
|
||||||
|
{
|
||||||
|
BluetoothPbapManager* pbap = BluetoothPbapManager::Get();
|
||||||
|
if (!pbap) {
|
||||||
|
DispatchReplyError(aRunnable,
|
||||||
|
NS_LITERAL_STRING("Reply to Phonebook Pulling failed"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
pbap->ReplyToPullPhonebook(aBlob, aPhonebookSize);
|
||||||
|
DispatchReplySuccess(aRunnable);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BluetoothServiceBluedroid::ReplyTovCardListing(
|
||||||
|
BlobParent* aBlobParent,
|
||||||
|
BlobChild* aBlobChild,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable)
|
||||||
|
{
|
||||||
|
BluetoothPbapManager* pbap = BluetoothPbapManager::Get();
|
||||||
|
if (!pbap) {
|
||||||
|
DispatchReplyError(aRunnable,
|
||||||
|
NS_LITERAL_STRING("Reply to vCard Listing failed"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
pbap->ReplyToPullvCardListing(aBlobParent, aPhonebookSize);
|
||||||
|
DispatchReplySuccess(aRunnable);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BluetoothServiceBluedroid::ReplyTovCardListing(
|
||||||
|
Blob* aBlob,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable)
|
||||||
|
{
|
||||||
|
BluetoothPbapManager* pbap = BluetoothPbapManager::Get();
|
||||||
|
if (!pbap) {
|
||||||
|
DispatchReplyError(aRunnable,
|
||||||
|
NS_LITERAL_STRING("Reply to vCard Listing failed"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
pbap->ReplyToPullvCardListing(aBlob, aPhonebookSize);
|
||||||
|
DispatchReplySuccess(aRunnable);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
BluetoothServiceBluedroid::SendMetaData(const nsAString& aTitle,
|
BluetoothServiceBluedroid::SendMetaData(const nsAString& aTitle,
|
||||||
const nsAString& aArtist,
|
const nsAString& aArtist,
|
||||||
|
@ -142,6 +142,37 @@ public:
|
|||||||
virtual void
|
virtual void
|
||||||
IsScoConnected(BluetoothReplyRunnable* aRunnable);
|
IsScoConnected(BluetoothReplyRunnable* aRunnable);
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
ReplyTovCardPulling(BlobParent* aBlobParent,
|
||||||
|
BlobChild* aBlobChild,
|
||||||
|
BluetoothReplyRunnable* aRunnable);
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
ReplyTovCardPulling(Blob* aBlob,
|
||||||
|
BluetoothReplyRunnable* aRunnable);
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
ReplyToPhonebookPulling(BlobParent* aBlobParent,
|
||||||
|
BlobChild* aBlobChild,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable);
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
ReplyToPhonebookPulling(Blob* aBlob,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable);
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
ReplyTovCardListing(BlobParent* aBlobParent,
|
||||||
|
BlobChild* aBlobChild,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable);
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
ReplyTovCardListing(Blob* aBlob,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable);
|
||||||
|
|
||||||
virtual void
|
virtual void
|
||||||
AnswerWaitingCall(BluetoothReplyRunnable* aRunnable);
|
AnswerWaitingCall(BluetoothReplyRunnable* aRunnable);
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include "mozilla/dom/bluetooth/BluetoothDiscoveryHandle.h"
|
#include "mozilla/dom/bluetooth/BluetoothDiscoveryHandle.h"
|
||||||
#include "mozilla/dom/bluetooth/BluetoothGattServer.h"
|
#include "mozilla/dom/bluetooth/BluetoothGattServer.h"
|
||||||
#include "mozilla/dom/bluetooth/BluetoothPairingListener.h"
|
#include "mozilla/dom/bluetooth/BluetoothPairingListener.h"
|
||||||
|
#include "mozilla/dom/bluetooth/BluetoothPbapRequestHandle.h"
|
||||||
#include "mozilla/dom/bluetooth/BluetoothTypes.h"
|
#include "mozilla/dom/bluetooth/BluetoothTypes.h"
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
@ -1234,6 +1235,8 @@ BluetoothAdapter::HandlePullPhonebookReq(const BluetoothValue& aValue)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init.mHandle = BluetoothPbapRequestHandle::Create(GetOwner());
|
||||||
|
|
||||||
nsRefPtr<BluetoothPhonebookPullingEvent> event =
|
nsRefPtr<BluetoothPhonebookPullingEvent> event =
|
||||||
BluetoothPhonebookPullingEvent::Constructor(this,
|
BluetoothPhonebookPullingEvent::Constructor(this,
|
||||||
NS_LITERAL_STRING(PULL_PHONEBOOK_REQ_ID), init);
|
NS_LITERAL_STRING(PULL_PHONEBOOK_REQ_ID), init);
|
||||||
@ -1266,6 +1269,8 @@ BluetoothAdapter::HandlePullVCardEntryReq(const BluetoothValue& aValue)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init.mHandle = BluetoothPbapRequestHandle::Create(GetOwner());
|
||||||
|
|
||||||
nsRefPtr<BluetoothVCardPullingEvent> event =
|
nsRefPtr<BluetoothVCardPullingEvent> event =
|
||||||
BluetoothVCardPullingEvent::Constructor(this,
|
BluetoothVCardPullingEvent::Constructor(this,
|
||||||
NS_LITERAL_STRING(PULL_VCARD_ENTRY_REQ_ID), init);
|
NS_LITERAL_STRING(PULL_VCARD_ENTRY_REQ_ID), init);
|
||||||
@ -1308,6 +1313,8 @@ BluetoothAdapter::HandlePullVCardListingReq(const BluetoothValue& aValue)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init.mHandle = BluetoothPbapRequestHandle::Create(GetOwner());
|
||||||
|
|
||||||
nsRefPtr<BluetoothVCardListingEvent> event =
|
nsRefPtr<BluetoothVCardListingEvent> event =
|
||||||
BluetoothVCardListingEvent::Constructor(this,
|
BluetoothVCardListingEvent::Constructor(this,
|
||||||
NS_LITERAL_STRING(PULL_VCARD_LISTING_REQ_ID), init);
|
NS_LITERAL_STRING(PULL_VCARD_LISTING_REQ_ID), init);
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include "BluetoothCommon.h"
|
#include "BluetoothCommon.h"
|
||||||
#include "BluetoothInterface.h"
|
#include "BluetoothInterface.h"
|
||||||
|
#include "BluetoothPbapRequestHandle.h"
|
||||||
#include "BluetoothProfileManagerBase.h"
|
#include "BluetoothProfileManagerBase.h"
|
||||||
#include "nsAutoPtr.h"
|
#include "nsAutoPtr.h"
|
||||||
#include "nsClassHashtable.h"
|
#include "nsClassHashtable.h"
|
||||||
@ -310,6 +311,37 @@ public:
|
|||||||
virtual void
|
virtual void
|
||||||
IsScoConnected(BluetoothReplyRunnable* aRunnable) = 0;
|
IsScoConnected(BluetoothReplyRunnable* aRunnable) = 0;
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
ReplyTovCardPulling(BlobParent* aBlobParent,
|
||||||
|
BlobChild* aBlobChild,
|
||||||
|
BluetoothReplyRunnable* aRunnable) = 0;
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
ReplyTovCardPulling(Blob* aBlob,
|
||||||
|
BluetoothReplyRunnable* aRunnable) = 0;
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
ReplyToPhonebookPulling(BlobParent* aBlobParent,
|
||||||
|
BlobChild* aBlobChild,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable) = 0;
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
ReplyToPhonebookPulling(Blob* aBlob,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable) = 0;
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
ReplyTovCardListing(BlobParent* aBlobParent,
|
||||||
|
BlobChild* aBlobChild,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable) = 0;
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
ReplyTovCardListing(Blob* aBlob,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable) = 0;
|
||||||
|
|
||||||
#ifdef MOZ_B2G_RIL
|
#ifdef MOZ_B2G_RIL
|
||||||
virtual void
|
virtual void
|
||||||
AnswerWaitingCall(BluetoothReplyRunnable* aRunnable) = 0;
|
AnswerWaitingCall(BluetoothReplyRunnable* aRunnable) = 0;
|
||||||
|
@ -246,6 +246,12 @@ BluetoothParent::RecvPBluetoothRequestConstructor(
|
|||||||
return actor->DoRequest(aRequest.get_DisconnectScoRequest());
|
return actor->DoRequest(aRequest.get_DisconnectScoRequest());
|
||||||
case Request::TIsScoConnectedRequest:
|
case Request::TIsScoConnectedRequest:
|
||||||
return actor->DoRequest(aRequest.get_IsScoConnectedRequest());
|
return actor->DoRequest(aRequest.get_IsScoConnectedRequest());
|
||||||
|
case Request::TReplyTovCardPullingRequest:
|
||||||
|
return actor->DoRequest(aRequest.get_ReplyTovCardPullingRequest());
|
||||||
|
case Request::TReplyToPhonebookPullingRequest:
|
||||||
|
return actor->DoRequest(aRequest.get_ReplyToPhonebookPullingRequest());
|
||||||
|
case Request::TReplyTovCardListingRequest:
|
||||||
|
return actor->DoRequest(aRequest.get_ReplyTovCardListingRequest());
|
||||||
#ifdef MOZ_B2G_RIL
|
#ifdef MOZ_B2G_RIL
|
||||||
case Request::TAnswerWaitingCallRequest:
|
case Request::TAnswerWaitingCallRequest:
|
||||||
return actor->DoRequest(aRequest.get_AnswerWaitingCallRequest());
|
return actor->DoRequest(aRequest.get_AnswerWaitingCallRequest());
|
||||||
@ -703,6 +709,44 @@ BluetoothRequestParent::DoRequest(const IsScoConnectedRequest& aRequest)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
BluetoothRequestParent::DoRequest(const ReplyTovCardPullingRequest& aRequest)
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(mService);
|
||||||
|
MOZ_ASSERT(mRequestType == Request::TReplyTovCardPullingRequest);
|
||||||
|
|
||||||
|
mService->ReplyTovCardPulling((BlobParent*)aRequest.blobParent(),
|
||||||
|
(BlobChild*)aRequest.blobChild(),
|
||||||
|
mReplyRunnable.get());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
BluetoothRequestParent::DoRequest(const ReplyToPhonebookPullingRequest& aRequest)
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(mService);
|
||||||
|
MOZ_ASSERT(mRequestType == Request::TReplyToPhonebookPullingRequest);
|
||||||
|
|
||||||
|
mService->ReplyToPhonebookPulling((BlobParent*)aRequest.blobParent(),
|
||||||
|
(BlobChild*)aRequest.blobChild(),
|
||||||
|
aRequest.phonebookSize(),
|
||||||
|
mReplyRunnable.get());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
BluetoothRequestParent::DoRequest(const ReplyTovCardListingRequest& aRequest)
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(mService);
|
||||||
|
MOZ_ASSERT(mRequestType == Request::TReplyTovCardListingRequest);
|
||||||
|
|
||||||
|
mService->ReplyTovCardListing((BlobParent*)aRequest.blobParent(),
|
||||||
|
(BlobChild*)aRequest.blobChild(),
|
||||||
|
aRequest.phonebookSize(),
|
||||||
|
mReplyRunnable.get());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef MOZ_B2G_RIL
|
#ifdef MOZ_B2G_RIL
|
||||||
bool
|
bool
|
||||||
BluetoothRequestParent::DoRequest(const AnswerWaitingCallRequest& aRequest)
|
BluetoothRequestParent::DoRequest(const AnswerWaitingCallRequest& aRequest)
|
||||||
|
@ -212,6 +212,15 @@ protected:
|
|||||||
bool
|
bool
|
||||||
DoRequest(const IsScoConnectedRequest& aRequest);
|
DoRequest(const IsScoConnectedRequest& aRequest);
|
||||||
|
|
||||||
|
bool
|
||||||
|
DoRequest(const ReplyTovCardPullingRequest& aRequest);
|
||||||
|
|
||||||
|
bool
|
||||||
|
DoRequest(const ReplyToPhonebookPullingRequest& aRequest);
|
||||||
|
|
||||||
|
bool
|
||||||
|
DoRequest(const ReplyTovCardListingRequest& aRequest);
|
||||||
|
|
||||||
#ifdef MOZ_B2G_RIL
|
#ifdef MOZ_B2G_RIL
|
||||||
bool
|
bool
|
||||||
DoRequest(const AnswerWaitingCallRequest& aRequest);
|
DoRequest(const AnswerWaitingCallRequest& aRequest);
|
||||||
|
@ -366,6 +366,66 @@ BluetoothServiceChildProcess::IsScoConnected(BluetoothReplyRunnable* aRunnable)
|
|||||||
SendRequest(aRunnable, IsScoConnectedRequest());
|
SendRequest(aRunnable, IsScoConnectedRequest());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BluetoothServiceChildProcess::ReplyTovCardPulling(
|
||||||
|
BlobParent* aBlobParent,
|
||||||
|
BlobChild* aBlobChild,
|
||||||
|
BluetoothReplyRunnable* aRunnable)
|
||||||
|
{
|
||||||
|
SendRequest(aRunnable, ReplyTovCardPullingRequest(nullptr, aBlobChild));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BluetoothServiceChildProcess::ReplyTovCardPulling(
|
||||||
|
Blob* aBlobChild,
|
||||||
|
BluetoothReplyRunnable* aRunnable)
|
||||||
|
{
|
||||||
|
// Parent-process-only method
|
||||||
|
MOZ_CRASH("This should never be called!");
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BluetoothServiceChildProcess::ReplyToPhonebookPulling(
|
||||||
|
BlobParent* aBlobParent,
|
||||||
|
BlobChild* aBlobChild,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable)
|
||||||
|
{
|
||||||
|
SendRequest(aRunnable,
|
||||||
|
ReplyToPhonebookPullingRequest(nullptr, aBlobChild, aPhonebookSize));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BluetoothServiceChildProcess::ReplyToPhonebookPulling(
|
||||||
|
Blob* aBlobChild,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable)
|
||||||
|
{
|
||||||
|
// Parent-process-only method
|
||||||
|
MOZ_CRASH("This should never be called!");
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BluetoothServiceChildProcess::ReplyTovCardListing(
|
||||||
|
BlobParent* aBlobParent,
|
||||||
|
BlobChild* aBlobChild,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable)
|
||||||
|
{
|
||||||
|
SendRequest(aRunnable,
|
||||||
|
ReplyTovCardListingRequest(nullptr, aBlobChild, aPhonebookSize));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BluetoothServiceChildProcess::ReplyTovCardListing(
|
||||||
|
Blob* aBlobChild,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable)
|
||||||
|
{
|
||||||
|
// Parent-process-only method
|
||||||
|
MOZ_CRASH("This should never be called!");
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef MOZ_B2G_RIL
|
#ifdef MOZ_B2G_RIL
|
||||||
void
|
void
|
||||||
BluetoothServiceChildProcess::AnswerWaitingCall(
|
BluetoothServiceChildProcess::AnswerWaitingCall(
|
||||||
|
@ -158,6 +158,37 @@ public:
|
|||||||
virtual void
|
virtual void
|
||||||
IsScoConnected(BluetoothReplyRunnable* aRunnable) override;
|
IsScoConnected(BluetoothReplyRunnable* aRunnable) override;
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
ReplyTovCardPulling(BlobParent* aBlobParent,
|
||||||
|
BlobChild* aBlobChild,
|
||||||
|
BluetoothReplyRunnable* aRunnable) override;
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
ReplyTovCardPulling(Blob* aBlob,
|
||||||
|
BluetoothReplyRunnable* aRunnable) override;
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
ReplyToPhonebookPulling(BlobParent* aBlobParent,
|
||||||
|
BlobChild* aBlobChild,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable) override;
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
ReplyToPhonebookPulling(Blob* aBlob,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable) override;
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
ReplyTovCardListing(BlobParent* aBlobParent,
|
||||||
|
BlobChild* aBlobChild,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable) override;
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
ReplyTovCardListing(Blob* aBlob,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable) override;
|
||||||
|
|
||||||
#ifdef MOZ_B2G_RIL
|
#ifdef MOZ_B2G_RIL
|
||||||
virtual void
|
virtual void
|
||||||
AnswerWaitingCall(BluetoothReplyRunnable* aRunnable) override;
|
AnswerWaitingCall(BluetoothReplyRunnable* aRunnable) override;
|
||||||
|
@ -171,6 +171,23 @@ struct IsScoConnectedRequest
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct ReplyTovCardPullingRequest
|
||||||
|
{
|
||||||
|
PBlob blob;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ReplyToPhonebookPullingRequest
|
||||||
|
{
|
||||||
|
PBlob blob;
|
||||||
|
uint16_t phonebookSize;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ReplyTovCardListingRequest
|
||||||
|
{
|
||||||
|
PBlob blob;
|
||||||
|
uint16_t phonebookSize;
|
||||||
|
};
|
||||||
|
|
||||||
struct AnswerWaitingCallRequest
|
struct AnswerWaitingCallRequest
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
@ -306,6 +323,9 @@ union Request
|
|||||||
ConnectScoRequest;
|
ConnectScoRequest;
|
||||||
DisconnectScoRequest;
|
DisconnectScoRequest;
|
||||||
IsScoConnectedRequest;
|
IsScoConnectedRequest;
|
||||||
|
ReplyTovCardPullingRequest;
|
||||||
|
ReplyToPhonebookPullingRequest;
|
||||||
|
ReplyTovCardListingRequest;
|
||||||
AnswerWaitingCallRequest;
|
AnswerWaitingCallRequest;
|
||||||
IgnoreWaitingCallRequest;
|
IgnoreWaitingCallRequest;
|
||||||
ToggleCallsRequest;
|
ToggleCallsRequest;
|
||||||
|
@ -4378,3 +4378,52 @@ BluetoothDBusService::GattClientWriteDescriptorValueInternal(
|
|||||||
BluetoothReplyRunnable* aRunnable)
|
BluetoothReplyRunnable* aRunnable)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BluetoothDBusService::ReplyTovCardPulling(
|
||||||
|
BlobParent* aBlobParent,
|
||||||
|
BlobChild* aBlobChild,
|
||||||
|
BluetoothReplyRunnable* aRunnable)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BluetoothDBusService::ReplyTovCardPulling(
|
||||||
|
Blob* aBlob,
|
||||||
|
BluetoothReplyRunnable* aRunnable)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BluetoothDBusService::ReplyToPhonebookPulling(
|
||||||
|
BlobParent* aBlobParent,
|
||||||
|
BlobChild* aBlobChild,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BluetoothDBusService::ReplyToPhonebookPulling(
|
||||||
|
Blob* aBlob,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BluetoothDBusService::ReplyTovCardListing(
|
||||||
|
BlobParent* aBlobParent,
|
||||||
|
BlobChild* aBlobChild,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BluetoothDBusService::ReplyTovCardListing(
|
||||||
|
Blob* aBlob,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
@ -157,6 +157,37 @@ public:
|
|||||||
virtual void
|
virtual void
|
||||||
IsScoConnected(BluetoothReplyRunnable* aRunnable) override;
|
IsScoConnected(BluetoothReplyRunnable* aRunnable) override;
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
ReplyTovCardPulling(BlobParent* aBlobParent,
|
||||||
|
BlobChild* aBlobChild,
|
||||||
|
BluetoothReplyRunnable* aRunnable) override;
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
ReplyTovCardPulling(Blob* aBlob,
|
||||||
|
BluetoothReplyRunnable* aRunnable) override;
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
ReplyToPhonebookPulling(BlobParent* aBlobParent,
|
||||||
|
BlobChild* aBlobChild,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable) override;
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
ReplyToPhonebookPulling(Blob* aBlob,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable) override;
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
ReplyTovCardListing(BlobParent* aBlobParent,
|
||||||
|
BlobChild* aBlobChild,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable) override;
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
ReplyTovCardListing(Blob* aBlob,
|
||||||
|
uint16_t aPhonebookSize,
|
||||||
|
BluetoothReplyRunnable* aRunnable);
|
||||||
|
|
||||||
#ifdef MOZ_B2G_RIL
|
#ifdef MOZ_B2G_RIL
|
||||||
virtual void
|
virtual void
|
||||||
AnswerWaitingCall(BluetoothReplyRunnable* aRunnable);
|
AnswerWaitingCall(BluetoothReplyRunnable* aRunnable);
|
||||||
|
Loading…
Reference in New Issue
Block a user