Merge b2ginbound to m-c a=merge

This commit is contained in:
Wes Kocher 2015-10-12 11:28:31 -07:00
Родитель 9ad1be8e39 e028fb2e61
Коммит a2f9e79936
30 изменённых файлов: 1093 добавлений и 53 удалений

Просмотреть файл

@ -165,6 +165,8 @@ UpdatePrompt.prototype = {
},
_pendingUpdateAvailablePackageInfo: null,
_isPendingUpdateReady: false,
_updateErrorQueue: [ ],
_receivedUpdatePromptReady: false,
// nsISystemUpdateProvider
checkForUpdate: function() {
@ -320,6 +322,19 @@ UpdatePrompt.prototype = {
this.waitForIdle();
},
storeUpdateError: function UP_storeUpdateError(aUpdate) {
log("Storing update error for later use");
this._updateErrorQueue.push(aUpdate);
},
sendStoredUpdateError: function UP_sendStoredUpdateError() {
log("Sending stored update error");
this._updateErrorQueue.forEach(aUpdate => {
this.sendUpdateEvent("update-error", aUpdate);
});
this._updateErrorQueue = [ ];
},
showUpdateError: function UP_showUpdateError(aUpdate) {
log("Update error, state: " + aUpdate.state + ", errorCode: " +
aUpdate.errorCode);
@ -327,7 +342,12 @@ UpdatePrompt.prototype = {
this._systemUpdateListener.onError("update-error: " + aUpdate.errorCode + " " + aUpdate.statusText);
}
this.sendUpdateEvent("update-error", aUpdate);
if (!this._receivedUpdatePromptReady) {
this.storeUpdateError(aUpdate);
} else {
this.sendUpdateEvent("update-error", aUpdate);
}
this.setUpdateStatus(aUpdate.statusText);
},
@ -601,6 +621,10 @@ UpdatePrompt.prototype = {
case "update-prompt-apply-result":
this.handleApplyPromptResult(detail);
break;
case "update-prompt-ready":
this._receivedUpdatePromptReady = true;
this.sendStoredUpdateError();
break;
}
},

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="87f5c9d55ab6a77dcfa48a3f3a8b4f5016f3c657"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0b934d06c04adff2cd9bdd0bc204f974a18b710f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7938df689aa87769fad3f2cf9097fb4ecb106a43"/>

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="87f5c9d55ab6a77dcfa48a3f3a8b4f5016f3c657"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0b934d06c04adff2cd9bdd0bc204f974a18b710f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7938df689aa87769fad3f2cf9097fb4ecb106a43"/>

Просмотреть файл

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="87f5c9d55ab6a77dcfa48a3f3a8b4f5016f3c657"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="0b934d06c04adff2cd9bdd0bc204f974a18b710f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7938df689aa87769fad3f2cf9097fb4ecb106a43"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="4ace9aaee0e048dfda11bb787646c59982a3dc80"/>

Просмотреть файл

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="87f5c9d55ab6a77dcfa48a3f3a8b4f5016f3c657"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0b934d06c04adff2cd9bdd0bc204f974a18b710f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7938df689aa87769fad3f2cf9097fb4ecb106a43"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="31a7849fe9a8b743d6f5e5facc212f0ef9d57499"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="25554535ee69d4c0c24a51f6a55bbabe5cb0a6b8"/>

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="87f5c9d55ab6a77dcfa48a3f3a8b4f5016f3c657"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0b934d06c04adff2cd9bdd0bc204f974a18b710f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7938df689aa87769fad3f2cf9097fb4ecb106a43"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="87f5c9d55ab6a77dcfa48a3f3a8b4f5016f3c657"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0b934d06c04adff2cd9bdd0bc204f974a18b710f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7938df689aa87769fad3f2cf9097fb4ecb106a43"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

Просмотреть файл

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="87f5c9d55ab6a77dcfa48a3f3a8b4f5016f3c657"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="0b934d06c04adff2cd9bdd0bc204f974a18b710f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7938df689aa87769fad3f2cf9097fb4ecb106a43"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="4ace9aaee0e048dfda11bb787646c59982a3dc80"/>

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="87f5c9d55ab6a77dcfa48a3f3a8b4f5016f3c657"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0b934d06c04adff2cd9bdd0bc204f974a18b710f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7938df689aa87769fad3f2cf9097fb4ecb106a43"/>

Просмотреть файл

