author | Sebastian Hengst <archaeopteryx@coole-files.de> |
Fri, 21 Aug 2015 11:19:41 +0200 | |
changeset 258621 | 00b847293e708b261f6963563e3f7536a92d377a |
parent 258620 | d70b350ed568b9ec64d3d8b1505db8ea30db03f8 |
child 258622 | 44e1c2415a7e000af62daa1fb012d4f56026348f |
push id | 17100 |
push user | archaeopteryx@coole-files.de |
push date | Fri, 21 Aug 2015 09:20:14 +0000 |
treeherder | b2g-inbound@00b847293e70 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | backout |
bugs | 1180556, 1180555, 1180554 |
milestone | 43.0a1 |
backs out | 131251625ee858d5281b20b356cab8518037d599 5bdcc058e6d6ab6b29cf70754be30100dccb543e f7e0cd74c082d5bee3493e39dea048a58af2dd59 |
--- a/dom/base/nsGkAtomList.h +++ b/dom/base/nsGkAtomList.h @@ -847,19 +847,16 @@ GK_ATOM(onpaste, "onpaste") GK_ATOM(onpendingchange, "onpendingchange") GK_ATOM(onpichange, "onpichange") GK_ATOM(onpicture, "onpicture") GK_ATOM(onpopuphidden, "onpopuphidden") GK_ATOM(onpopuphiding, "onpopuphiding") GK_ATOM(onpopupshowing, "onpopupshowing") GK_ATOM(onpopupshown, "onpopupshown") GK_ATOM(onpreviewstatechange, "onpreviewstatechange") -GK_ATOM(onpullphonebookreq, "onpullphonebookreq") -GK_ATOM(onpullvcardentryreq, "onpullvcardentryreq") -GK_ATOM(onpullvcardlistingreq, "onpullvcardlistingreq") GK_ATOM(onpush, "onpush") GK_ATOM(onpushsubscriptionchange, "onpushsubscriptionchange") GK_ATOM(onpschange, "onpschange") GK_ATOM(onptychange, "onptychange") GK_ATOM(onradiostatechange, "onradiostatechange") GK_ATOM(onrdsdisabled, "onrdsdisabled") GK_ATOM(onrdsenabled, "onrdsenabled") GK_ATOM(onreaderror, "onreaderror")
--- a/dom/bindings/Bindings.conf +++ b/dom/bindings/Bindings.conf @@ -194,20 +194,16 @@ DOMInterfaces = { 'nativeType': 'mozilla::dom::bluetooth::BluetoothPairingHandle', }, 'BluetoothPairingListener': { 'nativeType': 'mozilla::dom::bluetooth::BluetoothPairingListener', }, -'BluetoothPbapRequestHandle': { - 'nativeType': 'mozilla::dom::bluetooth::BluetoothPbapRequestHandle', -}, - 'BoxObject': { 'resultNotAddRefed': ['element'], }, 'Cache': { 'implicitJSContext': [ 'add', 'addAll' ], 'nativeType': 'mozilla::dom::cache::Cache', },
--- a/dom/bluetooth/BluetoothCommon.h +++ b/dom/bluetooth/BluetoothCommon.h @@ -209,23 +209,16 @@ extern bool gBluetoothDebugFlag; /** * When receiving a query about current play status from remote device, we'll * dispatch an event. */ #define REQUEST_MEDIA_PLAYSTATUS_ID "requestmediaplaystatus" /** - * When receiving a PBAP request from a remote device, we'll dispatch an event. - */ -#define PULL_PHONEBOOK_REQ_ID "pullphonebookreq" -#define PULL_VCARD_ENTRY_REQ_ID "pullvcardentryreq" -#define PULL_VCARD_LISTING_REQ_ID "pullvcardlistingreq" - -/** * When the value of a characteristic of a remote BLE device changes, we'll * dispatch an event */ #define GATT_CHARACTERISTIC_CHANGED_ID "characteristicchanged" /** * When a remote BLE device gets connected / disconnected, we'll dispatch an * event.
deleted file mode 100644 --- a/dom/bluetooth/BluetoothPbapRequestHandle.cpp +++ /dev/null @@ -1,182 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* 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 "BluetoothCommon.h" -#include "BluetoothPbapRequestHandle.h" -#include "BluetoothReplyRunnable.h" -#include "BluetoothService.h" - -#include "mozilla/dom/BluetoothPbapRequestHandleBinding.h" -#include "mozilla/dom/ContentChild.h" - -using namespace mozilla; -using namespace dom; - -USING_BLUETOOTH_NAMESPACE - -NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(BluetoothPbapRequestHandle, mOwner) -NS_IMPL_CYCLE_COLLECTING_ADDREF(BluetoothPbapRequestHandle) -NS_IMPL_CYCLE_COLLECTING_RELEASE(BluetoothPbapRequestHandle) -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(BluetoothPbapRequestHandle) - NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY - NS_INTERFACE_MAP_ENTRY(nsISupports) -NS_INTERFACE_MAP_END - -BluetoothPbapRequestHandle::BluetoothPbapRequestHandle(nsPIDOMWindow* aOwner) - : mOwner(aOwner) -{ - MOZ_ASSERT(aOwner); -} - -BluetoothPbapRequestHandle::~BluetoothPbapRequestHandle() -{ -} - -already_AddRefed<BluetoothPbapRequestHandle> -BluetoothPbapRequestHandle::Create(nsPIDOMWindow* aOwner) -{ - MOZ_ASSERT(aOwner); - - nsRefPtr<BluetoothPbapRequestHandle> handle = - new BluetoothPbapRequestHandle(aOwner); - - return handle.forget(); -} - -already_AddRefed<DOMRequest> -BluetoothPbapRequestHandle::ReplyTovCardPulling(Blob& aBlob, - ErrorResult& aRv) -{ - nsCOMPtr<nsPIDOMWindow> win = GetParentObject(); - 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> -BluetoothPbapRequestHandle::ReplyToPhonebookPulling(Blob& aBlob, - uint16_t phonebookSize, - ErrorResult& aRv) -{ - nsCOMPtr<nsPIDOMWindow> win = GetParentObject(); - 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> -BluetoothPbapRequestHandle::ReplyTovCardListing(Blob& aBlob, - uint16_t phonebookSize, - ErrorResult& aRv) -{ - nsCOMPtr<nsPIDOMWindow> win = GetParentObject(); - 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* -BluetoothPbapRequestHandle::WrapObject(JSContext* aCx, - JS::Handle<JSObject*> aGivenProto) -{ - return BluetoothPbapRequestHandleBinding::Wrap(aCx, this, aGivenProto); -}
deleted file mode 100644 --- a/dom/bluetooth/BluetoothPbapRequestHandle.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* 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_bluetooth_bluetoothpbaprequesthandle_h -#define mozilla_dom_bluetooth_bluetoothpbaprequesthandle_h - -#include "nsCOMPtr.h" -#include "mozilla/dom/DOMRequest.h" -#include "mozilla/dom/BlobSet.h" - -namespace mozilla { - class ErrorResult; - namespace dom { - class Blob; - class DOMRequest; - } -} - -BEGIN_BLUETOOTH_NAMESPACE - -class BluetoothPbapRequestHandle final : public nsISupports - , public nsWrapperCache -{ -public: - NS_DECL_CYCLE_COLLECTING_ISUPPORTS - NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(BluetoothPbapRequestHandle) - - static already_AddRefed<BluetoothPbapRequestHandle> - Create(nsPIDOMWindow* aOwner); - - nsPIDOMWindow* GetParentObject() const - { - return mOwner; - } - - virtual JSObject* WrapObject(JSContext* aCx, - JS::Handle<JSObject*> aGivenProto) override; - - already_AddRefed<DOMRequest> ReplyTovCardPulling(Blob& aBlob, - ErrorResult& aRv); - - already_AddRefed<DOMRequest> ReplyToPhonebookPulling(Blob& aBlob, - uint16_t phonebookSize, - ErrorResult& aRv); - - already_AddRefed<DOMRequest> ReplyTovCardListing(Blob& aBlob, - uint16_t phonebookSize, - ErrorResult& aRv); - -private: - BluetoothPbapRequestHandle(nsPIDOMWindow* aOwner); - ~BluetoothPbapRequestHandle(); - - nsCOMPtr<nsPIDOMWindow> mOwner; -}; - -END_BLUETOOTH_NAMESPACE - -#endif // mozilla_dom_bluetooth_bluetoothpbaprequesthandle_h \ No newline at end of file
--- a/dom/bluetooth/ObexBase.cpp +++ b/dom/bluetooth/ObexBase.cpp @@ -15,24 +15,24 @@ BEGIN_BLUETOOTH_NAMESPACE /** * Append byte array and length to header */ int AppendHeader(uint8_t aHeaderId, uint8_t* aRetBuf, int aBufferSize, const uint8_t* aData, int aLength) { int headerLength = aLength + 3; - int writtenLength = (headerLength < aBufferSize) ? headerLength : aBufferSize; aRetBuf[0] = aHeaderId; aRetBuf[1] = (headerLength & 0xFF00) >> 8; aRetBuf[2] = headerLength & 0x00FF; - memcpy(&aRetBuf[3], aData, writtenLength - 3); + memcpy(&aRetBuf[3], aData, (aLength < aBufferSize - 3) ? aLength + : aBufferSize - 3); - return writtenLength; + return headerLength; } /** * Append 4-byte integer to header */ int AppendHeader(uint8_t aHeaderId, uint8_t* aRetBuf, int aValue) { @@ -69,44 +69,16 @@ int AppendHeaderWho(uint8_t* aRetBuf, int aBufferSize, const uint8_t* aWho, int aLength) { return AppendHeader(ObexHeaderId::Who, aRetBuf, aBufferSize, aWho, aLength); } int -AppendHeaderAppParameters(uint8_t* aRetBuf, int aBufferSize, - const uint8_t* aAppParameters, int aLength) -{ - return AppendHeader(ObexHeaderId::AppParameters, aRetBuf, aBufferSize, - aAppParameters, aLength); -} - -int -AppendAppParameter(uint8_t* aRetBuf, int aBufferSize, const uint8_t aTagId, - const uint8_t* aValue, int aLength) -{ - // An application parameter is a [tag]-[length]-[value] triplet. The [tag] and - // [length] fields are 1-byte length each. - - if (aBufferSize < aLength + 2) { - // aBufferSize should be larger than size of AppParameter + header. - BT_WARNING("Return buffer size is too small for the AppParameter"); - return 0; - } - - aRetBuf[0] = aTagId; - aRetBuf[1] = aLength; - memcpy(&aRetBuf[2], aValue, aLength); - - return aLength + 2; -} - -int AppendHeaderLength(uint8_t* aRetBuf, int aObjectLength) { return AppendHeader(ObexHeaderId::Length, aRetBuf, aObjectLength); } int AppendHeaderConnectionId(uint8_t* aRetBuf, int aConnectionId) {
--- a/dom/bluetooth/ObexBase.h +++ b/dom/bluetooth/ObexBase.h @@ -10,37 +10,16 @@ #include "BluetoothCommon.h" #include "nsAutoPtr.h" #include "nsTArray.h" BEGIN_BLUETOOTH_NAMESPACE const char FINAL_BIT = 0x80; -/** - * Section 3.2 "Response format", IrOBEX ver 1.2 - * The format of an OBEX response header is - * [response code:1][response length:2] - */ -static const uint32_t kObexRespHeaderSize = 3; - -/** - * Section 2.2.9 "Body, End-of-Body", IrOBEX ver 1.2 - * The format of an OBEX Body header is - * [headerId:1][header length:2] - */ -static const uint32_t kObexBodyHeaderSize = 3; - -/** - * Section 3.3.1.4 "Minimum OBEX Packet Length", IrOBEX ver 1.2 - * The minimum size of the OBEX Maximum packet length allowed for negotiation is - * 255 bytes. - */ -static const uint32_t kObexLeastMaxSize = 255; - /* * Defined in section 2.1 "OBEX Headers", IrOBEX ver 1.2 */ enum ObexHeaderId { Count = 0xC0, Name = 0x01, Type = 0x42, Length = 0xC3, @@ -267,18 +246,17 @@ public: } // According to OBEX spec., the value 0xFFFFFFFF is reserved and it's // considered invalid for Connection ID. return 0xFFFFFFFF; } /** - * Get a specified parameter from the 'Application Parameters' header with - * big-endian byte ordering. + * Get a specified parameter from the 'Application Parameters' header. * * @param aTagId [in] The tag ID of parameter which is defined by * applications or upper protocol layer. * @param aRetBuf [out] The buffer which is used to return the parameter. * @param aBufferSize [in] The size of the given buffer. * * @return a boolean value to indicate whether the given paramter exists. */ @@ -340,20 +318,16 @@ private: }; int AppendHeaderName(uint8_t* aRetBuf, int aBufferSize, const uint8_t* aName, int aLength); int AppendHeaderBody(uint8_t* aRetBuf, int aBufferSize, const uint8_t* aBody, int aLength); int AppendHeaderWho(uint8_t* aRetBuf, int aBufferSize, const uint8_t* aWho, int aLength); -int AppendHeaderAppParameters(uint8_t* aRetBuf, int aBufferSize, - const uint8_t* aAppParameters, int aLength); -int AppendAppParameter(uint8_t* aRetBuf, int aBufferSize, const uint8_t aTagId, - const uint8_t* aValue, int aLength); int AppendHeaderLength(uint8_t* aRetBuf, int aObjectLength); int AppendHeaderConnectionId(uint8_t* aRetBuf, int aConnectionId); int AppendHeaderEndOfBody(uint8_t* aRetBuf); void SetObexPacketInfo(uint8_t* aRetBuf, uint8_t aOpcode, int aPacketLength); /** * @return true when the message was parsed without any error, false otherwise. */
--- a/dom/bluetooth/bluedroid/BluetoothPbapManager.cpp +++ b/dom/bluetooth/bluedroid/BluetoothPbapManager.cpp @@ -7,22 +7,20 @@ #include "base/basictypes.h" #include "BluetoothPbapManager.h" #include "BluetoothService.h" #include "BluetoothSocket.h" #include "BluetoothUuid.h" #include "ObexBase.h" -#include "mozilla/dom/ipc/BlobParent.h" #include "mozilla/RefPtr.h" #include "mozilla/Services.h" #include "mozilla/StaticPtr.h" #include "nsAutoPtr.h" -#include "nsIInputStream.h" #include "nsIObserver.h" #include "nsIObserverService.h" USING_BLUETOOTH_NAMESPACE using namespace mozilla; using namespace mozilla::dom; using namespace mozilla::ipc; @@ -71,18 +69,16 @@ BluetoothPbapManager::HandleShutdown() MOZ_ASSERT(NS_IsMainThread()); sInShutdown = true; Disconnect(nullptr); sPbapManager = nullptr; } BluetoothPbapManager::BluetoothPbapManager() : mConnected(false) - , mRemoteMaxPacketLength(0) - , mRequirePhonebookSize(false) { mDeviceAddress.AssignLiteral(BLUETOOTH_ADDRESS_NONE); mCurrentPath.AssignLiteral(""); } BluetoothPbapManager::~BluetoothPbapManager() { nsCOMPtr<nsIObserverService> obs = services::GetObserverService(); @@ -216,27 +212,16 @@ BluetoothPbapManager::ReceiveSocketData( // Section 6.4 "Establishing an OBEX Session", PBAP 1.2 // The OBEX header target shall equal to kPbapObexTarget. if (!CompareHeaderTarget(pktHeaders)) { ReplyError(ObexResponseCode::BadRequest); return; } - // Save the max packet length from remote information - mRemoteMaxPacketLength = ((static_cast<int>(data[5]) << 8) | data[6]); - - if (mRemoteMaxPacketLength < kObexLeastMaxSize) { - BT_LOGR("Remote maximum packet length %d is smaller than %d bytes", - mRemoteMaxPacketLength, kObexLeastMaxSize); - mRemoteMaxPacketLength = 0; - ReplyError(ObexResponseCode::BadRequest); - return; - } - ReplyToConnect(); AfterPbapConnected(); break; case ObexRequestCode::Disconnect: case ObexRequestCode::Abort: // Section 3.3.2 "Disconnect" and Section 3.3.5 "Abort", IrOBEX 1.2 // The format of request packet of "Disconnect" and "Abort" are the same // [opcode:1][length:2][Headers:var] @@ -245,90 +230,39 @@ BluetoothPbapManager::ReceiveSocketData( ReplyError(ObexResponseCode::BadRequest); return; } ReplyToDisconnectOrAbort(); AfterPbapDisconnected(); break; case ObexRequestCode::SetPath: { - // Section 3.3.6 "SetPath", IrOBEX 1.2 - // [opcode:1][length:2][flags:1][contants:1][Headers:var] - if (receivedLength < 5 || - !ParseHeaders(&data[5], receivedLength - 5, &pktHeaders)) { - ReplyError(ObexResponseCode::BadRequest); - return; - } - - uint8_t response = SetPhoneBookPath(data[3], pktHeaders); - if (response != ObexResponseCode::Success) { - ReplyError(response); - return; - } - - ReplyToSetPath(); - break; - } - case ObexRequestCode::Get: - // Section 6.2.2 "OBEX Headers in Multi-Packet Responses", IrOBEX 1.2 - // All OBEX request messages shall be sent as one OBEX packet containing - // all of the headers. I.e. OBEX GET with opcode 0x83 shall always be - // used. OBEX GET with opcode 0x03 shall never be used. - BT_WARNING("PBAP shall always uses OBEX GetFinal instead of Get."); + // Section 3.3.6 "SetPath", IrOBEX 1.2 + // [opcode:1][length:2][flags:1][contants:1][Headers:var] + if (receivedLength < 5 || + !ParseHeaders(&data[5], receivedLength - 5, &pktHeaders)) { + ReplyError(ObexResponseCode::BadRequest); + return; + } - // no break. Treat 'Get' as 'GetFinal' for error tolerance. - case ObexRequestCode::GetFinal: { - // As long as 'mVCardDataStream' requires multiple response packets to - // complete, the client should continue to issue GET requests until the - // final body information (in an End-of-Body header) arrives, along with - // the response code 0xA0 Success. - if (mVCardDataStream) { - if (!ReplyToGet(mVCardDataStream)) { - BT_WARNING("Failed to reply to PBAP GET request."); - ReplyError(ObexResponseCode::InternalServerError); + uint8_t response = SetPhoneBookPath(data[3], pktHeaders); + if (response != ObexResponseCode::Success) { + ReplyError(response); + return; } - return; - } - // Section 3.1 "Request format", IrOBEX 1.2 - // The format of an OBEX request is - // [opcode:1][length:2][Headers:var] - if (receivedLength < 3 || - !ParseHeaders(&data[3], receivedLength - 3, &pktHeaders)) { - ReplyError(ObexResponseCode::BadRequest); - return; - } - - nsString type; - pktHeaders.GetContentType(type); - - uint8_t response; - if (type.EqualsLiteral("x-bt/vcard-listing")) { - response = PullvCardListing(pktHeaders); - } else if (type.EqualsLiteral("x-bt/vcard")) { - response = PullvCardEntry(pktHeaders); - } else if (type.EqualsLiteral("x-bt/phonebook")) { - response = PullPhonebook(pktHeaders); - } else { - response = ObexResponseCode::BadRequest; - BT_LOGR("Unknown PBAP request type: %s", - NS_ConvertUTF16toUTF8(type).get()); - } - - // The OBEX success response will be sent after Gaia replies the PBAP - // request. - if (response != ObexResponseCode::Success) { - ReplyError(response); - return; + ReplyToSetPath(); } break; - } case ObexRequestCode::Put: case ObexRequestCode::PutFinal: + case ObexRequestCode::Get: + case ObexRequestCode::GetFinal: ReplyError(ObexResponseCode::BadRequest); + BT_LOGR("Unsupported ObexRequestCode %x", opCode); break; default: ReplyError(ObexResponseCode::NotImplemented); BT_LOGR("Unrecognized ObexRequestCode %x", opCode); break; } } @@ -408,256 +342,16 @@ BluetoothPbapManager::SetPhoneBookPath(u } mCurrentPath = newPath; BT_LOGR("current path [%s]", NS_ConvertUTF16toUTF8(mCurrentPath).get()); return ObexResponseCode::Success; } -uint8_t -BluetoothPbapManager::PullPhonebook(const ObexHeaderSet& aHeader) -{ - MOZ_ASSERT(NS_IsMainThread()); - - BluetoothService* bs = BluetoothService::Get(); - if (!bs) { - return ObexResponseCode::PreconditionFailed; - } - - InfallibleTArray<BluetoothNamedValue> data; - - nsString name; - aHeader.GetName(name); - BT_APPEND_NAMED_VALUE(data, "name", name); - - AppendBtNamedValueByTagId(aHeader, data, AppParameterTag::Format); - AppendBtNamedValueByTagId(aHeader, data, AppParameterTag::PropertySelector); - AppendBtNamedValueByTagId(aHeader, data, AppParameterTag::MaxListCount); - AppendBtNamedValueByTagId(aHeader, data, AppParameterTag::ListStartOffset); - AppendBtNamedValueByTagId(aHeader, data, AppParameterTag::vCardSelector); - - #ifdef MOZ_B2G_BT_API_V1 - bs->DistributeSignal( - BluetoothSignal(NS_LITERAL_STRING(PULL_PHONEBOOK_REQ_ID), - NS_LITERAL_STRING(KEY_ADAPTER), - data)); - #else - bs->DistributeSignal(NS_LITERAL_STRING(PULL_PHONEBOOK_REQ_ID), - NS_LITERAL_STRING(KEY_ADAPTER), - data); - #endif - - return ObexResponseCode::Success; -} - -uint8_t -BluetoothPbapManager::PullvCardListing(const ObexHeaderSet& aHeader) -{ - MOZ_ASSERT(NS_IsMainThread()); - - BluetoothService* bs = BluetoothService::Get(); - if (!bs) { - return ObexResponseCode::PreconditionFailed; - } - - InfallibleTArray<BluetoothNamedValue> data; - - nsString name; - aHeader.GetName(name); - BT_APPEND_NAMED_VALUE(data, "name", name); - - AppendBtNamedValueByTagId(aHeader, data, AppParameterTag::Order); - AppendBtNamedValueByTagId(aHeader, data, AppParameterTag::SearchValue); - AppendBtNamedValueByTagId(aHeader, data, AppParameterTag::SearchProperty); - AppendBtNamedValueByTagId(aHeader, data, AppParameterTag::MaxListCount); - AppendBtNamedValueByTagId(aHeader, data, AppParameterTag::ListStartOffset); - AppendBtNamedValueByTagId(aHeader, data, AppParameterTag::vCardSelector); - - #ifdef MOZ_B2G_BT_API_V1 - bs->DistributeSignal( - BluetoothSignal(NS_LITERAL_STRING(PULL_VCARD_LISTING_REQ_ID), - NS_LITERAL_STRING(KEY_ADAPTER), - data)); - #else - bs->DistributeSignal(NS_LITERAL_STRING(PULL_VCARD_LISTING_REQ_ID), - NS_LITERAL_STRING(KEY_ADAPTER), - data); - #endif - - return ObexResponseCode::Success; -} - -uint8_t -BluetoothPbapManager::PullvCardEntry(const ObexHeaderSet& aHeader) -{ - MOZ_ASSERT(NS_IsMainThread()); - - BluetoothService* bs = BluetoothService::Get(); - if (!bs) { - return ObexResponseCode::PreconditionFailed; - } - - InfallibleTArray<BluetoothNamedValue> data; - - nsString name; - aHeader.GetName(name); - BT_APPEND_NAMED_VALUE(data, "name", name); - - AppendBtNamedValueByTagId(aHeader, data, AppParameterTag::Format); - AppendBtNamedValueByTagId(aHeader, data, AppParameterTag::PropertySelector); - - #ifdef MOZ_B2G_BT_API_V1 - bs->DistributeSignal( - BluetoothSignal(NS_LITERAL_STRING(PULL_VCARD_ENTRY_REQ_ID), - NS_LITERAL_STRING(KEY_ADAPTER), - data)); - #else - bs->DistributeSignal(NS_LITERAL_STRING(PULL_VCARD_ENTRY_REQ_ID), - NS_LITERAL_STRING(KEY_ADAPTER), - data); - #endif - - return ObexResponseCode::Success; -} - -void -BluetoothPbapManager::AppendBtNamedValueByTagId( - const ObexHeaderSet& aHeader, - InfallibleTArray<BluetoothNamedValue>& aValues, - const AppParameterTag aTagId) -{ - uint8_t buf[64]; - - switch (aTagId) { - case AppParameterTag::Order: { - if (!aHeader.GetAppParameter(AppParameterTag::Order, buf, 64)) { - break; - } - - static const nsString sOrderStr[] = {NS_LITERAL_STRING("alphanumeric"), - NS_LITERAL_STRING("indexed"), - NS_LITERAL_STRING("phonetical")}; - uint8_t order = buf[0]; - if (order < MOZ_ARRAY_LENGTH(sOrderStr)) { - BT_APPEND_NAMED_VALUE(aValues, "order", sOrderStr[order]); - } else { - BT_WARNING("%s: Unexpected value '%d' of 'Order'", __FUNCTION__, order); - } - break; - } - case AppParameterTag::SearchValue: { - if (!aHeader.GetAppParameter(AppParameterTag::SearchValue, buf, 64)) { - break; - } - - // Section 5.3.4.3 "SearchValue {<text string>}", PBAP 1.2 - // The UTF-8 character set shall be used for <text string>. - - // Use nsCString to store UTF-8 string here to follow the suggestion of - // 'MDN:Internal_strings'. - nsCString text((char *) buf); - - BT_APPEND_NAMED_VALUE(aValues, "searchText", text); - break; - } - case AppParameterTag::SearchProperty: { - if (!aHeader.GetAppParameter(AppParameterTag::SearchProperty, buf, 64)) { - break; - } - - static const nsString sSearchKeyStr[] = {NS_LITERAL_STRING("name"), - NS_LITERAL_STRING("number"), - NS_LITERAL_STRING("sound")}; - uint8_t searchKey = buf[0]; - if (searchKey < MOZ_ARRAY_LENGTH(sSearchKeyStr)) { - BT_APPEND_NAMED_VALUE(aValues, "searchKey", sSearchKeyStr[searchKey]); - } else { - BT_WARNING("%s: Unexpected value '%d' of 'SearchProperty'", - __FUNCTION__, searchKey); - } - break; - } - case AppParameterTag::MaxListCount: { - if (!aHeader.GetAppParameter(AppParameterTag::MaxListCount, buf, 64)) { - break; - } - - uint16_t maxListCount = *((uint16_t *)buf); - - // convert big endian to little endian - maxListCount = (maxListCount >> 8) | (maxListCount << 8); - - // Section 5 "Phone Book Access Profile Functions", PBAP 1.2 - // Replying 'PhonebookSize' is mandatory if 'MaxListCount' parameter is - // present in the request with a value of 0, else it is excluded. - mRequirePhonebookSize = !maxListCount; - - BT_APPEND_NAMED_VALUE(aValues, "maxListCount", (uint32_t) maxListCount); - break; - } - case AppParameterTag::ListStartOffset: { - if (!aHeader.GetAppParameter(AppParameterTag::ListStartOffset, buf, 64)) { - break; - } - - uint16_t listStartOffset = *((uint16_t *)buf); - - // convert big endian to little endian - listStartOffset = (listStartOffset >> 8) | (listStartOffset << 8); - - BT_APPEND_NAMED_VALUE(aValues, "listStartOffset", - (uint32_t) listStartOffset); - break; - } - case AppParameterTag::PropertySelector: { - if (!aHeader.GetAppParameter( - AppParameterTag::PropertySelector, buf, 64)) { - break; - } - - InfallibleTArray<uint32_t> props = PackPropertiesMask(buf, 64); - - BT_APPEND_NAMED_VALUE(aValues, "propSelector", props); - break; - } - case AppParameterTag::Format: { - if (!aHeader.GetAppParameter(AppParameterTag::Format, buf, 64)) { - break; - } - - bool usevCard3 = buf[0]; - BT_APPEND_NAMED_VALUE(aValues, "format", usevCard3); - break; - } - case AppParameterTag::vCardSelector: { - if (!aHeader.GetAppParameter(AppParameterTag::vCardSelector, buf, 64)) { - break; - } - - InfallibleTArray<uint32_t> props = PackPropertiesMask(buf, 64); - - bool hasVCardSelectorOperator = aHeader.GetAppParameter( - AppParameterTag::vCardSelectorOperator, buf, 64); - - if (hasVCardSelectorOperator && buf[0]) { - BT_APPEND_NAMED_VALUE(aValues, "vCardSelector_AND", - BluetoothValue(props)); - } else { - BT_APPEND_NAMED_VALUE(aValues, "vCardSelector_OR", - BluetoothValue(props)); - } - break; - } - default: - BT_LOGR("Unsupported AppParameterTag: %x", aTagId); - break; - } -} - bool BluetoothPbapManager::IsLegalPath(const nsAString& aPath) { static const char* sLegalPaths[] = { "", // root "/telecom", "/telecom/pb", "/telecom/ich", @@ -689,24 +383,16 @@ BluetoothPbapManager::AfterPbapConnected mCurrentPath.AssignLiteral(""); mConnected = true; } void BluetoothPbapManager::AfterPbapDisconnected() { mConnected = false; - - mRemoteMaxPacketLength = 0; - mRequirePhonebookSize = false; - - if (mVCardDataStream) { - mVCardDataStream->Close(); - mVCardDataStream = nullptr; - } } bool BluetoothPbapManager::IsConnected() { return mConnected; } @@ -721,279 +407,75 @@ BluetoothPbapManager::ReplyToConnect() { if (mConnected) { return; } // Section 3.3.1 "Connect", IrOBEX 1.2 // [opcode:1][length:2][version:1][flags:1][MaxPktSizeWeCanReceive:2] // [Headers:var] - uint8_t res[kObexLeastMaxSize]; + uint8_t req[255]; int index = 7; - res[3] = 0x10; // version=1.0 - res[4] = 0x00; // flag=0x00 - res[5] = BluetoothPbapManager::MAX_PACKET_LENGTH >> 8; - res[6] = (uint8_t)BluetoothPbapManager::MAX_PACKET_LENGTH; + req[3] = 0x10; // version=1.0 + req[4] = 0x00; // flag=0x00 + req[5] = BluetoothPbapManager::MAX_PACKET_LENGTH >> 8; + req[6] = (uint8_t)BluetoothPbapManager::MAX_PACKET_LENGTH; // Section 6.4 "Establishing an OBEX Session", PBAP 1.2 // Headers: [Who:16][Connection ID] - index += AppendHeaderWho(&res[index], kObexLeastMaxSize, - kPbapObexTarget.mUuid, sizeof(BluetoothUuid)); - index += AppendHeaderConnectionId(&res[index], 0x01); + index += AppendHeaderWho(&req[index], 255, kPbapObexTarget.mUuid, + sizeof(BluetoothUuid)); + index += AppendHeaderConnectionId(&req[index], 0x01); - SendObexData(res, ObexResponseCode::Success, index); + SendObexData(req, ObexResponseCode::Success, index); } void BluetoothPbapManager::ReplyToDisconnectOrAbort() { if (!mConnected) { return; } // Section 3.3.2 "Disconnect" and Section 3.3.5 "Abort", IrOBEX 1.2 // The format of response packet of "Disconnect" and "Abort" are the same // [opcode:1][length:2][Headers:var] - uint8_t res[kObexLeastMaxSize]; - int index = kObexRespHeaderSize; + uint8_t req[255]; + int index = 3; - SendObexData(res, ObexResponseCode::Success, index); + SendObexData(req, ObexResponseCode::Success, index); } void BluetoothPbapManager::ReplyToSetPath() { if (!mConnected) { return; } // Section 3.3.6 "SetPath", IrOBEX 1.2 // [opcode:1][length:2][Headers:var] - uint8_t res[kObexLeastMaxSize]; - int index = kObexRespHeaderSize; - - SendObexData(res, ObexResponseCode::Success, index); -} - -InfallibleTArray<uint32_t> -BluetoothPbapManager::PackPropertiesMask(uint8_t* aData, int aSize) -{ - InfallibleTArray<uint32_t> propSelector; - - // Table 5.1 "Property Mask", PBAP 1.2 - // PropertyMask is a 64-bit mask that indicates the properties contained in - // the requested vCard objects. We only support bit 0~31 since the rest are - // reserved for future use or vendor specific properties. - - // convert big endian to little endian - uint32_t x = (aData[7] << 0) | (aData[6] << 8) | - (aData[5] << 16) | (aData[4] << 24); - - uint32_t count = 0; - while (!x) { - if (x & 1) { - propSelector.AppendElement(count); - } - - ++count; - x >>= 1; - } - - return propSelector; -} - -bool -BluetoothPbapManager::ReplyToPullPhonebook(BlobParent* aActor, - uint16_t aPhonebookSize) -{ - nsRefPtr<BlobImpl> impl = aActor->GetBlobImpl(); - nsRefPtr<Blob> blob = Blob::Create(nullptr, impl); - - return ReplyToPullPhonebook(blob.get(), aPhonebookSize); -} - -bool -BluetoothPbapManager::ReplyToPullPhonebook(Blob* aBlob, uint16_t aPhonebookSize) -{ - if (!mConnected) { - return false; - } - - if (!GetInputStreamFromBlob(mVCardDataStream, aBlob)) { - ReplyError(ObexResponseCode::InternalServerError); - return false; - } - - return ReplyToGet(mVCardDataStream, aPhonebookSize); -} - -bool -BluetoothPbapManager::ReplyToPullvCardListing(BlobParent* aActor, - uint16_t aPhonebookSize) -{ - nsRefPtr<BlobImpl> impl = aActor->GetBlobImpl(); - nsRefPtr<Blob> blob = Blob::Create(nullptr, impl); - - return ReplyToPullvCardListing(blob.get(), aPhonebookSize); -} - -bool -BluetoothPbapManager::ReplyToPullvCardListing(Blob* aBlob, - uint16_t aPhonebookSize) -{ - if (!mConnected) { - return false; - } - - if (!GetInputStreamFromBlob(mVCardDataStream, aBlob)) { - ReplyError(ObexResponseCode::InternalServerError); - return false; - } - - return ReplyToGet(mVCardDataStream, aPhonebookSize); -} - -bool -BluetoothPbapManager::ReplyToPullvCardEntry(BlobParent* aActor) -{ - nsRefPtr<BlobImpl> impl = aActor->GetBlobImpl(); - nsRefPtr<Blob> blob = Blob::Create(nullptr, impl); - - return ReplyToPullvCardEntry(blob.get()); -} - -bool -BluetoothPbapManager::ReplyToPullvCardEntry(Blob* aBlob) -{ - if (!mConnected) { - return false; - } - - if (!GetInputStreamFromBlob(mVCardDataStream, aBlob)) { - ReplyError(ObexResponseCode::InternalServerError); - return false; - } + uint8_t req[255]; + int index = 3; - return ReplyToGet(mVCardDataStream); -} - -bool -BluetoothPbapManager::ReplyToGet(nsIInputStream* aStream, - uint16_t aPhonebookSize) -{ - MOZ_ASSERT(aStream); - MOZ_ASSERT(mRemoteMaxPacketLength >= kObexLeastMaxSize); - - // This response will be composed by these four parts. - // Part 1: [response code:1][length:2] - // Part 2: [headerId:1][length:2][PhonebookSize:4] (optional) - // Part 3: [headerId:1][length:2][Body:var] - // Part 4: [headerId:1][length:2][EndOfBody:0] (optional) - - uint8_t* res = new uint8_t[mRemoteMaxPacketLength]; - - // ---- Part 1, move index for [response code:1][length:2] ---- // - // res[0~2] will be set in SendObexData() - unsigned int index = kObexRespHeaderSize; - - // ---- Part 2, add [response code:1][length:2] to response ---- // - if (mRequirePhonebookSize) { - // convert little endian to big endian - uint8_t phonebookSize[2]; - phonebookSize[0] = (aPhonebookSize & 0xFF00) >> 8; - phonebookSize[1] = aPhonebookSize & 0x00FF; - - // Section 6.2.1 "Application Parameters Header", PBAP 1.2 - // appParameters: [headerId:1][length:2][PhonebookSize:4], where - // [PhonebookSize:4] = [tagId:1][length:1][value:2] - uint8_t appParameters[4]; - AppendAppParameter(appParameters, - sizeof(appParameters), - (uint8_t) AppParameterTag::PhonebookSize, - phonebookSize, - sizeof(phonebookSize)); - - index += AppendHeaderAppParameters(&res[index], - mRemoteMaxPacketLength, - appParameters, - sizeof(appParameters)); - mRequirePhonebookSize = false; - } - - // ---- Part 3, add [headerId:1][length:2][Body:var] to response ---- // - // Remaining packet size to append Body, excluding Body's header - uint32_t remainingPacketSize = mRemoteMaxPacketLength - kObexBodyHeaderSize - - index; - - // Read vCard data from input stream - uint32_t numRead = 0; - nsAutoArrayPtr<char> buffer(new char[remainingPacketSize]); - nsresult rv = aStream->Read(buffer, remainingPacketSize, &numRead); - if (NS_FAILED(rv)) { - BT_WARNING("Failed to read from input stream."); - return false; - } - - if (numRead) { - index += AppendHeaderBody(&res[index], - remainingPacketSize, - (uint8_t*) buffer.forget(), - numRead); - } - - // More GET requests are required if remaining packet size isn't - // enough for 1) number of bytes read and 2) one EndOfBody's header - uint8_t opcode; - if (numRead + kObexBodyHeaderSize > remainingPacketSize) { - opcode = ObexResponseCode::Continue; - } else { - // ---- Part 4, add [headerId:1][length:2][EndOfBody:var] to response --- // - opcode = ObexResponseCode::Success; - index += AppendHeaderEndOfBody(&res[index]); - - aStream->Close(); - aStream = nullptr; - } - - SendObexData(res, opcode, index); - delete [] res; - - return true; -} - -bool -BluetoothPbapManager::GetInputStreamFromBlob(nsIInputStream* aStream, - Blob* aBlob) -{ - // PBAP can only handle one OBEX BODY transfer at the same time. - if (mVCardDataStream) { - BT_WARNING("Shouldn't handle multiple PBAP responses at the same time"); - mVCardDataStream->Close(); - mVCardDataStream = nullptr; - } - - ErrorResult rv; - aBlob->GetInternalStream(getter_AddRefs(mVCardDataStream), rv); - if (NS_WARN_IF(rv.Failed())) { - return false; - } - - return true; + SendObexData(req, ObexResponseCode::Success, index); } void BluetoothPbapManager::ReplyError(uint8_t aError) { BT_LOGR("[0x%x]", aError); // Section 3.2 "Response Format", IrOBEX 1.2 - // [response code:1][length:2][data:var] - uint8_t res[kObexLeastMaxSize]; - SendObexData(res, aError, kObexBodyHeaderSize); + // [opcode:1][length:2][Headers:var] + uint8_t req[255]; + int index = 3; + + SendObexData(req, aError, index); } void BluetoothPbapManager::SendObexData(uint8_t* aData, uint8_t aOpcode, int aSize) { SetObexPacketInfo(aData, aOpcode, aSize); mSocket->SendSocketData(new UnixSocketRawData(aData, aSize)); }
--- a/dom/bluetooth/bluedroid/BluetoothPbapManager.h +++ b/dom/bluetooth/bluedroid/BluetoothPbapManager.h @@ -5,200 +5,98 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef mozilla_dom_bluetooth_bluedroid_BluetoothPbapManager_h #define mozilla_dom_bluetooth_bluedroid_BluetoothPbapManager_h #include "BluetoothCommon.h" #include "BluetoothProfileManagerBase.h" #include "BluetoothSocketObserver.h" -#include "mozilla/dom/bluetooth/BluetoothTypes.h" #include "mozilla/ipc/SocketBase.h" -class nsIInputStream; - -namespace mozilla { - namespace dom { - class Blob; - class BlobParent; - } -} - BEGIN_BLUETOOTH_NAMESPACE /* * Defined in section 6.2.1 "Application Parameters Header", PBAP ver 1.2 */ enum AppParameterTag { Order = 0x01, SearchValue = 0x02, SearchProperty = 0x03, MaxListCount = 0x04, ListStartOffset = 0x05, PropertySelector = 0x06, Format = 0x07, PhonebookSize = 0x08, NewMissedCalls = 0x09, - // ----- enumerators below are supported since PBAP 1.2 ----- // PrimaryVersionCounter = 0x0A, SecondaryVersionCounter = 0x0B, vCardSelector = 0x0C, DatabaseIdentifier = 0x0D, vCardSelectorOperator = 0x0E, ResetNewMissedCalls = 0x0F, PbapSupportedFeatures = 0x10 }; class BluetoothSocket; class ObexHeaderSet; class BluetoothPbapManager : public BluetoothSocketObserver - , public BluetoothProfileManagerBase + , public BluetoothProfileManagerBase { public: BT_DECL_PROFILE_MGR_BASE BT_DECL_SOCKET_OBSERVER virtual void GetName(nsACString& aName) { aName.AssignLiteral("PBAP"); } static const int MAX_PACKET_LENGTH = 0xFFFE; static BluetoothPbapManager* Get(); 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 - * - * @return true if the response packet has been packed correctly and started - * to be sent to the remote device; false otherwise. - */ - bool 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 - * - * @return true if the response packet has been packed correctly and started - * to be sent to the remote device; false otherwise. - */ - bool 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 - * - * @return true if the response packet has been packed correctly and started - * to be sent to the remote device; false otherwise. - */ - bool 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 - * - * @return true if the response packet has been packed correctly and started - * to be sent to the remote device; false otherwise. - */ - bool ReplyToPullvCardListing(Blob* aBlob, uint16_t aPhonebookSize); - - /** - * Reply vCard object to the *IPC* 'pullvcardentry' request. - * - * @param aActor [in] a blob actor containing the vCard objects - * - * @return true if the response packet has been packed correctly and started - * to be sent to the remote device; false otherwise. - */ - bool ReplyToPullvCardEntry(BlobParent* aActor); - - /** - * Reply vCard object to the *in-process* 'pullvcardentry' request. - * - * @param aBlob [in] a blob contained the vCard objects - * - * @return true if the response packet has been packed correctly and started - * to be sent to the remote device; false otherwise. - */ - bool ReplyToPullvCardEntry(Blob* aBlob); - protected: virtual ~BluetoothPbapManager(); private: BluetoothPbapManager(); bool Init(); void HandleShutdown(); void ReplyToConnect(); void ReplyToDisconnectOrAbort(); void ReplyToSetPath(); void ReplyError(uint8_t aError); void SendObexData(uint8_t* aData, uint8_t aOpcode, int aSize); - bool ReplyToGet(nsIInputStream* aStream, uint16_t aPhonebookSize = 0); - bool GetInputStreamFromBlob(nsIInputStream* aStream, Blob* aBlob); uint8_t SetPhoneBookPath(uint8_t flags, const ObexHeaderSet& aHeader); - uint8_t PullPhonebook(const ObexHeaderSet& aHeader); - uint8_t PullvCardListing(const ObexHeaderSet& aHeader); - uint8_t PullvCardEntry(const ObexHeaderSet& aHeader); - void AppendBtNamedValueByTagId( - const ObexHeaderSet& aHeader, - InfallibleTArray<BluetoothNamedValue>& aValues, - const AppParameterTag aTagId); - - InfallibleTArray<uint32_t> PackPropertiesMask(uint8_t* aData, int aSize); bool CompareHeaderTarget(const ObexHeaderSet& aHeader); bool IsLegalPath(const nsAString& aPath); void AfterPbapConnected(); void AfterPbapDisconnected(); /** * Current phonebook path */ nsString mCurrentPath; /** * OBEX session status. Set when OBEX session is established. */ bool mConnected; nsString mDeviceAddress; - /** - * Maximum packet length that remote device can receive - */ - unsigned int mRemoteMaxPacketLength; - // If a connection has been established, mSocket will be the socket // communicating with the remote socket. We maintain the invariant that if // mSocket is non-null, mServerSocket must be null (and vice versa). nsRefPtr<BluetoothSocket> mSocket; // Server socket. Once an inbound connection is established, it will hand // over the ownership to mSocket, and get a new server socket while Listen() // is called. nsRefPtr<BluetoothSocket> mServerSocket; - - /** - * The data stream of vCards which is used in current processing response. - */ - nsCOMPtr<nsIInputStream> mVCardDataStream; - - /** - * A flag to indicate whether 'PhonebookSize' is mandatory for next OBEX - * response - */ - bool mRequirePhonebookSize; }; END_BLUETOOTH_NAMESPACE #endif // mozilla_dom_bluetooth_bluedroid_BluetoothPbapManager_h
--- a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp +++ b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp @@ -1166,119 +1166,16 @@ BluetoothServiceBluedroid::IsScoConnecte DispatchReplyError(aRunnable, NS_LITERAL_STRING("IsScoConnected failed")); return; } 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 BluetoothServiceBluedroid::SendMetaData(const nsAString& aTitle, const nsAString& aArtist, const nsAString& aAlbum, int64_t aMediaNumber, int64_t aTotalMediaCount, int64_t aDuration, BluetoothReplyRunnable* aRunnable) {
--- a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.h +++ b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.h @@ -138,47 +138,16 @@ public: virtual void DisconnectSco(BluetoothReplyRunnable* aRunnable); virtual void 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 AnswerWaitingCall(BluetoothReplyRunnable* aRunnable); virtual void IgnoreWaitingCall(BluetoothReplyRunnable* aRunnable); virtual void ToggleCalls(BluetoothReplyRunnable* aRunnable);
--- a/dom/bluetooth/bluetooth2/BluetoothAdapter.cpp +++ b/dom/bluetooth/bluetooth2/BluetoothAdapter.cpp @@ -11,31 +11,27 @@ #include "nsIDocument.h" #include "nsIPrefBranch.h" #include "nsIPrefService.h" #include "nsIPrincipal.h" #include "nsTArrayHelpers.h" #include "mozilla/dom/BluetoothAdapterBinding.h" #include "mozilla/dom/BluetoothAttributeEvent.h" -#include "mozilla/dom/BluetoothPhonebookPullingEvent.h" #include "mozilla/dom/BluetoothStatusChangedEvent.h" -#include "mozilla/dom/BluetoothVCardListingEvent.h" -#include "mozilla/dom/BluetoothVCardPullingEvent.h" #include "mozilla/dom/ContentChild.h" #include "mozilla/dom/Event.h" #include "mozilla/dom/File.h" #include "mozilla/dom/bluetooth/BluetoothAdapter.h" #include "mozilla/dom/bluetooth/BluetoothClassOfDevice.h" #include "mozilla/dom/bluetooth/BluetoothDevice.h" #include "mozilla/dom/bluetooth/BluetoothDiscoveryHandle.h" #include "mozilla/dom/bluetooth/BluetoothGattServer.h" #include "mozilla/dom/bluetooth/BluetoothPairingListener.h" -#include "mozilla/dom/bluetooth/BluetoothPbapRequestHandle.h" #include "mozilla/dom/bluetooth/BluetoothTypes.h" using namespace mozilla; using namespace mozilla::dom; USING_BLUETOOTH_NAMESPACE NS_IMPL_CYCLE_COLLECTION_CLASS(BluetoothAdapter) @@ -523,22 +519,16 @@ BluetoothAdapter::Notify(const Bluetooth init.mAddress = address; init.mStatus = status; nsRefPtr<BluetoothStatusChangedEvent> event = BluetoothStatusChangedEvent::Constructor(this, aData.name(), init); DispatchTrustedEvent(event); } else if (aData.name().EqualsLiteral(PAIRING_ABORTED_ID) || aData.name().EqualsLiteral(REQUEST_MEDIA_PLAYSTATUS_ID)) { DispatchEmptyEvent(aData.name()); - } else if (aData.name().EqualsLiteral(PULL_PHONEBOOK_REQ_ID)) { - HandlePullPhonebookReq(aData.value()); - } else if (aData.name().EqualsLiteral(PULL_VCARD_ENTRY_REQ_ID)) { - HandlePullVCardEntryReq(aData.value()); - } else if (aData.name().EqualsLiteral(PULL_VCARD_LISTING_REQ_ID)) { - HandlePullVCardListingReq(aData.value()); } else { BT_WARNING("Not handling adapter signal: %s", NS_ConvertUTF16toUTF8(aData.name()).get()); } } void BluetoothAdapter::SetDiscoveryHandleInUse( @@ -1196,188 +1186,16 @@ BluetoothAdapter::HandleDeviceUnpaired(c // Notify application of unpaired device BluetoothDeviceEventInit init; init.mAddress = deviceAddress; DispatchDeviceEvent(NS_LITERAL_STRING(DEVICE_UNPAIRED_ID), init); } void -BluetoothAdapter::HandlePullPhonebookReq(const BluetoothValue& aValue) -{ - MOZ_ASSERT(aValue.type() == BluetoothValue::TArrayOfBluetoothNamedValue); - const InfallibleTArray<BluetoothNamedValue>& arr = - aValue.get_ArrayOfBluetoothNamedValue(); - - MOZ_ASSERT(arr.Length() >= 1 && - arr[0].value().type() == BluetoothValue::TnsString); - - BluetoothPhonebookPullingEventInit init; - - for (uint32_t i = 0, propCount = arr.Length(); i < propCount; ++i) { - const nsString& name = arr[i].name(); - const BluetoothValue& value = arr[i].value(); - if (name.EqualsLiteral("name")) { - init.mName = value.get_nsString(); - } else if (name.EqualsLiteral("format")) { - init.mFormat = value.get_bool() ? vCardVersion::VCard30 - : vCardVersion::VCard21; - } else if (name.EqualsLiteral("propSelector")) { - init.mPropSelector = getVCardProperties(value); - } else if (name.EqualsLiteral("maxListCount")) { - init.mMaxListCount = value.get_uint32_t(); - } else if (name.EqualsLiteral("listStartOffset")) { - init.mListStartOffset = value.get_uint32_t(); - } else if (name.EqualsLiteral("vCardSelector_AND")) { - init.mVcardSelector = getVCardProperties(value); - init.mVcardSelectorOperator = vCardSelectorOp::AND; - } else if (name.EqualsLiteral("vCardSelector_OR")) { - init.mVcardSelector = getVCardProperties(value); - init.mVcardSelectorOperator = vCardSelectorOp::OR; - } - } - - init.mHandle = BluetoothPbapRequestHandle::Create(GetOwner()); - - nsRefPtr<BluetoothPhonebookPullingEvent> event = - BluetoothPhonebookPullingEvent::Constructor(this, - NS_LITERAL_STRING(PULL_PHONEBOOK_REQ_ID), init); - DispatchTrustedEvent(event); -} - -void -BluetoothAdapter::HandlePullVCardEntryReq(const BluetoothValue& aValue) -{ - MOZ_ASSERT(aValue.type() == BluetoothValue::TArrayOfBluetoothNamedValue); - const InfallibleTArray<BluetoothNamedValue>& arr = - aValue.get_ArrayOfBluetoothNamedValue(); - - MOZ_ASSERT(arr.Length() >= 1 && - arr[0].value().type() == BluetoothValue::TnsString); - - BluetoothVCardPullingEventInit init; - Sequence<vCardProperties> propSelector; - - for (uint32_t i = 0, propCount = arr.Length(); i < propCount; ++i) { - const nsString& name = arr[i].name(); - const BluetoothValue& value = arr[i].value(); - if (name.EqualsLiteral("name")) { - init.mName = value.get_nsString(); - } else if (name.EqualsLiteral("format")) { - init.mFormat = value.get_bool() ? vCardVersion::VCard30 - : vCardVersion::VCard21; - } else if (name.EqualsLiteral("propSelector")) { - init.mPropSelector = getVCardProperties(value); - } - } - - init.mHandle = BluetoothPbapRequestHandle::Create(GetOwner()); - - nsRefPtr<BluetoothVCardPullingEvent> event = - BluetoothVCardPullingEvent::Constructor(this, - NS_LITERAL_STRING(PULL_VCARD_ENTRY_REQ_ID), init); - DispatchTrustedEvent(event); -} - -void -BluetoothAdapter::HandlePullVCardListingReq(const BluetoothValue& aValue) -{ - MOZ_ASSERT(aValue.type() == BluetoothValue::TArrayOfBluetoothNamedValue); - const InfallibleTArray<BluetoothNamedValue>& arr = - aValue.get_ArrayOfBluetoothNamedValue(); - - MOZ_ASSERT(arr.Length() >= 1 && - arr[0].value().type() == BluetoothValue::TnsString); - - BluetoothVCardListingEventInit init; - - for (uint32_t i = 0, propCount = arr.Length(); i < propCount; ++i) { - const nsString& name = arr[i].name(); - const BluetoothValue& value = arr[i].value(); - if (name.EqualsLiteral("name")) { - init.mName = value.get_nsString(); - } else if (name.EqualsLiteral("order")) { - init.mOrder = ConvertStringToVCardOrderType(value.get_nsString()); - } else if (name.EqualsLiteral("searchText")) { - init.mSearchValue = value.get_nsString(); - } else if (name.EqualsLiteral("searchKey")) { - init.mSearchKey = ConvertStringToVCardSearchKeyType(value.get_nsString()); - } else if (name.EqualsLiteral("maxListCount")) { - init.mMaxListCount = value.get_uint32_t(); - } else if (name.EqualsLiteral("listStartOffset")) { - init.mListStartOffset = value.get_uint32_t(); - } else if (name.EqualsLiteral("vCardSelector_AND")) { - init.mVcardSelector = getVCardProperties(value); - init.mVcardSelectorOperator = vCardSelectorOp::AND; - } else if (name.EqualsLiteral("vCardSelector_OR")) { - init.mVcardSelector = getVCardProperties(value); - init.mVcardSelectorOperator = vCardSelectorOp::OR; - } - } - - init.mHandle = BluetoothPbapRequestHandle::Create(GetOwner()); - - nsRefPtr<BluetoothVCardListingEvent> event = - BluetoothVCardListingEvent::Constructor(this, - NS_LITERAL_STRING(PULL_VCARD_LISTING_REQ_ID), init); - DispatchTrustedEvent(event); -} - -Sequence<vCardProperties> -BluetoothAdapter::getVCardProperties(const BluetoothValue &aValue) -{ - MOZ_ASSERT(aValue.type() == BluetoothValue::TArrayOfuint32_t); - - Sequence<vCardProperties> propSelector; - - const InfallibleTArray<uint32_t>& propSelectorArr = - aValue.get_ArrayOfuint32_t(); - for (uint32_t i = 0; i < propSelectorArr.Length(); ++i) { - propSelector.AppendElement( - static_cast<vCardProperties>(propSelectorArr[i]), mozilla::fallible); - } - - return propSelector; -} - -vCardOrderType -BluetoothAdapter::ConvertStringToVCardOrderType(const nsAString& aString) -{ - using namespace mozilla::dom::vCardOrderTypeValues; - - for (size_t index = 0; index < ArrayLength(strings) - 1; index++) { - if (aString.LowerCaseEqualsASCII(strings[index].value, - strings[index].length)) { - return static_cast<vCardOrderType>(index); - } - } - - BT_WARNING("Treat the unexpected string '%s' as vCardOrderType::Indexed", - NS_ConvertUTF16toUTF8(aString).get()); - return vCardOrderType::Indexed; // The default value is 'Indexed'. -} - -vCardSearchKeyType -BluetoothAdapter::ConvertStringToVCardSearchKeyType(const nsAString& aString) -{ - using namespace mozilla::dom::vCardSearchKeyTypeValues; - - for (size_t index = 0; index < ArrayLength(strings) - 1; index++) { - if (aString.LowerCaseEqualsASCII(strings[index].value, - strings[index].length)) { - return static_cast<vCardSearchKeyType>(index); - } - } - - BT_WARNING("Treat the unexpected string '%s' as vCardSearchKeyType::Name", - NS_ConvertUTF16toUTF8(aString).get()); - return vCardSearchKeyType::Name; // The default value is 'Name'. -} - -void BluetoothAdapter::DispatchAttributeEvent(const Sequence<nsString>& aTypes) { MOZ_ASSERT(!aTypes.IsEmpty()); BluetoothAttributeEventInit init; init.mAttrs = aTypes; nsRefPtr<BluetoothAttributeEvent> event =
--- a/dom/bluetooth/bluetooth2/BluetoothAdapter.h +++ b/dom/bluetooth/bluetooth2/BluetoothAdapter.h @@ -7,17 +7,16 @@ #ifndef mozilla_dom_bluetooth_BluetoothAdapter_h #define mozilla_dom_bluetooth_BluetoothAdapter_h #include "BluetoothCommon.h" #include "mozilla/Attributes.h" #include "mozilla/DOMEventTargetHelper.h" #include "mozilla/dom/BluetoothAdapterBinding.h" #include "mozilla/dom/BluetoothDeviceEvent.h" -#include "mozilla/dom/BluetoothPbapParametersBinding.h" #include "mozilla/dom/Promise.h" #include "nsCOMPtr.h" namespace mozilla { namespace dom { class Blob; class DOMRequest; struct MediaMetaData; @@ -85,19 +84,16 @@ public: * Event Handlers ***************************************************************************/ IMPL_EVENT_HANDLER(attributechanged); IMPL_EVENT_HANDLER(devicepaired); IMPL_EVENT_HANDLER(deviceunpaired); IMPL_EVENT_HANDLER(pairingaborted); IMPL_EVENT_HANDLER(a2dpstatuschanged); IMPL_EVENT_HANDLER(hfpstatuschanged); - IMPL_EVENT_HANDLER(pullphonebookreq); - IMPL_EVENT_HANDLER(pullvcardentryreq); - IMPL_EVENT_HANDLER(pullvcardlistingreq); IMPL_EVENT_HANDLER(requestmediaplaystatus); IMPL_EVENT_HANDLER(scostatuschanged); /**************************************************************************** * Methods (Web API Implementation) ***************************************************************************/ already_AddRefed<Promise> Enable(ErrorResult& aRv); already_AddRefed<Promise> Disable(ErrorResult& aRv); @@ -286,83 +282,16 @@ private: /** * Handle "LeDeviceFound" bluetooth signal. * * @param aValue [in] Properties array of the scanned device. */ void HandleLeDeviceFound(const BluetoothValue& aValue); /** - * Handle PULL_PHONEBOOK_REQ_ID bluetooth signal. - * - * @param aValue [in] Properties array of the PBAP request. - * The array should contain few properties: - * - nsString 'name' - * - bool 'format' - * - uint32_t[] 'propSelector' - * - uint32_t 'maxListCount' - * - uint32_t 'listStartOffset' - * - uint32_t[] 'vCardSelector_AND' - * - uint32_t[] 'vCardSelector_AND' - */ - void HandlePullPhonebookReq(const BluetoothValue& aValue); - - /** - * Handle PULL_VCARD_ENTRY_REQ_ID bluetooth signal. - * - * @param aValue [in] Properties array of the PBAP request. - * The array should contain few properties: - * - nsString 'name' - * - bool 'format' - * - uint32_t[] 'propSelector' - */ - void HandlePullVCardEntryReq(const BluetoothValue& aValue); - - /** - * Handle PULL_VCARD_LISTING_REQ_ID bluetooth signal. - * - * @param aValue [in] Properties array of the PBAP request. - * The array should contain few properties: - * - nsString 'name' - * - nsString 'order' - * - nsString 'searchText' - * - nsString 'searchKey' - * - uint32_t 'maxListCount' - * - uint32_t 'listStartOffset' - * - uint32_t[] 'vCardSelector_AND' - * - uint32_t[] 'vCardSelector_AND' - */ - void HandlePullVCardListingReq(const BluetoothValue& aValue); - - /** - * Get a Sequence of vCard properies from a BluetoothValue. The name of - * BluetoothValue must be propSelector, vCardSelector_OR or vCardSelector_AND. - * - * @param aValue [in] a BluetoothValue with 'TArrayOfuint32_t' type - * The name of BluetoothValue must be 'propSelector', - * 'vCardSelector_OR' or 'vCardSelector_AND'. - */ - Sequence<vCardProperties> getVCardProperties(const BluetoothValue &aValue); - - /** - * Convert string to vCardOrderType. - * - * @param aString [in] String to convert - */ - vCardOrderType ConvertStringToVCardOrderType(const nsAString& aString); - - /** - * Convert string to vCardSearchKeyType. - * - * @param aString [in] String to convert - */ - vCardSearchKeyType ConvertStringToVCardSearchKeyType( - const nsAString& aString); - - /** * Fire BluetoothAttributeEvent to trigger onattributechanged event handler. * * @param aTypes [in] Array of changed attributes. Must be non-empty. */ void DispatchAttributeEvent(const Sequence<nsString>& aTypes); /** * Fire BluetoothDeviceEvent to trigger
--- a/dom/bluetooth/bluetooth2/BluetoothService.h +++ b/dom/bluetooth/bluetooth2/BluetoothService.h @@ -4,17 +4,16 @@ * 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_bluetooth_BluetoothService_h #define mozilla_dom_bluetooth_BluetoothService_h #include "BluetoothCommon.h" #include "BluetoothInterface.h" -#include "BluetoothPbapRequestHandle.h" #include "BluetoothProfileManagerBase.h" #include "nsAutoPtr.h" #include "nsClassHashtable.h" #include "nsIObserver.h" #include "nsTObserverArray.h" #include "nsThreadUtils.h" namespace mozilla { @@ -306,47 +305,16 @@ public: ConnectSco(BluetoothReplyRunnable* aRunnable) = 0; virtual void DisconnectSco(BluetoothReplyRunnable* aRunnable) = 0; virtual void 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 virtual void AnswerWaitingCall(BluetoothReplyRunnable* aRunnable) = 0; virtual void IgnoreWaitingCall(BluetoothReplyRunnable* aRunnable) = 0; virtual void
--- a/dom/bluetooth/bluetooth2/ipc/BluetoothParent.cpp +++ b/dom/bluetooth/bluetooth2/ipc/BluetoothParent.cpp @@ -241,22 +241,16 @@ BluetoothParent::RecvPBluetoothRequestCo case Request::TDenyReceivingFileRequest: return actor->DoRequest(aRequest.get_DenyReceivingFileRequest()); case Request::TConnectScoRequest: return actor->DoRequest(aRequest.get_ConnectScoRequest()); case Request::TDisconnectScoRequest: return actor->DoRequest(aRequest.get_DisconnectScoRequest()); case Request::TIsScoConnectedRequest: 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 case Request::TAnswerWaitingCallRequest: return actor->DoRequest(aRequest.get_AnswerWaitingCallRequest()); case Request::TIgnoreWaitingCallRequest: return actor->DoRequest(aRequest.get_IgnoreWaitingCallRequest()); case Request::TToggleCallsRequest: return actor->DoRequest(aRequest.get_ToggleCallsRequest()); #endif @@ -712,54 +706,16 @@ BluetoothRequestParent::DoRequest(const { MOZ_ASSERT(mService); MOZ_ASSERT(mRequestType == Request::TIsScoConnectedRequest); mService->IsScoConnected(mReplyRunnable.get()); 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 bool BluetoothRequestParent::DoRequest(const AnswerWaitingCallRequest& aRequest) { MOZ_ASSERT(mService); MOZ_ASSERT(mRequestType == Request::TAnswerWaitingCallRequest); mService->AnswerWaitingCall(mReplyRunnable.get());
--- a/dom/bluetooth/bluetooth2/ipc/BluetoothParent.h +++ b/dom/bluetooth/bluetooth2/ipc/BluetoothParent.h @@ -207,25 +207,16 @@ protected: DoRequest(const ConnectScoRequest& aRequest); bool DoRequest(const DisconnectScoRequest& aRequest); bool DoRequest(const IsScoConnectedRequest& aRequest); - bool - DoRequest(const ReplyTovCardPullingRequest& aRequest); - - bool - DoRequest(const ReplyToPhonebookPullingRequest& aRequest); - - bool - DoRequest(const ReplyTovCardListingRequest& aRequest); - #ifdef MOZ_B2G_RIL bool DoRequest(const AnswerWaitingCallRequest& aRequest); bool DoRequest(const IgnoreWaitingCallRequest& aRequest); bool
--- a/dom/bluetooth/bluetooth2/ipc/BluetoothServiceChildProcess.cpp +++ b/dom/bluetooth/bluetooth2/ipc/BluetoothServiceChildProcess.cpp @@ -361,76 +361,16 @@ BluetoothServiceChildProcess::Disconnect } void BluetoothServiceChildProcess::IsScoConnected(BluetoothReplyRunnable* aRunnable) { 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 void BluetoothServiceChildProcess::AnswerWaitingCall( BluetoothReplyRunnable* aRunnable) { SendRequest(aRunnable, AnswerWaitingCallRequest()); }
--- a/dom/bluetooth/bluetooth2/ipc/BluetoothServiceChildProcess.h +++ b/dom/bluetooth/bluetooth2/ipc/BluetoothServiceChildProcess.h @@ -153,47 +153,16 @@ public: ConnectSco(BluetoothReplyRunnable* aRunnable) override; virtual void DisconnectSco(BluetoothReplyRunnable* aRunnable) override; virtual void 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 virtual void AnswerWaitingCall(BluetoothReplyRunnable* aRunnable) override; virtual void IgnoreWaitingCall(BluetoothReplyRunnable* aRunnable) override; virtual void
--- a/dom/bluetooth/bluetooth2/ipc/BluetoothTypes.ipdlh +++ b/dom/bluetooth/bluetooth2/ipc/BluetoothTypes.ipdlh @@ -25,22 +25,20 @@ namespace bluetooth { * Value structure for returns from bluetooth. Currently modeled after dbus * returns, which can be a 32-bit int, an UTF16 string, a bool, or an array of * UTF16 strings. Can also hold key-value pairs for dictionary-ish access. */ union BluetoothValue { int32_t; uint32_t; - nsCString; nsString; bool; nsString[]; uint8_t[]; - uint32_t[]; BluetoothNamedValue[]; BluetoothGattId; BluetoothGattId[]; BluetoothGattServiceId; BluetoothGattServiceId[]; BluetoothGattCharAttribute[]; };
--- a/dom/bluetooth/bluetooth2/ipc/PBluetooth.ipdl +++ b/dom/bluetooth/bluetooth2/ipc/PBluetooth.ipdl @@ -166,33 +166,16 @@ struct ConnectScoRequest struct DisconnectScoRequest { }; struct IsScoConnectedRequest { }; -struct ReplyTovCardPullingRequest -{ - PBlob blob; -}; - -struct ReplyToPhonebookPullingRequest -{ - PBlob blob; - uint16_t phonebookSize; -}; - -struct ReplyTovCardListingRequest -{ - PBlob blob; - uint16_t phonebookSize; -}; - struct AnswerWaitingCallRequest { }; struct IgnoreWaitingCallRequest { }; @@ -335,19 +318,16 @@ union Request DisconnectRequest; SendFileRequest; StopSendingFileRequest; ConfirmReceivingFileRequest; DenyReceivingFileRequest; ConnectScoRequest; DisconnectScoRequest; IsScoConnectedRequest; - ReplyTovCardPullingRequest; - ReplyToPhonebookPullingRequest; - ReplyTovCardListingRequest; AnswerWaitingCallRequest; IgnoreWaitingCallRequest; ToggleCallsRequest; SendMetaDataRequest; SendPlayStatusRequest; ConnectGattClientRequest; DisconnectGattClientRequest; DiscoverGattServicesRequest;
--- a/dom/bluetooth/bluez/BluetoothDBusService.cpp +++ b/dom/bluetooth/bluez/BluetoothDBusService.cpp @@ -4393,57 +4393,8 @@ BluetoothDBusService::GattServerDisconne { } void BluetoothDBusService::UnregisterGattServerInternal( int aServerIf, 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) -{ -}
--- a/dom/bluetooth/bluez/BluetoothDBusService.h +++ b/dom/bluetooth/bluez/BluetoothDBusService.h @@ -152,47 +152,16 @@ public: ConnectSco(BluetoothReplyRunnable* aRunnable) override; virtual void DisconnectSco(BluetoothReplyRunnable* aRunnable) override; virtual void 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 virtual void AnswerWaitingCall(BluetoothReplyRunnable* aRunnable); virtual void IgnoreWaitingCall(BluetoothReplyRunnable* aRunnable); virtual void
--- a/dom/bluetooth/moz.build +++ b/dom/bluetooth/moz.build @@ -8,17 +8,16 @@ if CONFIG['MOZ_B2G_BT']: # # Generic code # SOURCES += [ 'BluetoothHidManager.cpp', 'BluetoothInterface.cpp', - 'BluetoothPbapRequestHandle.cpp', 'BluetoothUtils.cpp', 'BluetoothUuid.cpp', 'ObexBase.cpp' ] if CONFIG['MOZ_B2G_RIL']: SOURCES += [ 'BluetoothRilListener.cpp' @@ -140,18 +139,17 @@ EXPORTS.mozilla.dom.bluetooth += [ 'bluetooth2/BluetoothGattCharacteristic.h', 'bluetooth2/BluetoothGattDescriptor.h', 'bluetooth2/BluetoothGattServer.h', 'bluetooth2/BluetoothGattService.h', 'bluetooth2/BluetoothLeDeviceEvent.h', 'bluetooth2/BluetoothManager.h', 'bluetooth2/BluetoothPairingHandle.h', 'bluetooth2/BluetoothPairingListener.h', - 'BluetoothCommon.h', - 'BluetoothPbapRequestHandle.h', + 'BluetoothCommon.h' ] IPDL_SOURCES += [ 'bluetooth2/ipc/BluetoothTypes.ipdlh', 'bluetooth2/ipc/PBluetooth.ipdl', 'bluetooth2/ipc/PBluetoothRequest.ipdl', ] FAIL_ON_WARNINGS = True
--- a/dom/events/test/test_all_synthetic_events.html +++ b/dom/events/test/test_all_synthetic_events.html @@ -71,32 +71,20 @@ const kEventConstructors = { BluetoothLeDeviceEvent: { create: function (aName, aProps) { return new BluetoothLeDeviceEvent(aName, aProps); }, }, BluetoothPairingEvent: { create: function (aName, aProps) { return new BluetoothPairingEvent(aName, aProps); }, }, - BluetoothPhonebookPullingEvent: { create: function (aName, aProps) { - return new BluetoothPhonebookPullingEvent(aName, aProps); - }, - }, BluetoothStatusChangedEvent: { create: function (aName, aProps) { return new BluetoothStatusChangedEvent(aName, aProps); }, }, - BluetoothVCardListingEvent: { create: function (aName, aProps) { - return new BluetoothVCardListingEvent(aName, aProps); - }, - }, - BluetoothVCardPullingEvent: { create: function (aName, aProps) { - return new BluetoothVCardPullingEvent(aName, aProps); - }, - }, CallEvent: { create: function (aName, aProps) { return new CallEvent(aName, aProps); }, }, CallGroupErrorEvent: { create: function (aName, aProps) { return new CallGroupErrorEvent(aName, aProps); }, },
--- a/dom/tests/mochitest/general/test_interfaces.html +++ b/dom/tests/mochitest/general/test_interfaces.html @@ -216,25 +216,19 @@ var interfaceNamesInGlobalScope = {name: "BluetoothLeDeviceEvent", b2g: true, permission: ["bluetooth"]}, // IMPORTANT: Do not change this list without review from a DOM peer! {name: "BluetoothManager", b2g: true, permission: ["bluetooth"]}, // IMPORTANT: Do not change this list without review from a DOM peer! {name: "BluetoothPairingEvent", b2g: true, permission: ["bluetooth"]}, // IMPORTANT: Do not change this list without review from a DOM peer! {name: "BluetoothPairingHandle", b2g: true, permission: ["bluetooth"]}, // IMPORTANT: Do not change this list without review from a DOM peer! - {name: "BluetoothPhonebookPullingEvent", b2g: true, permission: ["bluetooth"]}, -// IMPORTANT: Do not change this list without review from a DOM peer! {name: "BluetoothStatusChangedEvent", b2g: true, permission: ["bluetooth"]}, // IMPORTANT: Do not change this list without review from a DOM peer! - {name: "BluetoothVCardListingEvent", b2g: true, permission: ["bluetooth"]}, -// IMPORTANT: Do not change this list without review from a DOM peer! - {name: "BluetoothVCardPullingEvent", b2g: true, permission: ["bluetooth"]}, -// IMPORTANT: Do not change this list without review from a DOM peer! {name: "BoxObject", xbl: true}, // IMPORTANT: Do not change this list without review from a DOM peer! {name: "BrowserElementAudioChannel", b2g: true, permission: ["browser"] }, // IMPORTANT: Do not change this list without review from a DOM peer! "BroadcastChannel", // IMPORTANT: Do not change this list without review from a DOM peer! "Cache", // IMPORTANT: Do not change this list without review from a DOM peer!
--- a/dom/webidl/BluetoothAdapter.webidl +++ b/dom/webidl/BluetoothAdapter.webidl @@ -64,25 +64,16 @@ interface BluetoothAdapter : EventTarget attribute EventHandler onhfpstatuschanged; // Fired when sco connection status changed attribute EventHandler onscostatuschanged; // Fired when remote devices query current media play status attribute EventHandler onrequestmediaplaystatus; - // Fired when PBAP manager requests for 'pullphonebook' - attribute EventHandler onpullphonebookreq; - - // Fired when PBAP manager requests for 'pullvcardentry' - attribute EventHandler onpullvcardentryreq; - - // Fired when PBAP manager requests for 'pullvcardlisting' - attribute EventHandler onpullvcardlistingreq; - /** * Enable/Disable a local bluetooth adapter by asynchronus methods and return * its result through a Promise. * * Several onattributechanged events would be triggered during processing the * request, and the last one indicates adapter.state becomes enabled/disabled. */ [NewObject, AvailableIn=CertifiedApps]
deleted file mode 100644 --- a/dom/webidl/BluetoothPbapParameters.webidl +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: IDL; 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/. - */ - -/** - * This enum holds the parameters to indicate the properties contained in the - * requested vCard objects. - */ -enum vCardProperties -{ - "version", - "fn", - "n", - "photo", - "bday", - "adr", - "label", - "tel", - "email", - "mailer", - "tz", - "geo", - "title", - "role", - "logo", - "agent", - "org", - "note", - "rev", - "sound", - "url", - "uid", - "key", - "nickname", - "categories", - "proid", - "class", - "sort-string", - "x-irmc-call-datetime", - "x-bt-speeddialkey", - "x-bt-uci", - "x-bt-uid" -}; - -/** - * This enum holds the parameters to indicate the sorting order of vCard - * objects. - */ -enum vCardOrderType { - "alphabetical", - "indexed", // default - "phonetical" -}; - -/** - * This enum holds the parameters to indicate the search key of the search - * operation. - */ -enum vCardSearchKeyType { - "name", // default - "number", - "sound" -}; - -/** - * This enum holds the parameters to indicate the vCard version. - */ -enum vCardVersion { - "vCard21", // default - "vCard30" -}; - -/** - * This enum holds the parameters to indicate the type of vCard selector. - */ -enum vCardSelectorOp { - "OR", // default - "AND" -};
deleted file mode 100644 --- a/dom/webidl/BluetoothPbapRequestHandle.webidl +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- Mode: IDL; 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/. */ - -[CheckAnyPermissions="bluetooth"] -interface BluetoothPbapRequestHandle -{ - /** - * Reply vCard object to the PBAP request. The DOMRequest will get onerror - * callback if the PBAP request type is not 'pullvcardentryreq' or operation - * fails. - */ - [NewObject, Throws, AvailableIn=CertifiedApps] - DOMRequest replyTovCardPulling(Blob vcardObject); - - /** - * Reply vCard object to the PBAP request. The DOMRequest will get onerror - * callback if the PBAP request type is not 'pullphonebookreq' or operation - * fails. - */ - [NewObject, Throws, AvailableIn=CertifiedApps] - DOMRequest replyToPhonebookPulling(Blob vcardObject, - unsigned long long phonebookSize); - /** - * Reply vCard object to the PBAP request. The DOMRequest will get onerror - * callback if the PBAP request type is not 'pullvcardlistingreq' or operation - * fails. - */ - [NewObject, Throws, AvailableIn=CertifiedApps] - DOMRequest replyTovCardListing(Blob vcardObject, - unsigned long long phonebookSize); -};
deleted file mode 100644 --- a/dom/webidl/BluetoothPhonebookPullingEvent.webidl +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- Mode: IDL; 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/. - */ - -[CheckAnyPermissions="bluetooth", - Constructor(DOMString type, - optional BluetoothPhonebookPullingEventInit eventInitDict)] -interface BluetoothPhonebookPullingEvent : Event -{ - readonly attribute DOMString name; - readonly attribute vCardVersion format; - [Cached, Constant] - readonly attribute sequence<vCardProperties> propSelector; - readonly attribute unsigned long maxListCount; - readonly attribute unsigned long listStartOffset; - [Cached, Constant] - readonly attribute sequence<vCardProperties> vcardSelector; - readonly attribute vCardSelectorOp vcardSelectorOperator; - - readonly attribute BluetoothPbapRequestHandle? handle; -}; - -dictionary BluetoothPhonebookPullingEventInit : EventInit -{ - DOMString name = ""; - vCardVersion format = "vCard21"; - sequence<vCardProperties> propSelector = []; - unsigned long maxListCount = 0; - unsigned long listStartOffset = 0; - sequence<vCardProperties> vcardSelector = []; - vCardSelectorOp vcardSelectorOperator = "OR"; - - BluetoothPbapRequestHandle? handle = null; -};
deleted file mode 100644 --- a/dom/webidl/BluetoothVCardListingEvent.webidl +++ /dev/null @@ -1,37 +0,0 @@ -/* -*- Mode: IDL; 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/. - */ - -[CheckAnyPermissions="bluetooth", - Constructor(DOMString type, - optional BluetoothVCardListingEventInit eventInitDict)] -interface BluetoothVCardListingEvent : Event -{ - readonly attribute DOMString name; - readonly attribute vCardOrderType order; - readonly attribute DOMString searchValue; - readonly attribute vCardSearchKeyType searchKey; - readonly attribute unsigned long maxListCount; - readonly attribute unsigned long listStartOffset; - [Cached, Constant] - readonly attribute sequence<vCardProperties> vcardSelector; - readonly attribute vCardSelectorOp vcardSelectorOperator; - - readonly attribute BluetoothPbapRequestHandle? handle; -}; - -dictionary BluetoothVCardListingEventInit : EventInit -{ - DOMString name = ""; - vCardOrderType order = "indexed"; - DOMString searchValue = ""; - vCardSearchKeyType searchKey = "name"; - unsigned long maxListCount = 0; - unsigned long listStartOffset = 0; - sequence<vCardProperties> vcardSelector = []; - vCardSelectorOp vcardSelectorOperator = "OR"; - - BluetoothPbapRequestHandle? handle = null; -};
deleted file mode 100644 --- a/dom/webidl/BluetoothVCardPullingEvent.webidl +++ /dev/null @@ -1,27 +0,0 @@ -/* -*- Mode: IDL; 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/. - */ - -[CheckAnyPermissions="bluetooth", - Constructor(DOMString type, - optional BluetoothVCardPullingEventInit eventInitDict)] -interface BluetoothVCardPullingEvent : Event -{ - readonly attribute DOMString name; - readonly attribute vCardVersion format; - [Cached, Constant] - readonly attribute sequence<vCardProperties> propSelector; - - readonly attribute BluetoothPbapRequestHandle? handle; -}; - -dictionary BluetoothVCardPullingEventInit : EventInit -{ - DOMString name = ""; - vCardVersion format = "vCard21"; - sequence<vCardProperties> propSelector = []; - - BluetoothPbapRequestHandle? handle = null; -};
--- a/dom/webidl/moz.build +++ b/dom/webidl/moz.build @@ -677,18 +677,16 @@ if CONFIG['MOZ_B2G_BT']: 'BluetoothGattCharacteristic.webidl', 'BluetoothGattDescriptor.webidl', 'BluetoothGattServer.webidl', 'BluetoothGattService.webidl', 'BluetoothLeDeviceEvent.webidl', 'BluetoothManager.webidl', 'BluetoothPairingHandle.webidl', 'BluetoothPairingListener.webidl', - 'BluetoothPbapParameters.webidl', - 'BluetoothPbapRequestHandle.webidl', ] if CONFIG['MOZ_SIMPLEPUSH']: WEBIDL_FILES += [ 'SimplePushManager.webidl' ] else: WEBIDL_FILES += [ @@ -825,20 +823,17 @@ if CONFIG['MOZ_GAMEPAD']: if CONFIG['MOZ_B2G_BT']: GENERATED_EVENTS_WEBIDL_FILES += [ 'BluetoothAdapterEvent.webidl', 'BluetoothAttributeEvent.webidl', 'BluetoothDeviceEvent.webidl', 'BluetoothGattCharacteristicEvent.webidl', 'BluetoothPairingEvent.webidl', - 'BluetoothPhonebookPullingEvent.webidl', 'BluetoothStatusChangedEvent.webidl', - 'BluetoothVCardListingEvent.webidl', - 'BluetoothVCardPullingEvent.webidl' ] if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': GENERATED_EVENTS_WEBIDL_FILES += [ 'MozWifiConnectionInfoEvent.webidl', 'MozWifiP2pStatusChangeEvent.webidl', 'MozWifiStationInfoEvent.webidl', 'MozWifiStatusChangeEvent.webidl',