@ -1,9 +1,9 @@
{
"git": {
"git_revision": "87f5c9d55ab6a77dcfa48a3f3a8b4f5016f3c657",
"git_revision": "0b934d06c04adff2cd9bdd0bc204f974a18b710f",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
"revision": "9504a3c857fe2aa486a6cbbafd1a0007879fbb14",
"revision": "dee47434923493d57f151448eec00f793f113bfd",
"repo_path": "integration/gaia-central"
}

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="87f5c9d55ab6a77dcfa48a3f3a8b4f5016f3c657"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0b934d06c04adff2cd9bdd0bc204f974a18b710f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7938df689aa87769fad3f2cf9097fb4ecb106a43"/>

Просмотреть файл

@ -18,7 +18,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="87f5c9d55ab6a77dcfa48a3f3a8b4f5016f3c657"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0b934d06c04adff2cd9bdd0bc204f974a18b710f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7938df689aa87769fad3f2cf9097fb4ecb106a43"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="31a7849fe9a8b743d6f5e5facc212f0ef9d57499"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="25554535ee69d4c0c24a51f6a55bbabe5cb0a6b8"/>

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="87f5c9d55ab6a77dcfa48a3f3a8b4f5016f3c657"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0b934d06c04adff2cd9bdd0bc204f974a18b710f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7938df689aa87769fad3f2cf9097fb4ecb106a43"/>

Просмотреть файл

@ -14,10 +14,14 @@
#include "ObexBase.h"
#include "mozilla/dom/BluetoothMapParametersBinding.h"
#include "mozilla/dom/ipc/BlobParent.h"
#include "mozilla/dom/File.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"
@ -567,6 +571,75 @@ BluetoothMapSmsManager::ReplyToPut()
SendMasObexData(req, ObexResponseCode::Success, index);
}
bool
BluetoothMapSmsManager::ReplyToFolderListing(long aMasId,
const nsAString& aFolderlists)
{
// TODO: Implement this for future Email support
return false;
}
bool
BluetoothMapSmsManager::ReplyToMessagesListing(BlobParent* aActor,
long aMasId,
bool aNewMessage,
const nsAString& aTimestamp,
int aSize)
{
nsRefPtr<BlobImpl> impl = aActor->GetBlobImpl();
nsRefPtr<Blob> blob = Blob::Create(nullptr, impl);
return ReplyToMessagesListing(blob.get(), aMasId, aNewMessage, aTimestamp,
aSize);
}
bool
BluetoothMapSmsManager::ReplyToMessagesListing(Blob* aBlob, long aMasId,
bool aNewMessage,
const nsAString& aTimestamp,
int aSize)
{
// TODO: Implement in Bug 1211769
return false;
}
bool
BluetoothMapSmsManager::ReplyToGetMessage(BlobParent* aActor, long aMasId)
{
nsRefPtr<BlobImpl> impl = aActor->GetBlobImpl();
nsRefPtr<Blob> blob = Blob::Create(nullptr, impl);
return ReplyToGetMessage(blob.get(), aMasId);
}
bool
BluetoothMapSmsManager::ReplyToGetMessage(Blob* aBlob, long aMasId)
{
// TODO: Implement in Bug 1211769
return false;
}
bool
BluetoothMapSmsManager::ReplyToSetMessageStatus(long aMasId, bool aStatus)
{
// TODO: Implement in Bug 1211769
return false;
}
bool
BluetoothMapSmsManager::ReplyToSendMessage(long aMasId, bool aStatus)
{
// TODO: Implement in Bug 1211769
return false;
}
bool
BluetoothMapSmsManager::ReplyToMessageUpdate(long aMasId, bool aStatus)
{
// TODO: Implement in Bug 1211769
return false;
}
void
BluetoothMapSmsManager::CreateMnsObexConnection()
{
@ -1003,7 +1076,7 @@ BluetoothMapSmsManager::HandleNotificationRegistration(
void
BluetoothMapSmsManager::HandleEventReport(const ObexHeaderSet& aHeader)
{
// TODO: Handle event report in Bug 1166666
// TODO: Handle event report in Bug 1211769
}
void

Просмотреть файл

@ -14,6 +14,15 @@
#include "BluetoothSocketObserver.h"
#include "mozilla/ipc/SocketBase.h"
class nsIInputStream;
namespace mozilla {
namespace dom {
class Blob;
class BlobParent;
}
}
BEGIN_BLUETOOTH_NAMESPACE
struct Map {
@ -79,6 +88,104 @@ public:
static BluetoothMapSmsManager* Get();
bool Listen();
/**
* Reply folder-listing object to the *IPC* 'folderlisting'
*
* @param aMasId [in] MAS id
* @param aFolderlists [in] folder listing object
*
* @return true if the response packet has been packed correctly and started
* to be sent to the remote device; false otherwise.
*/
bool ReplyToFolderListing(long aMasId, const nsAString& aFolderlists);
/**
* Reply message-listing object to the *IPC* 'messageslisting'
*
* @param aActor [in] a blob actor containing message-listing objects
* @param aMasId [in] MAS id
* @param aNewMessage [in] indicate whether there are unread messages
* @param aTimestamp [in] time stamp
* @param aSize [in] total number of messages
*
* @return true if the response packet has been packed correctly and started
* to be sent to the remote device; false otherwise.
*/
bool ReplyToMessagesListing(
BlobParent* aActor, long aMasId, bool aNewMessage,
const nsAString& aTimestamp, int aSize);
/**
* Reply messages-listing object to the *in-process* 'messageslisting' request
*
* @param aBlob [in] a blob contained the vCard objects
* @param aMasId [in] MAS id
* @param aNewMessage [in] indicate whether there are unread messages
* @param aTimestamp [in] time stamp
* @param aSize [in] total number of messages
*
* @return true if the response packet has been packed correctly and started
* to be sent to the remote device; false otherwise.
*/
bool ReplyToMessagesListing(
Blob* aBlob, long aMasId, bool aNewMessage, const nsAString& aTimestamp,
int aSize);
/**
* Reply bMessage object to the *IPC* 'getmessage' request.
*
* @param aActor [in] a blob actor containing the bMessage object
* @param aMasId [in] MAS id
*
* @return true if the response packet has been packed correctly and started
* to be sent to the remote device; false otherwise.
*/
bool ReplyToGetMessage(BlobParent* aActor, long aMasId);
/**
* Reply bMessage to the *in-process* 'getmessage' request.
*
* @param aBlob [in] a blob containing the bMessage object
* @param aMasId [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 ReplyToGetMessage(Blob* aBlob, long aMasId);
/**
* Reply to the *IPC* 'setmessage' request.
*
* @param aMasId [in] MAS id
* @param aStatus [in] success or failure
*
* @return true if the response packet has been packed correctly and started
* to be sent to the remote device; false otherwise.
*/
bool ReplyToSetMessageStatus(long aMasId, bool aStatus);
/**
* Reply to the *in-process* 'sendmessage' request.
*
* @param aMasId [in] MAS id
* @param aStatus [in] success or failure
*
* @return true if the response packet has been packed correctly and started
* to be sent to the remote device; false otherwise.
*/
bool ReplyToSendMessage(long aMasId, bool aStatus);
/**
* Reply to the *in-process* 'messageupdate' request.
*
* @param aMasId [in] MAS id
* @param aStatus [in] success or failure
*
* @return true if the response packet has been packed correctly and started
* to be sent to the remote device; false otherwise.
*/
bool ReplyToMessageUpdate(long aMasId, bool aStatus);
protected:
virtual ~BluetoothMapSmsManager();

Просмотреть файл

@ -386,7 +386,13 @@ BluetoothPbapManager::SetPhoneBookPath(uint8_t flags,
if (flags & 1) {
// Go up 1 level
if (!newPath.IsEmpty()) {
newPath = StringHead(newPath, newPath.RFindChar('/'));
int32_t lastSlashIdx = newPath.RFindChar('/');
if (lastSlashIdx != -1) {
newPath = StringHead(newPath, lastSlashIdx);
} else {
// The parent folder is root.
newPath.AssignLiteral("");
}
}
} else {
MOZ_ASSERT(aHeader.Has(ObexHeaderId::Name));
@ -398,7 +404,9 @@ BluetoothPbapManager::SetPhoneBookPath(uint8_t flags,
newPath.AssignLiteral("");
} else {
// Go down 1 level
newPath.AppendLiteral("/");
if (!newPath.IsEmpty()) {
newPath.AppendLiteral("/");
}
newPath.Append(childFolderName);
}
}
@ -430,6 +438,14 @@ BluetoothPbapManager::PullPhonebook(const ObexHeaderSet& aHeader)
nsString name;
aHeader.GetName(name);
// Ensure the name of phonebook object is legal
if (!IsLegalPhonebookName(name)) {
BT_LOGR("Illegal phone book object name [%s]",
NS_ConvertUTF16toUTF8(name).get());
return ObexResponseCode::NotFound;
}
AppendNamedValue(data, "name", name);
AppendNamedValueByTagId(aHeader, data, AppParameterTag::Format);
@ -457,9 +473,17 @@ BluetoothPbapManager::PullvCardListing(const ObexHeaderSet& aHeader)
InfallibleTArray<BluetoothNamedValue> data;
nsString name;
aHeader.GetName(name);
AppendNamedValue(data, "name", name);
nsString folderName;
aHeader.GetName(folderName);
// Section 5.3.3 "Name", PBAP 1.2
// ... PullvCardListing function uses relative paths. An empty name header may
// be sent to retrieve the vCard Listing object of the current folder.
nsString folderPath = mCurrentPath;
if (!folderName.IsEmpty()) {
folderPath += NS_LITERAL_STRING("/") + folderName;
}
AppendNamedValue(data, "name", folderPath);
AppendNamedValueByTagId(aHeader, data, AppParameterTag::Order);
AppendNamedValueByTagId(aHeader, data, AppParameterTag::SearchValue);
@ -600,19 +624,19 @@ BluetoothPbapManager::IsLegalPath(const nsAString& aPath)
{
static const char* sLegalPaths[] = {
"", // root
"/telecom",
"/telecom/pb",
"/telecom/ich",
"/telecom/och",
"/telecom/mch",
"/telecom/cch",
"/SIM1",
"/SIM1/telecom",
"/SIM1/telecom/pb",
"/SIM1/telecom/ich",
"/SIM1/telecom/och",
"/SIM1/telecom/mch",
"/SIM1/telecom/cch"
"telecom",
"telecom/pb",
"telecom/ich",
"telecom/och",
"telecom/mch",
"telecom/cch",
"SIM1",
"SIM1/telecom",
"SIM1/telecom/pb",
"SIM1/telecom/ich",
"SIM1/telecom/och",
"SIM1/telecom/mch",
"SIM1/telecom/cch"
};
NS_ConvertUTF16toUTF8 path(aPath);
@ -625,6 +649,32 @@ BluetoothPbapManager::IsLegalPath(const nsAString& aPath)
return false;
}
bool
BluetoothPbapManager::IsLegalPhonebookName(const nsAString& aName)
{
static const char* sLegalNames[] = {
"telecom/pb.vcf",
"telecom/ich.vcf",
"telecom/och.vcf",
"telecom/mch.vcf",
"telecom/cch.vcf",
"SIM1/telecom/pb.vcf",
"SIM1/telecom/ich.vcf",
"SIM1/telecom/och.vcf",
"SIM1/telecom/mch.vcf",
"SIM1/telecom/cch.vcf"
};
NS_ConvertUTF16toUTF8 name(aName);
for (uint8_t i = 0; i < MOZ_ARRAY_LENGTH(sLegalNames); i++) {
if (!strcmp(name.get(), sLegalNames[i])) {
return true;
}
}
return false;
}
void
BluetoothPbapManager::AfterPbapConnected()
{

Просмотреть файл

@ -157,11 +157,11 @@ private:
InfallibleTArray<uint32_t> PackPropertiesMask(uint8_t* aData, int aSize);
bool CompareHeaderTarget(const ObexHeaderSet& aHeader);
bool IsLegalPath(const nsAString& aPath);
bool IsLegalPhonebookName(const nsAString& aName);
bool GetInputStreamFromBlob(Blob* aBlob);
void AfterPbapConnected();
void AfterPbapDisconnected();
/**
* Whether 'PhonebookSize' is required for the OBEX response
*/

Просмотреть файл

@ -1721,6 +1721,143 @@ BluetoothServiceBluedroid::ReplyTovCardListing(
DispatchReplySuccess(aRunnable);
}
void
BluetoothServiceBluedroid::ReplyToMapFolderListing(
long aMasId,
const nsAString& aFolderlists,
BluetoothReplyRunnable* aRunnable)
{
// TODO: Implement for future Email support
}
void
BluetoothServiceBluedroid::ReplyToMapMessagesListing(
BlobParent* aBlobParent,
BlobChild* aBlobChild,
long aMasId,
bool aNewMessage,
const nsAString& aTimestamp,
int aSize,
BluetoothReplyRunnable* aRunnable)
{
BluetoothMapSmsManager* map = BluetoothMapSmsManager::Get();
if (!map) {
DispatchReplyError(aRunnable,
NS_LITERAL_STRING("Reply to Messages Listing failed"));
return;
}
map->ReplyToMessagesListing(aBlobParent, aMasId, aNewMessage, aTimestamp,
aSize);
DispatchReplySuccess(aRunnable);
}
void
BluetoothServiceBluedroid:: ReplyToMapMessagesListing(
long aMasId,
Blob* aBlob,
bool aNewMessage,
const nsAString& aTimestamp,
int aSize,
BluetoothReplyRunnable* aRunnable)
{
BluetoothMapSmsManager* map = BluetoothMapSmsManager::Get();
if (!map) {
DispatchReplyError(aRunnable,
NS_LITERAL_STRING("Reply to Messages Listing failed"));
return;
}
map->ReplyToMessagesListing(aBlob, aMasId, aNewMessage, aTimestamp, aSize);
DispatchReplySuccess(aRunnable);
}
void
BluetoothServiceBluedroid:: ReplyToMapGetMessage(
BlobParent* aBlobParent,
BlobChild* aBlobChild,
long aMasId,
BluetoothReplyRunnable* aRunnable)
{
BluetoothMapSmsManager* map = BluetoothMapSmsManager::Get();
if (!map) {
DispatchReplyError(aRunnable,
NS_LITERAL_STRING("Reply to Get Message failed"));
return;
}
map->ReplyToGetMessage(aBlobParent, aMasId);
DispatchReplySuccess(aRunnable);
}
void
BluetoothServiceBluedroid:: ReplyToMapGetMessage(
Blob* aBlob,
long aMasId,
BluetoothReplyRunnable* aRunnable)
{
BluetoothMapSmsManager* map = BluetoothMapSmsManager::Get();
if (!map) {
DispatchReplyError(aRunnable,
NS_LITERAL_STRING("Reply to Get Message failed"));
return;
}
map->ReplyToGetMessage(aBlob, aMasId);
DispatchReplySuccess(aRunnable);
}
void
BluetoothServiceBluedroid:: ReplyToMapSetMessageStatus(
long aMasId,
bool aStatus,
BluetoothReplyRunnable* aRunnable)
{
BluetoothMapSmsManager* map = BluetoothMapSmsManager::Get();
if (!map) {
DispatchReplyError(aRunnable,
NS_LITERAL_STRING("Reply to Set Message failed"));
return;
}
map->ReplyToSetMessageStatus(aMasId, aStatus);
DispatchReplySuccess(aRunnable);
}
void
BluetoothServiceBluedroid:: ReplyToMapSendMessage(
long aMasId,
bool aStatus,
BluetoothReplyRunnable* aRunnable)
{
BluetoothMapSmsManager* map = BluetoothMapSmsManager::Get();
if (!map) {
DispatchReplyError(aRunnable,
NS_LITERAL_STRING("Reply to Send Message failed"));
return;
}
map->ReplyToSendMessage(aMasId, aStatus);
DispatchReplySuccess(aRunnable);
}
void
BluetoothServiceBluedroid:: ReplyToMapMessageUpdate(
long aMasId,
bool aStatus,
BluetoothReplyRunnable* aRunnable)
{
BluetoothMapSmsManager* map = BluetoothMapSmsManager::Get();
if (!map) {
DispatchReplyError(aRunnable,
NS_LITERAL_STRING("Reply to MessageUpdate failed"));
return;
}
map->ReplyToMessageUpdate(aMasId, aStatus);
DispatchReplySuccess(aRunnable);
}
void
BluetoothServiceBluedroid::SendMetaData(const nsAString& aTitle,
const nsAString& aArtist,

Просмотреть файл

@ -178,6 +178,52 @@ public:
uint16_t aPhonebookSize,
BluetoothReplyRunnable* aRunnable);
virtual void
ReplyToMapFolderListing(long aMasId,
const nsAString& aFolderlists,
BluetoothReplyRunnable* aRunnable);
virtual void
ReplyToMapMessagesListing(BlobParent* aBlobParent,
BlobChild* aBlobChild,
long aMasId,
bool aNewMessage,
const nsAString& aTimestamp,
int aSize,
BluetoothReplyRunnable* aRunnable);
virtual void
ReplyToMapMessagesListing(long aMasId,
Blob* aBlob,
bool aNewMessage,
const nsAString& aTimestamp,
int aSize,
BluetoothReplyRunnable* aRunnable);
virtual void
ReplyToMapGetMessage(BlobParent* aBlobParent,
BlobChild* aBlobChild,
long aMasId,
BluetoothReplyRunnable* aRunnable);
virtual void
ReplyToMapGetMessage(Blob* aBlob,
long aMasId,
BluetoothReplyRunnable* aRunnable);
virtual void
ReplyToMapSetMessageStatus(long aMasId,
bool aStatus,
BluetoothReplyRunnable* aRunnable);
virtual void
ReplyToMapSendMessage(
long aMasId, bool aStatus, BluetoothReplyRunnable* aRunnable);
virtual void
ReplyToMapMessageUpdate(
long aMasId, bool aStatus, BluetoothReplyRunnable* aRunnable);
virtual void
AnswerWaitingCall(BluetoothReplyRunnable* aRunnable);

Просмотреть файл

@ -4419,6 +4419,68 @@ BluetoothDBusService::ReplyTovCardListing(
{
}
void
BluetoothDBusService::ReplyToMapFolderListing(long aMasId,
const nsAString& aFolderlists,
BluetoothReplyRunnable* aRunnable)
{
}
void
BluetoothDBusService::ReplyToMapMessagesListing(BlobParent* aBlobParent,
BlobChild* aBlobChild,
long aMasId,
bool aNewMessage,
const nsAString& aTimestamp,
int aSize,
BluetoothReplyRunnable* aRunnable)
{
}
void
BluetoothDBusService::ReplyToMapMessagesListing(long aMasId,
Blob* aBlob,
bool aNewMessage,
const nsAString& aTimestamp,
int aSize,
BluetoothReplyRunnable* aRunnable)
{
}
void
BluetoothDBusService::ReplyToMapGetMessage(BlobParent* aBlobParent,
BlobChild* aBlobChild,
long aMasId,
BluetoothReplyRunnable* aRunnable)
{
}
void
BluetoothDBusService::ReplyToMapGetMessage(Blob* aBlob,
long aMasId,
BluetoothReplyRunnable* aRunnable)
{
}
void
BluetoothDBusService::ReplyToMapSetMessageStatus(long aMasId,
bool aStatus,
BluetoothReplyRunnable* aRunnable)
{
}
void
BluetoothDBusService::ReplyToMapSendMessage(long aMasId, bool aStatus,
BluetoothReplyRunnable* aRunnable)
{
}
void
BluetoothDBusService::ReplyToMapMessageUpdate(long aMasId, bool aStatus,
BluetoothReplyRunnable* aRunnable)
{
}
void
BluetoothDBusService::GattServerConnectPeripheralInternal(
const nsAString& aAppUuid, const nsAString& aAddress,

Просмотреть файл

@ -186,7 +186,53 @@ public:
virtual void
ReplyTovCardListing(Blob* aBlob,
uint16_t aPhonebookSize,
BluetoothReplyRunnable* aRunnable);
BluetoothReplyRunnable* aRunnable) override;
virtual void
ReplyToMapFolderListing(long aMasId, const nsAString& aFolderlists,
BluetoothReplyRunnable* aRunnable) override;
virtual void
ReplyToMapMessagesListing(BlobParent* aBlobParent, BlobChild* aBlobChild,
long aMasId,
bool aNewMessage,
const nsAString& aTimestamp,
int aSize,
BluetoothReplyRunnable* aRunnable) override;
virtual void
ReplyToMapMessagesListing(long aMasId,
Blob* aBlob,
bool aNewMessage,
const nsAString& aTimestamp,
int aSize,
BluetoothReplyRunnable* aRunnable) override;
virtual void
ReplyToMapGetMessage(BlobParent* aBlobParent,
BlobChild* aBlobChild,
long aMasId,
BluetoothReplyRunnable* aRunnable) override;
virtual void
ReplyToMapGetMessage(Blob* aBlob,
long aMasId,
BluetoothReplyRunnable* aRunnable) override;
virtual void
ReplyToMapSetMessageStatus(long aMasId,
bool aStatus,
BluetoothReplyRunnable* aRunnable) override;
virtual void
ReplyToMapSendMessage(long aMasId,
bool aStatus,
BluetoothReplyRunnable* aRunnable) override;
virtual void
ReplyToMapMessageUpdate(long aMasId,
bool aStatus,
BluetoothReplyRunnable* aRunnable) override;
#ifdef MOZ_B2G_RIL
virtual void

Просмотреть файл

@ -341,6 +341,52 @@ public:
uint16_t aPhonebookSize,
BluetoothReplyRunnable* aRunnable) = 0;
virtual void
ReplyToMapFolderListing(long aMasId,
const nsAString& aFolderlists,
BluetoothReplyRunnable* aRunnable) = 0;
virtual void
ReplyToMapMessagesListing(BlobParent* aBlobParent,
BlobChild* aBlobChild,
long aMasId,
bool aNewMessage,
const nsAString& aTimestamp,
int aSize,
BluetoothReplyRunnable* aRunnable) = 0;
virtual void
ReplyToMapMessagesListing(long aMasId,
Blob* aBlob,
bool aNewMessage,
const nsAString& aTimestamp,
int aSize,
BluetoothReplyRunnable* aRunnable) = 0;
virtual void
ReplyToMapGetMessage(BlobParent* aBlobParent,
BlobChild* aBlobChild,
long aMasId,
BluetoothReplyRunnable* aRunnable) = 0;
virtual void
ReplyToMapGetMessage(Blob* aBlob,
long aMasId,
BluetoothReplyRunnable* aRunnable) = 0;
virtual void
ReplyToMapSetMessageStatus(long aMasId,
bool aStatus,
BluetoothReplyRunnable* aRunnable) = 0;
virtual void
ReplyToMapSendMessage(
long aMasId, bool aStatus, BluetoothReplyRunnable* aRunnable) = 0;
virtual void
ReplyToMapMessageUpdate(
long aMasId, bool aStatus, BluetoothReplyRunnable* aRunnable) = 0;
#ifdef MOZ_B2G_RIL
virtual void
AnswerWaitingCall(BluetoothReplyRunnable* aRunnable) = 0;

Просмотреть файл

@ -10,6 +10,7 @@
#include "BluetoothService.h"
#include "mozilla/dom/BluetoothMapRequestHandleBinding.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/dom/Promise.h"
using namespace mozilla;
@ -50,8 +51,37 @@ already_AddRefed<Promise>
BluetoothMapRequestHandle::ReplyToFolderListing(long aMasId,
const nsAString& aFolderlists, ErrorResult& aRv)
{
// TODO: Implement this fuction in Bug 1208492
return nullptr;
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetParentObject());
if (!global) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
nsRefPtr<Promise> promise = Promise::Create(global, aRv);
NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
BluetoothService* bs = BluetoothService::Get();
if (!bs) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
if (XRE_GetProcessType() == GeckoProcessType_Default) {
// In-process reply
bs->ReplyToMapFolderListing(aMasId, aFolderlists,
new BluetoothVoidReplyRunnable(nullptr, promise));
} else {
ContentChild *cc = ContentChild::GetSingleton();
if (!cc) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
bs->ReplyToMapFolderListing(aMasId, aFolderlists,
new BluetoothVoidReplyRunnable(nullptr, promise));
}
return promise.forget();
}
already_AddRefed<Promise>
@ -62,16 +92,86 @@ BluetoothMapRequestHandle::ReplyToMessagesListing(long aMasId,
int aSize,
ErrorResult& aRv)
{
// TODO: Implement this fuction in Bug 1208492
return nullptr;
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetParentObject());
if (!global) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
nsRefPtr<Promise> promise = Promise::Create(global, aRv);
NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
BluetoothService* bs = BluetoothService::Get();
if (!bs) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
if (XRE_GetProcessType() == GeckoProcessType_Default) {
// In-process reply
bs->ReplyToMapMessagesListing(aMasId, &aBlob, aNewMessage, aTimestamp,
aSize, new BluetoothVoidReplyRunnable(nullptr, promise));
} 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->ReplyToMapMessagesListing(nullptr, actor, aMasId, aNewMessage,
aTimestamp, aSize, new BluetoothVoidReplyRunnable(nullptr, promise));
}
return promise.forget();
}
already_AddRefed<Promise>
BluetoothMapRequestHandle::ReplyToGetMessage(long aMasId, Blob& aBlob,
ErrorResult& aRv)
{
// TODO: Implement this fuction in Bug 1208492
return nullptr;
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetParentObject());
if (!global) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
nsRefPtr<Promise> promise = Promise::Create(global, aRv);
NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
BluetoothService* bs = BluetoothService::Get();
if (!bs) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
if (XRE_GetProcessType() == GeckoProcessType_Default) {
// In-process reply
bs->ReplyToMapGetMessage(&aBlob, aMasId,
new BluetoothVoidReplyRunnable(nullptr, promise));
} 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->ReplyToMapGetMessage(nullptr, actor, aMasId,
new BluetoothVoidReplyRunnable(nullptr, promise));
}
return promise.forget();
}
already_AddRefed<Promise>
@ -79,8 +179,25 @@ BluetoothMapRequestHandle::ReplyToSetMessageStatus(long aMasId,
bool aStatus,
ErrorResult& aRv)
{
// TODO: Implement this fuction in Bug 1208492
return nullptr;
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetParentObject());
if (!global) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
nsRefPtr<Promise> promise = Promise::Create(global, aRv);
NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
BluetoothService* bs = BluetoothService::Get();
if (!bs) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
bs->ReplyToMapSetMessageStatus(aMasId, aStatus,
new BluetoothVoidReplyRunnable(nullptr, promise));
return promise.forget();
}
already_AddRefed<Promise>
@ -88,8 +205,25 @@ BluetoothMapRequestHandle::ReplyToSendMessage(long aMasId,
bool aStatus,
ErrorResult& aRv)
{
// TODO: Implement this fuction in Bug 1208492
return nullptr;
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetParentObject());
if (!global) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
nsRefPtr<Promise> promise = Promise::Create(global, aRv);
NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
BluetoothService* bs = BluetoothService::Get();
if (!bs) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
bs->ReplyToMapSendMessage(aMasId, aStatus,
new BluetoothVoidReplyRunnable(nullptr, promise));
return promise.forget();
}
already_AddRefed<Promise>
@ -97,8 +231,25 @@ BluetoothMapRequestHandle::ReplyToMessageUpdate(long aMasId,
bool aStatus,
ErrorResult& aRv)
{
// TODO: Implement this fuction in Bug 1208492
return nullptr;
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetParentObject());
if (!global) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
nsRefPtr<Promise> promise = Promise::Create(global, aRv);
NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
BluetoothService* bs = BluetoothService::Get();
if (!bs) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
bs->ReplyToMapMessageUpdate(aMasId, aStatus,
new BluetoothVoidReplyRunnable(nullptr, promise));
return promise.forget();
}
JSObject*

Просмотреть файл

@ -252,6 +252,18 @@ BluetoothParent::RecvPBluetoothRequestConstructor(
return actor->DoRequest(aRequest.get_ReplyToPhonebookPullingRequest());
case Request::TReplyTovCardListingRequest:
return actor->DoRequest(aRequest.get_ReplyTovCardListingRequest());
case Request::TReplyToFolderListingRequest:
return actor->DoRequest(aRequest.get_ReplyToFolderListingRequest());
case Request::TReplyToMessagesListingRequest:
return actor->DoRequest(aRequest.get_ReplyToMessagesListingRequest());
case Request::TReplyToGetMessageRequest:
return actor->DoRequest(aRequest.get_ReplyToGetMessageRequest());
case Request::TReplyToSetMessageStatusRequest:
return actor->DoRequest(aRequest.get_ReplyToSetMessageStatusRequest());
case Request::TReplyToSendMessageRequest:
return actor->DoRequest(aRequest.get_ReplyToSendMessageRequest());
case Request::TReplyToMessageUpdateRequest:
return actor->DoRequest(aRequest.get_ReplyToMessageUpdateRequest());
#ifdef MOZ_B2G_RIL
case Request::TAnswerWaitingCallRequest:
return actor->DoRequest(aRequest.get_AnswerWaitingCallRequest());
@ -776,6 +788,83 @@ BluetoothRequestParent::DoRequest(const ReplyTovCardListingRequest& aRequest)
return true;
}
bool
BluetoothRequestParent::DoRequest(const ReplyToFolderListingRequest& aRequest)
{
MOZ_ASSERT(mService);
MOZ_ASSERT(mRequestType == Request::TReplyToFolderListingRequest);
mService->ReplyToMapFolderListing(aRequest.masId(),
aRequest.folderList(),
mReplyRunnable.get());
return true;
}
bool
BluetoothRequestParent::DoRequest(const ReplyToMessagesListingRequest& aRequest)
{
MOZ_ASSERT(mService);
MOZ_ASSERT(mRequestType == Request::TReplyToMessagesListingRequest);
mService->ReplyToMapMessagesListing((BlobParent*)aRequest.blobParent(),
(BlobChild*)aRequest.blobChild(),
aRequest.masId(),
aRequest.newMessage(),
aRequest.timeStamp(),
aRequest.size(),
mReplyRunnable.get());
return true;
}
bool
BluetoothRequestParent::DoRequest(const ReplyToGetMessageRequest& aRequest)
{
MOZ_ASSERT(mService);
MOZ_ASSERT(mRequestType == Request::TReplyToGetMessageRequest);
mService->ReplyToMapGetMessage((BlobParent*)aRequest.blobParent(),
(BlobChild*)aRequest.blobChild(),
aRequest.masId(),
mReplyRunnable.get());
return true;
}
bool
BluetoothRequestParent::DoRequest(const ReplyToSetMessageStatusRequest& aRequest)
{
MOZ_ASSERT(mService);
MOZ_ASSERT(mRequestType == Request::TReplyToSetMessageStatusRequest);
mService->ReplyToMapSetMessageStatus(aRequest.masId(),
aRequest.messageStatus(),
mReplyRunnable.get());
return true;
}
bool
BluetoothRequestParent::DoRequest(const ReplyToSendMessageRequest& aRequest)
{
MOZ_ASSERT(mService);
MOZ_ASSERT(mRequestType == Request::TReplyToSendMessageRequest);
mService->ReplyToMapSendMessage(aRequest.masId(),
aRequest.messageStatus(),
mReplyRunnable.get());
return true;
}
bool
BluetoothRequestParent::DoRequest(const ReplyToMessageUpdateRequest& aRequest)
{
MOZ_ASSERT(mService);
MOZ_ASSERT(mRequestType == Request::TReplyToMessageUpdateRequest);
mService->ReplyToMapMessageUpdate(aRequest.masId(),
aRequest.messageStatus(),
mReplyRunnable.get());
return true;
}
#ifdef MOZ_B2G_RIL
bool
BluetoothRequestParent::DoRequest(const AnswerWaitingCallRequest& aRequest)

Просмотреть файл

@ -221,6 +221,24 @@ protected:
bool
DoRequest(const ReplyTovCardListingRequest& aRequest);
bool
DoRequest(const ReplyToFolderListingRequest& aRequest);
bool
DoRequest(const ReplyToMessagesListingRequest& aRequest);
bool
DoRequest(const ReplyToGetMessageRequest& aRequest);
bool
DoRequest(const ReplyToSetMessageStatusRequest& aRequest);
bool
DoRequest(const ReplyToSendMessageRequest& aRequest);
bool
DoRequest(const ReplyToMessageUpdateRequest& aRequest);
#ifdef MOZ_B2G_RIL
bool
DoRequest(const AnswerWaitingCallRequest& aRequest);

Просмотреть файл

@ -426,6 +426,88 @@ BluetoothServiceChildProcess::ReplyTovCardListing(
MOZ_CRASH("This should never be called!");
}
void
BluetoothServiceChildProcess::ReplyToMapFolderListing(long aMasId,
const nsAString& aFolderList,
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable,
ReplyToFolderListingRequest(aMasId, nsString(aFolderList)));
}
void
BluetoothServiceChildProcess::ReplyToMapMessagesListing(BlobParent* aBlobParent,
BlobChild* aBlobChild,
long aMasId,
bool aNewMessage,
const nsAString& aTimestamp,
int aSize,
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable,
ReplyToMessagesListingRequest(aMasId, nullptr, aBlobChild,
aNewMessage, nsString(aTimestamp), aSize));
}
void
BluetoothServiceChildProcess::ReplyToMapMessagesListing(long aMasId,
Blob* aBlob,
bool aNewMessage,
const nsAString& aTimestamp,
int aSize,
BluetoothReplyRunnable* aRunnable)
{
// Parent-process-only method
MOZ_CRASH("This should never be called!");
}
void
BluetoothServiceChildProcess::ReplyToMapGetMessage(BlobParent* aBlobParent,
BlobChild* aBlobChild,
long aMasId,
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable,
ReplyToGetMessageRequest(aMasId, nullptr, aBlobChild));
}
void
BluetoothServiceChildProcess::ReplyToMapGetMessage(Blob* aBlob,
long aMasId,
BluetoothReplyRunnable* aRunnable)
{
// Parent-process-only method
MOZ_CRASH("This should never be called!");
}
void
BluetoothServiceChildProcess::ReplyToMapSetMessageStatus(long aMasId,
bool aStatus,
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable,
ReplyToSetMessageStatusRequest(aMasId, aStatus));
}
void
BluetoothServiceChildProcess::ReplyToMapSendMessage(long aMasId,
bool aStatus,
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable,
ReplyToSendMessageRequest(aMasId, aStatus));
}
void
BluetoothServiceChildProcess::ReplyToMapMessageUpdate(long aMasId,
bool aStatus,
BluetoothReplyRunnable* aRunnable)
{
SendRequest(aRunnable,
ReplyToMessageUpdateRequest(aMasId, aStatus));
}
#ifdef MOZ_B2G_RIL
void
BluetoothServiceChildProcess::AnswerWaitingCall(

Просмотреть файл

@ -189,6 +189,52 @@ public:
uint16_t aPhonebookSize,
BluetoothReplyRunnable* aRunnable) override;
virtual void
ReplyToMapFolderListing(long aMasId,
const nsAString& aFolderlists,
BluetoothReplyRunnable* aRunnable) override;
virtual void
ReplyToMapMessagesListing(BlobParent* aBlobParent,
BlobChild* aBlobChild,
long aMasId,
bool aNewMessage,
const nsAString& aTimestamp,
int aSize,
BluetoothReplyRunnable* aRunnable) override;
virtual void
ReplyToMapMessagesListing(long aMasId,
Blob* aBlob,
bool aNewMessage,
const nsAString& aTimestamp,
int aSize,
BluetoothReplyRunnable* aRunnable) override;
virtual void
ReplyToMapGetMessage(BlobParent* aBlobParent,
BlobChild* aBlobChild,
long aMasId,
BluetoothReplyRunnable* aRunnable) override;
virtual void
ReplyToMapGetMessage(Blob* aBlob,
long aMasId,
BluetoothReplyRunnable* aRunnable) override;
virtual void
ReplyToMapSetMessageStatus(long aMasId,
bool aStatus,
BluetoothReplyRunnable* aRunnable) override;
virtual void
ReplyToMapSendMessage(
long aMasId, bool aStatus, BluetoothReplyRunnable* aRunnable) override;
virtual void
ReplyToMapMessageUpdate(
long aMasId, bool aStatus, BluetoothReplyRunnable* aRunnable) override;
#ifdef MOZ_B2G_RIL
virtual void
AnswerWaitingCall(BluetoothReplyRunnable* aRunnable) override;

Просмотреть файл

@ -188,6 +188,45 @@ struct ReplyTovCardListingRequest
uint16_t phonebookSize;
};
struct ReplyToFolderListingRequest
{
uint16_t masId;
nsString folderList;
};
struct ReplyToMessagesListingRequest
{
uint16_t masId;
PBlob blob;
bool newMessage;
nsString timeStamp;
uint16_t size;
};
struct ReplyToGetMessageRequest
{
uint16_t masId;
PBlob blob;
};
struct ReplyToSetMessageStatusRequest
{
uint16_t masId;
bool messageStatus;
};
struct ReplyToSendMessageRequest
{
uint16_t masId;
bool messageStatus;
};
struct ReplyToMessageUpdateRequest
{
uint16_t masId;
bool messageStatus;
};
struct AnswerWaitingCallRequest
{
};
@ -411,6 +450,12 @@ union Request
ReplyTovCardPullingRequest;
ReplyToPhonebookPullingRequest;
ReplyTovCardListingRequest;
ReplyToFolderListingRequest;
ReplyToMessagesListingRequest;
ReplyToGetMessageRequest;
ReplyToSetMessageStatusRequest;
ReplyToSendMessageRequest;
ReplyToMessageUpdateRequest;
AnswerWaitingCallRequest;
IgnoreWaitingCallRequest;
ToggleCallsRequest;

Просмотреть файл

@ -248,6 +248,10 @@ WifiProxyService::SendCommand(JS::Handle<JS::Value> aOptions,
return NS_ERROR_FAILURE;
}
if (!mControlThread) {
return NS_ERROR_FAILURE;
}
// Dispatch the command to the control thread.
CommandOptions commandOptions(options);
nsCOMPtr<nsIRunnable> runnable = new ControlRunnable(commandOptions, aInterface);
@ -293,8 +297,10 @@ WifiProxyService::DispatchWifiResult(const WifiResultOptions& aOptions, const ns
return;
}
// Call the listener with a JS value.
mListener->OnCommand(val, aInterface);
if (mListener) {
// Call the listener with a JS value.
mListener->OnCommand(val, aInterface);
}
}
void

Просмотреть файл

@ -1432,6 +1432,14 @@ var WifiManager = (function() {
? wifiCommand.getConnectionInfoICS
: wifiCommand.getConnectionInfoGB;
manager.ensureSupplicantDetached = aCallback => {
if (!manager.enabled) {
aCallback();
return;
}
wifiCommand.closeSupplicantConnection(aCallback);
};
manager.isHandShakeState = function(state) {
switch (state) {
case "AUTHENTICATING":
@ -3820,10 +3828,14 @@ WifiWorker.prototype = {
break;
case "xpcom-shutdown":
let wifiService = Cc["@mozilla.org/wifi/service;1"].getService(Ci.nsIWifiProxyService);
wifiService.shutdown();
let wifiCertService = Cc["@mozilla.org/wifi/certservice;1"].getService(Ci.nsIWifiCertService);
wifiCertService.shutdown();
// Ensure the supplicant is detached from B2G to avoid XPCOM shutdown
// blocks forever.
WifiManager.ensureSupplicantDetached(() => {
let wifiService = Cc["@mozilla.org/wifi/service;1"].getService(Ci.nsIWifiProxyService);
wifiService.shutdown();
let wifiCertService = Cc["@mozilla.org/wifi/certservice;1"].getService(Ci.nsIWifiCertService);
wifiCertService.shutdown();
});
break;
}
},