mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 14:55:47 +00:00
Merge b2g-inbound to m-c. a=merge
This commit is contained in:
commit
f28f74bf09
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="aacd9b12da7fc3c8f4deaaa8eedfbb158f4fefe7">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="1e1197e0e8e64307aa382ffba4711d1c661de7ca"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="331956d992ec4231fd19980201e86fd0d3067b2a"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="aacd9b12da7fc3c8f4deaaa8eedfbb158f4fefe7">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="1e1197e0e8e64307aa382ffba4711d1c661de7ca"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="331956d992ec4231fd19980201e86fd0d3067b2a"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
|
||||
<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="1e1197e0e8e64307aa382ffba4711d1c661de7ca"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="331956d992ec4231fd19980201e86fd0d3067b2a"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="2d58f4b9206b50b8fda0d5036da6f0c62608db7c"/>
|
||||
|
@ -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="1e1197e0e8e64307aa382ffba4711d1c661de7ca"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="331956d992ec4231fd19980201e86fd0d3067b2a"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="bfdb6348725a33bdcdc4e17999cb500be6beedb5"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a6f9a1245d98c51172c15afecb9ade1a6ca511e2"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="aacd9b12da7fc3c8f4deaaa8eedfbb158f4fefe7">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="1e1197e0e8e64307aa382ffba4711d1c661de7ca"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="331956d992ec4231fd19980201e86fd0d3067b2a"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="05a36844c1046a1eb07d5b1325f85ed741f961ea">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="1e1197e0e8e64307aa382ffba4711d1c661de7ca"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="331956d992ec4231fd19980201e86fd0d3067b2a"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
|
||||
<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="1e1197e0e8e64307aa382ffba4711d1c661de7ca"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="331956d992ec4231fd19980201e86fd0d3067b2a"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="2d58f4b9206b50b8fda0d5036da6f0c62608db7c"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="aacd9b12da7fc3c8f4deaaa8eedfbb158f4fefe7">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="1e1197e0e8e64307aa382ffba4711d1c661de7ca"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="331956d992ec4231fd19980201e86fd0d3067b2a"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -1,9 +1,9 @@
|
||||
{
|
||||
"git": {
|
||||
"git_revision": "1e1197e0e8e64307aa382ffba4711d1c661de7ca",
|
||||
"git_revision": "331956d992ec4231fd19980201e86fd0d3067b2a",
|
||||
"remote": "https://git.mozilla.org/releases/gaia.git",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "017d8581cedcf164da2a6e2b6b4fbb98188325f0",
|
||||
"revision": "27d3020c9da9f6c438bd97b3d42d9124ec9807f4",
|
||||
"repo_path": "integration/gaia-central"
|
||||
}
|
||||
|
@ -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="1e1197e0e8e64307aa382ffba4711d1c661de7ca"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="331956d992ec4231fd19980201e86fd0d3067b2a"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="bfdb6348725a33bdcdc4e17999cb500be6beedb5"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a6f9a1245d98c51172c15afecb9ade1a6ca511e2"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="05a36844c1046a1eb07d5b1325f85ed741f961ea">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="1e1197e0e8e64307aa382ffba4711d1c661de7ca"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="331956d992ec4231fd19980201e86fd0d3067b2a"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -146,14 +146,16 @@ BluetoothHidManager::Disconnect(BluetoothProfileController* aController)
|
||||
BluetoothService* bs = BluetoothService::Get();
|
||||
if (!bs) {
|
||||
if (aController) {
|
||||
aController->NotifyCompletion(NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE));
|
||||
aController->NotifyCompletion(
|
||||
NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mConnected) {
|
||||
if (aController) {
|
||||
aController->NotifyCompletion(NS_LITERAL_STRING(ERR_ALREADY_DISCONNECTED));
|
||||
aController->NotifyCompletion(
|
||||
NS_LITERAL_STRING(ERR_ALREADY_DISCONNECTED));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -210,7 +212,8 @@ void
|
||||
BluetoothHidManager::HandleInputPropertyChanged(const BluetoothSignal& aSignal)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(aSignal.value().type() == BluetoothValue::TArrayOfBluetoothNamedValue);
|
||||
MOZ_ASSERT(aSignal.value().type() ==
|
||||
BluetoothValue::TArrayOfBluetoothNamedValue);
|
||||
|
||||
const InfallibleTArray<BluetoothNamedValue>& arr =
|
||||
aSignal.value().get_ArrayOfBluetoothNamedValue();
|
||||
|
@ -481,7 +481,8 @@ public:
|
||||
const BluetoothAvrcpNotificationParam& aParam,
|
||||
BluetoothAvrcpResultHandler* aRes) = 0;
|
||||
|
||||
virtual void SetVolume(uint8_t aVolume, BluetoothAvrcpResultHandler* aRes) = 0;
|
||||
virtual void SetVolume(uint8_t aVolume,
|
||||
BluetoothAvrcpResultHandler* aRes) = 0;
|
||||
|
||||
protected:
|
||||
BluetoothAvrcpInterface();
|
||||
@ -1073,7 +1074,8 @@ public:
|
||||
virtual void DiscoveryStateChangedNotification(bool aState) { }
|
||||
|
||||
virtual void PinRequestNotification(const nsAString& aRemoteBdAddr,
|
||||
const nsAString& aBdName, uint32_t aCod) { }
|
||||
const nsAString& aBdName,
|
||||
uint32_t aCod) { }
|
||||
virtual void SspRequestNotification(const nsAString& aRemoteBdAddr,
|
||||
const nsAString& aBdName,
|
||||
uint32_t aCod,
|
||||
|
@ -50,12 +50,12 @@ public:
|
||||
virtual void OnUpdateSdpRecords(const nsAString& aDeviceAddress) = 0;
|
||||
|
||||
/**
|
||||
* Returns the address of the connected device.
|
||||
* Return the address of the connected device.
|
||||
*/
|
||||
virtual void GetAddress(nsAString& aDeviceAddress) = 0;
|
||||
|
||||
/**
|
||||
* Returns true if the profile is connected.
|
||||
* Return true if the profile is connected.
|
||||
*/
|
||||
virtual bool IsConnected() = 0;
|
||||
|
||||
@ -84,7 +84,7 @@ public:
|
||||
virtual void Reset() = 0;
|
||||
|
||||
/**
|
||||
* Returns string of profile name.
|
||||
* Return string of profile name.
|
||||
*/
|
||||
virtual void GetName(nsACString& aName) = 0;
|
||||
};
|
||||
@ -103,7 +103,7 @@ public: \
|
||||
BluetoothProfileController* aController) override; \
|
||||
virtual void Disconnect(BluetoothProfileController* aController) override; \
|
||||
virtual void OnConnect(const nsAString& aErrorStr) override; \
|
||||
virtual void OnDisconnect(const nsAString& AErrorStr) override; \
|
||||
virtual void OnDisconnect(const nsAString& aErrorStr) override; \
|
||||
virtual void Reset() override;
|
||||
|
||||
END_BLUETOOTH_NAMESPACE
|
||||
|
@ -561,14 +561,16 @@ BluetoothA2dpManager::Disconnect(BluetoothProfileController* aController)
|
||||
BluetoothService* bs = BluetoothService::Get();
|
||||
if (!bs) {
|
||||
if (aController) {
|
||||
aController->NotifyCompletion(NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE));
|
||||
aController->NotifyCompletion(
|
||||
NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mA2dpConnected) {
|
||||
if (aController) {
|
||||
aController->NotifyCompletion(NS_LITERAL_STRING(ERR_ALREADY_DISCONNECTED));
|
||||
aController->NotifyCompletion(
|
||||
NS_LITERAL_STRING(ERR_ALREADY_DISCONNECTED));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -580,7 +582,8 @@ BluetoothA2dpManager::Disconnect(BluetoothProfileController* aController)
|
||||
if (!sBtA2dpInterface) {
|
||||
BT_LOGR("sBluetoothA2dpInterface is null");
|
||||
if (aController) {
|
||||
aController->NotifyCompletion(NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE));
|
||||
aController->NotifyCompletion(
|
||||
NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -1011,8 +1014,8 @@ BluetoothA2dpManager::GetArtist(nsAString& aArtist)
|
||||
*/
|
||||
|
||||
void
|
||||
BluetoothA2dpManager::ConnectionStateNotification(BluetoothA2dpConnectionState aState,
|
||||
const nsAString& aBdAddr)
|
||||
BluetoothA2dpManager::ConnectionStateNotification(
|
||||
BluetoothA2dpConnectionState aState, const nsAString& aBdAddr)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
|
@ -2521,7 +2521,8 @@ BluetoothDaemonGattClientInterface::Listen(
|
||||
/* Clear the attribute cache for a given device*/
|
||||
void
|
||||
BluetoothDaemonGattClientInterface::Refresh(
|
||||
int aClientIf, const nsAString& aBdAddr, BluetoothGattClientResultHandler* aRes)
|
||||
int aClientIf, const nsAString& aBdAddr,
|
||||
BluetoothGattClientResultHandler* aRes)
|
||||
{
|
||||
MOZ_ASSERT(mModule);
|
||||
|
||||
|
@ -40,8 +40,8 @@ BluetoothDaemonHandsfreeModule::Send(DaemonSocketPDU* aPDU,
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonHandsfreeModule::HandleSvc(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU, void* aUserData)
|
||||
BluetoothDaemonHandsfreeModule::HandleSvc(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU, void* aUserData)
|
||||
{
|
||||
static void (BluetoothDaemonHandsfreeModule::* const HandleOp[])(
|
||||
const DaemonSocketPDUHeader&, DaemonSocketPDU&, void*) = {
|
||||
|
@ -1173,7 +1173,8 @@ BluetoothGattManager::WriteCharacteristicValue(
|
||||
return;
|
||||
}
|
||||
|
||||
client->mWriteCharacteristicState.Assign(aWriteType, aValue, false, aRunnable);
|
||||
client->mWriteCharacteristicState.Assign(
|
||||
aWriteType, aValue, false, aRunnable);
|
||||
|
||||
/**
|
||||
* First, write the characteristic value through an unauthenticated physical
|
||||
|
@ -1551,11 +1551,14 @@ BluetoothOppManager::OnSocketDisconnect(BluetoothSocket* aSocket)
|
||||
*/
|
||||
if (!mSuccessFlag) {
|
||||
if (mIsServer) {
|
||||
// Remove received file and inform gaia of receiving failure
|
||||
DeleteReceivedFile();
|
||||
}
|
||||
|
||||
FileTransferComplete();
|
||||
if (!mIsServer) {
|
||||
} else {
|
||||
// Inform gaia of current blob transfer failure
|
||||
if (mCurrentBlobIndex >= 0) {
|
||||
FileTransferComplete();
|
||||
}
|
||||
// Inform gaia of remaining blobs' sending failure
|
||||
DiscardBlobsToSend();
|
||||
}
|
||||
|
@ -640,7 +640,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
nsTArray<GetDeviceRequest> mRequests;
|
||||
nsTArray<GetDeviceRequest>& mRequests;
|
||||
nsString mDeviceAddress;
|
||||
};
|
||||
|
||||
@ -706,11 +706,11 @@ BluetoothServiceBluedroid::GetPairedDevicePropertiesInternal(
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
class BluetoothServiceBluedroid::StartDiscoveryResultHandler final
|
||||
class BluetoothServiceBluedroid::DispatchReplyErrorResultHandler final
|
||||
: public BluetoothResultHandler
|
||||
{
|
||||
public:
|
||||
StartDiscoveryResultHandler(
|
||||
DispatchReplyErrorResultHandler(
|
||||
nsTArray<nsRefPtr<BluetoothReplyRunnable>>& aRunnableArray,
|
||||
BluetoothReplyRunnable* aRunnable)
|
||||
: mRunnableArray(aRunnableArray)
|
||||
@ -720,12 +720,15 @@ public:
|
||||
void OnError(BluetoothStatus aStatus) override
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
mRunnableArray.RemoveElement(mRunnable);
|
||||
if (mRunnable) {
|
||||
DispatchReplyError(mRunnable, aStatus);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
nsTArray<nsRefPtr<BluetoothReplyRunnable>> mRunnableArray;
|
||||
nsTArray<nsRefPtr<BluetoothReplyRunnable>>& mRunnableArray;
|
||||
BluetoothReplyRunnable* mRunnable;
|
||||
};
|
||||
|
||||
@ -738,55 +741,9 @@ BluetoothServiceBluedroid::StartDiscoveryInternal(
|
||||
|
||||
mChangeDiscoveryRunnables.AppendElement(aRunnable);
|
||||
sBtInterface->StartDiscovery(
|
||||
new StartDiscoveryResultHandler(mChangeDiscoveryRunnables, aRunnable));
|
||||
new DispatchReplyErrorResultHandler(mChangeDiscoveryRunnables, aRunnable));
|
||||
}
|
||||
|
||||
class BluetoothServiceBluedroid::CancelDiscoveryResultHandler final
|
||||
: public BluetoothResultHandler
|
||||
{
|
||||
public:
|
||||
CancelDiscoveryResultHandler(
|
||||
nsTArray<nsRefPtr<BluetoothReplyRunnable>>& aRunnableArray,
|
||||
BluetoothReplyRunnable* aRunnable)
|
||||
: mRunnableArray(aRunnableArray)
|
||||
, mRunnable(aRunnable)
|
||||
{ }
|
||||
|
||||
void OnError(BluetoothStatus aStatus) override
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
mRunnableArray.RemoveElement(mRunnable);
|
||||
DispatchReplyError(mRunnable, aStatus);
|
||||
}
|
||||
|
||||
private:
|
||||
nsTArray<nsRefPtr<BluetoothReplyRunnable>> mRunnableArray;
|
||||
BluetoothReplyRunnable* mRunnable;
|
||||
};
|
||||
|
||||
class BluetoothServiceBluedroid::GetRemoteServicesResultHandler final
|
||||
: public BluetoothResultHandler
|
||||
{
|
||||
public:
|
||||
GetRemoteServicesResultHandler(
|
||||
nsTArray<nsRefPtr<BluetoothReplyRunnable>>& aRunnableArray,
|
||||
BluetoothReplyRunnable* aRunnable)
|
||||
: mRunnableArray(aRunnableArray)
|
||||
, mRunnable(aRunnable)
|
||||
{ }
|
||||
|
||||
void OnError(BluetoothStatus aStatus) override
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
mRunnableArray.RemoveElement(mRunnable);
|
||||
DispatchReplyError(mRunnable, aStatus);
|
||||
}
|
||||
|
||||
private:
|
||||
nsTArray<nsRefPtr<BluetoothReplyRunnable>> mRunnableArray;
|
||||
BluetoothReplyRunnable* mRunnable;
|
||||
};
|
||||
|
||||
nsresult
|
||||
BluetoothServiceBluedroid::FetchUuidsInternal(
|
||||
const nsAString& aDeviceAddress, BluetoothReplyRunnable* aRunnable)
|
||||
@ -800,14 +757,12 @@ BluetoothServiceBluedroid::FetchUuidsInternal(
|
||||
* if it is currently discovering nearby remote devices.
|
||||
*/
|
||||
if (mDiscovering) {
|
||||
sBtInterface->CancelDiscovery(
|
||||
new CancelDiscoveryResultHandler(mChangeDiscoveryRunnables, aRunnable));
|
||||
StopDiscoveryInternal(aRunnable);
|
||||
}
|
||||
|
||||
mFetchUuidsRunnables.AppendElement(aRunnable);
|
||||
|
||||
sBtInterface->GetRemoteServices(aDeviceAddress,
|
||||
new GetRemoteServicesResultHandler(mFetchUuidsRunnables, aRunnable));
|
||||
new DispatchReplyErrorResultHandler(mFetchUuidsRunnables, aRunnable));
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -817,38 +772,14 @@ BluetoothServiceBluedroid::StopDiscoveryInternal(
|
||||
BluetoothReplyRunnable* aRunnable)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
ENSURE_BLUETOOTH_IS_READY_VOID(aRunnable);
|
||||
|
||||
mChangeDiscoveryRunnables.AppendElement(aRunnable);
|
||||
sBtInterface->CancelDiscovery(
|
||||
new CancelDiscoveryResultHandler(mChangeDiscoveryRunnables,
|
||||
aRunnable));
|
||||
new DispatchReplyErrorResultHandler(mChangeDiscoveryRunnables, aRunnable));
|
||||
}
|
||||
|
||||
class BluetoothServiceBluedroid::SetAdapterPropertyResultHandler final
|
||||
: public BluetoothResultHandler
|
||||
{
|
||||
public:
|
||||
SetAdapterPropertyResultHandler(
|
||||
nsTArray<nsRefPtr<BluetoothReplyRunnable>>& aRunnableArray,
|
||||
BluetoothReplyRunnable* aRunnable)
|
||||
: mRunnableArray(aRunnableArray)
|
||||
, mRunnable(aRunnable)
|
||||
{ }
|
||||
|
||||
void OnError(BluetoothStatus aStatus) override
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
mRunnableArray.RemoveElement(mRunnable);
|
||||
DispatchReplyError(mRunnable, aStatus);
|
||||
}
|
||||
|
||||
private:
|
||||
nsTArray<nsRefPtr<BluetoothReplyRunnable>> mRunnableArray;
|
||||
BluetoothReplyRunnable* mRunnable;
|
||||
};
|
||||
|
||||
nsresult
|
||||
BluetoothServiceBluedroid::SetProperty(BluetoothObjectType aType,
|
||||
const BluetoothNamedValue& aValue,
|
||||
@ -859,9 +790,8 @@ BluetoothServiceBluedroid::SetProperty(BluetoothObjectType aType,
|
||||
ENSURE_BLUETOOTH_IS_READY(aRunnable, NS_OK);
|
||||
|
||||
mSetAdapterPropertyRunnables.AppendElement(aRunnable);
|
||||
|
||||
sBtInterface->SetAdapterProperty(aValue,
|
||||
new SetAdapterPropertyResultHandler(mSetAdapterPropertyRunnables,
|
||||
new DispatchReplyErrorResultHandler(mSetAdapterPropertyRunnables,
|
||||
aRunnable));
|
||||
|
||||
return NS_OK;
|
||||
@ -884,30 +814,6 @@ BluetoothServiceBluedroid::UpdateSdpRecords(
|
||||
return true;
|
||||
}
|
||||
|
||||
class BluetoothServiceBluedroid::CreateBondResultHandler final
|
||||
: public BluetoothResultHandler
|
||||
{
|
||||
public:
|
||||
CreateBondResultHandler(
|
||||
nsTArray<nsRefPtr<BluetoothReplyRunnable>>& aRunnableArray,
|
||||
BluetoothReplyRunnable* aRunnable)
|
||||
: mRunnableArray(aRunnableArray)
|
||||
, mRunnable(aRunnable)
|
||||
{
|
||||
MOZ_ASSERT(mRunnable);
|
||||
}
|
||||
|
||||
void OnError(BluetoothStatus aStatus) override
|
||||
{
|
||||
mRunnableArray.RemoveElement(mRunnable);
|
||||
DispatchReplyError(mRunnable, aStatus);
|
||||
}
|
||||
|
||||
private:
|
||||
nsTArray<nsRefPtr<BluetoothReplyRunnable>> mRunnableArray;
|
||||
nsRefPtr<BluetoothReplyRunnable> mRunnable;
|
||||
};
|
||||
|
||||
nsresult
|
||||
BluetoothServiceBluedroid::CreatePairedDeviceInternal(
|
||||
const nsAString& aDeviceAddress, int aTimeout,
|
||||
@ -918,37 +824,12 @@ BluetoothServiceBluedroid::CreatePairedDeviceInternal(
|
||||
ENSURE_BLUETOOTH_IS_READY(aRunnable, NS_OK);
|
||||
|
||||
mCreateBondRunnables.AppendElement(aRunnable);
|
||||
|
||||
sBtInterface->CreateBond(aDeviceAddress, TRANSPORT_AUTO,
|
||||
new CreateBondResultHandler(mCreateBondRunnables, aRunnable));
|
||||
new DispatchReplyErrorResultHandler(mCreateBondRunnables, aRunnable));
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
class BluetoothServiceBluedroid::RemoveBondResultHandler final
|
||||
: public BluetoothResultHandler
|
||||
{
|
||||
public:
|
||||
RemoveBondResultHandler(
|
||||
nsTArray<nsRefPtr<BluetoothReplyRunnable>>& aRunnableArray,
|
||||
BluetoothReplyRunnable* aRunnable)
|
||||
: mRunnableArray(aRunnableArray)
|
||||
, mRunnable(aRunnable)
|
||||
{
|
||||
MOZ_ASSERT(mRunnable);
|
||||
}
|
||||
|
||||
void OnError(BluetoothStatus aStatus) override
|
||||
{
|
||||
mRunnableArray.RemoveElement(mRunnable);
|
||||
DispatchReplyError(mRunnable, aStatus);
|
||||
}
|
||||
|
||||
private:
|
||||
nsTArray<nsRefPtr<BluetoothReplyRunnable>> mRunnableArray;
|
||||
nsRefPtr<BluetoothReplyRunnable> mRunnable;
|
||||
};
|
||||
|
||||
nsresult
|
||||
BluetoothServiceBluedroid::RemoveDeviceInternal(
|
||||
const nsAString& aDeviceAddress, BluetoothReplyRunnable* aRunnable)
|
||||
@ -958,9 +839,8 @@ BluetoothServiceBluedroid::RemoveDeviceInternal(
|
||||
ENSURE_BLUETOOTH_IS_READY(aRunnable, NS_OK);
|
||||
|
||||
mRemoveBondRunnables.AppendElement(aRunnable);
|
||||
|
||||
sBtInterface->RemoveBond(aDeviceAddress,
|
||||
new RemoveBondResultHandler(mRemoveBondRunnables, aRunnable));
|
||||
new DispatchReplyErrorResultHandler(mRemoveBondRunnables, aRunnable));
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -1759,9 +1639,8 @@ BluetoothServiceBluedroid::DiscoveryStateChangedNotification(bool aState)
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothServiceBluedroid::PinRequestNotification(const nsAString& aRemoteBdAddr,
|
||||
const nsAString& aBdName,
|
||||
uint32_t aCod)
|
||||
BluetoothServiceBluedroid::PinRequestNotification(
|
||||
const nsAString& aRemoteBdAddr, const nsAString& aBdName, uint32_t aCod)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
|
@ -17,22 +17,17 @@ BEGIN_BLUETOOTH_NAMESPACE
|
||||
class BluetoothServiceBluedroid : public BluetoothService
|
||||
, public BluetoothNotificationHandler
|
||||
{
|
||||
class CancelDiscoveryResultHandler;
|
||||
class CleanupResultHandler;
|
||||
class CreateBondResultHandler;
|
||||
class DisableResultHandler;
|
||||
class DispatchReplyErrorResultHandler;
|
||||
class EnableResultHandler;
|
||||
class GetRemoteDevicePropertiesResultHandler;
|
||||
class GetRemoteServicesResultHandler;
|
||||
class InitResultHandler;
|
||||
class PinReplyResultHandler;
|
||||
class ProfileDeinitResultHandler;
|
||||
class ProfileInitResultHandler;
|
||||
class RemoveBondResultHandler;
|
||||
class SetAdapterPropertyDiscoverableResultHandler;
|
||||
class SetAdapterPropertyResultHandler;
|
||||
class SspReplyResultHandler;
|
||||
class StartDiscoveryResultHandler;
|
||||
|
||||
class GetDeviceRequest;
|
||||
|
||||
|
@ -794,7 +794,8 @@ BluetoothAdapter::GetConnectedDevices(uint16_t aServiceUuid, ErrorResult& aRv)
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothAdapter::GetPairedDevices(nsTArray<nsRefPtr<BluetoothDevice> >& aDevices)
|
||||
BluetoothAdapter::GetPairedDevices(
|
||||
nsTArray<nsRefPtr<BluetoothDevice> >& aDevices)
|
||||
{
|
||||
for (uint32_t i = 0; i < mDevices.Length(); ++i) {
|
||||
if (mDevices[i]->Paired()) {
|
||||
@ -1332,7 +1333,8 @@ BluetoothAdapter::SendFile(const nsAString& aDeviceAddress,
|
||||
}
|
||||
|
||||
already_AddRefed<DOMRequest>
|
||||
BluetoothAdapter::StopSendingFile(const nsAString& aDeviceAddress, ErrorResult& aRv)
|
||||
BluetoothAdapter::StopSendingFile(
|
||||
const nsAString& aDeviceAddress, ErrorResult& aRv)
|
||||
{
|
||||
nsCOMPtr<nsPIDOMWindow> win = GetOwner();
|
||||
if (!win) {
|
||||
@ -1532,7 +1534,8 @@ BluetoothAdapter::ToggleCalls(ErrorResult& aRv)
|
||||
}
|
||||
|
||||
already_AddRefed<DOMRequest>
|
||||
BluetoothAdapter::SendMediaMetaData(const MediaMetaData& aMediaMetaData, ErrorResult& aRv)
|
||||
BluetoothAdapter::SendMediaMetaData(
|
||||
const MediaMetaData& aMediaMetaData, ErrorResult& aRv)
|
||||
{
|
||||
nsCOMPtr<nsPIDOMWindow> win = GetOwner();
|
||||
if (!win) {
|
||||
@ -1561,7 +1564,8 @@ BluetoothAdapter::SendMediaMetaData(const MediaMetaData& aMediaMetaData, ErrorRe
|
||||
}
|
||||
|
||||
already_AddRefed<DOMRequest>
|
||||
BluetoothAdapter::SendMediaPlayStatus(const MediaPlayStatus& aMediaPlayStatus, ErrorResult& aRv)
|
||||
BluetoothAdapter::SendMediaPlayStatus(
|
||||
const MediaPlayStatus& aMediaPlayStatus, ErrorResult& aRv)
|
||||
{
|
||||
nsCOMPtr<nsPIDOMWindow> win = GetOwner();
|
||||
if (!win) {
|
||||
|
@ -314,6 +314,8 @@ private:
|
||||
* Convert string to BluetoothAdapterAttribute.
|
||||
*
|
||||
* @param aString [in] String to convert
|
||||
*
|
||||
* @return the adapter attribute converted from |aString|
|
||||
*/
|
||||
BluetoothAdapterAttribute
|
||||
ConvertStringToAdapterAttribute(const nsAString& aString);
|
||||
@ -323,14 +325,16 @@ private:
|
||||
*
|
||||
* @param aType [in] Adapter property to check
|
||||
* @param aValue [in] New value of the adapter property
|
||||
*
|
||||
* @return true if the adapter property has changed; false otherwise
|
||||
*/
|
||||
bool IsAdapterAttributeChanged(BluetoothAdapterAttribute aType,
|
||||
const BluetoothValue& aValue);
|
||||
|
||||
/**
|
||||
* Check whether this adapter is owned by Bluetooth certified app.
|
||||
* Check whether this adapter belongs to Bluetooth certified app.
|
||||
*
|
||||
* @return a boolean value to indicate whether it's owned by Bluetooth app.
|
||||
* @return true if this adapter belongs to Bluetooth app; false otherwise
|
||||
*/
|
||||
bool IsBluetoothCertifiedApp();
|
||||
|
||||
|
@ -126,6 +126,8 @@ private:
|
||||
* Convert uint32_t to BluetoothDeviceType.
|
||||
*
|
||||
* @param aValue [in] uint32_t to convert
|
||||
*
|
||||
* @return the device type converted from |aValue|
|
||||
*/
|
||||
BluetoothDeviceType ConvertUint32ToDeviceType(const uint32_t aValue);
|
||||
|
||||
@ -133,6 +135,8 @@ private:
|
||||
* Convert string to BluetoothDeviceAttribute.
|
||||
*
|
||||
* @param aString [in] String to convert
|
||||
*
|
||||
* @return the device attribute converted from |aString|
|
||||
*/
|
||||
BluetoothDeviceAttribute
|
||||
ConvertStringToDeviceAttribute(const nsAString& aString);
|
||||
@ -142,6 +146,8 @@ private:
|
||||
*
|
||||
* @param aType [in] Device property to check
|
||||
* @param aValue [in] New value of the device property
|
||||
*
|
||||
* @return true is the device attribute has changed; false otherwise
|
||||
*/
|
||||
bool IsDeviceAttributeChanged(BluetoothDeviceAttribute aType,
|
||||
const BluetoothValue& aValue);
|
||||
@ -152,7 +158,7 @@ private:
|
||||
* Parse 'Advertising Data Type' from an inquiry response and set name, UUIDs
|
||||
* and COD if they exist in ADV data.
|
||||
*
|
||||
* @param aAdvData [in] advertising data which provided by the LeScan result.
|
||||
* @param aAdvData [in] advertising data from LeScan result.
|
||||
*/
|
||||
void UpdatePropertiesFromAdvData(const nsTArray<uint8_t>& aAdvData);
|
||||
|
||||
|
@ -95,7 +95,7 @@ BluetoothDiscoveryHandle::DispatchLeDeviceEvent(BluetoothDevice* aLeDevice,
|
||||
|
||||
bool hasUuidsFilter = !mServiceUuids.IsEmpty();
|
||||
bool noAdvertisingUuid = remoteUuids.IsEmpty();
|
||||
// If a LE device doesn't advertise its service UUIDs, it can't possibly pass
|
||||
// If an LE device doesn't advertise its service UUIDs, it can't possibly pass
|
||||
// the UUIDs filter.
|
||||
if (hasUuidsFilter && noAdvertisingUuid) {
|
||||
return;
|
||||
@ -104,7 +104,7 @@ BluetoothDiscoveryHandle::DispatchLeDeviceEvent(BluetoothDevice* aLeDevice,
|
||||
// The web API startLeScan() makes the device's adapter start seeking for
|
||||
// remote LE devices advertising given service UUIDs.
|
||||
// Since current Bluetooth stack can't filter the results of LeScan by UUIDs,
|
||||
// gecko has to filter the results and dispach what API asked for.
|
||||
// gecko has to filter the results and dispatch what API asked for.
|
||||
bool matched = false;
|
||||
for (size_t index = 0; index < remoteUuids.Length(); ++index) {
|
||||
if (mServiceUuids.Contains(remoteUuids[index])) {
|
||||
@ -113,8 +113,8 @@ BluetoothDiscoveryHandle::DispatchLeDeviceEvent(BluetoothDevice* aLeDevice,
|
||||
}
|
||||
}
|
||||
|
||||
// Dispach 'devicefound 'event only if
|
||||
// - the service UUIDs in the scan record matchs the given UUIDs.
|
||||
// Dispatch 'devicefound' event only if
|
||||
// - the service UUID in the scan record matches one of the given UUIDs.
|
||||
// - the given UUIDs is empty.
|
||||
if (matched || mServiceUuids.IsEmpty()) {
|
||||
nsRefPtr<BluetoothLeDeviceEvent> event =
|
||||
|
@ -302,7 +302,8 @@ BluetoothGatt::HandleCharacteristicsDiscovered(const BluetoothValue& aValue)
|
||||
aValue.get_ArrayOfBluetoothNamedValue();
|
||||
MOZ_ASSERT(values.Length() == 2); // ServiceId, Characteristics
|
||||
MOZ_ASSERT(values[0].name().EqualsLiteral("serviceId"));
|
||||
MOZ_ASSERT(values[0].value().type() == BluetoothValue::TBluetoothGattServiceId);
|
||||
MOZ_ASSERT(values[0].value().type() ==
|
||||
BluetoothValue::TBluetoothGattServiceId);
|
||||
MOZ_ASSERT(values[1].name().EqualsLiteral("characteristics"));
|
||||
MOZ_ASSERT(values[1].value().type() ==
|
||||
BluetoothValue::TArrayOfBluetoothGattCharAttribute);
|
||||
@ -325,11 +326,13 @@ BluetoothGatt::HandleDescriptorsDiscovered(const BluetoothValue& aValue)
|
||||
aValue.get_ArrayOfBluetoothNamedValue();
|
||||
MOZ_ASSERT(values.Length() == 3); // ServiceId, CharacteristicId, Descriptors
|
||||
MOZ_ASSERT(values[0].name().EqualsLiteral("serviceId"));
|
||||
MOZ_ASSERT(values[0].value().type() == BluetoothValue::TBluetoothGattServiceId);
|
||||
MOZ_ASSERT(values[0].value().type() ==
|
||||
BluetoothValue::TBluetoothGattServiceId);
|
||||
MOZ_ASSERT(values[1].name().EqualsLiteral("characteristicId"));
|
||||
MOZ_ASSERT(values[1].value().type() == BluetoothValue::TBluetoothGattId);
|
||||
MOZ_ASSERT(values[2].name().EqualsLiteral("descriptors"));
|
||||
MOZ_ASSERT(values[2].value().type() == BluetoothValue::TArrayOfBluetoothGattId);
|
||||
MOZ_ASSERT(values[2].value().type() ==
|
||||
BluetoothValue::TArrayOfBluetoothGattId);
|
||||
|
||||
size_t index = mServices.IndexOf(
|
||||
values[0].value().get_BluetoothGattServiceId());
|
||||
|
@ -142,7 +142,7 @@ private:
|
||||
|
||||
/**
|
||||
* The value of a GATT characteristic has changed. In the mean time, the
|
||||
* cached value of this GATT characteristic has already been updated. An
|
||||
* cached value of this GATT characteristic has already been updated. A
|
||||
* 'characteristicchanged' event will be fired by this function.
|
||||
*
|
||||
* @param aValue [in] BluetoothValue which contains an array of
|
||||
|
@ -188,12 +188,14 @@ BluetoothGattCharacteristic::GetProperties(
|
||||
{
|
||||
aProperties.mBroadcast = mProperties & GATT_CHAR_PROP_BIT_BROADCAST;
|
||||
aProperties.mRead = mProperties & GATT_CHAR_PROP_BIT_READ;
|
||||
aProperties.mWriteNoResponse = mProperties & GATT_CHAR_PROP_BIT_WRITE_NO_RESPONSE;
|
||||
aProperties.mWriteNoResponse =
|
||||
mProperties & GATT_CHAR_PROP_BIT_WRITE_NO_RESPONSE;
|
||||
aProperties.mWrite = mProperties & GATT_CHAR_PROP_BIT_WRITE;
|
||||
aProperties.mNotify = mProperties & GATT_CHAR_PROP_BIT_NOTIFY;
|
||||
aProperties.mIndicate = mProperties & GATT_CHAR_PROP_BIT_INDICATE;
|
||||
aProperties.mSignedWrite = mProperties & GATT_CHAR_PROP_BIT_SIGNED_WRITE;
|
||||
aProperties.mExtendedProps = mProperties & GATT_CHAR_PROP_BIT_EXTENDED_PROPERTIES;
|
||||
aProperties.mExtendedProps =
|
||||
mProperties & GATT_CHAR_PROP_BIT_EXTENDED_PROPERTIES;
|
||||
}
|
||||
|
||||
class ReadValueTask final : public BluetoothReplyRunnable
|
||||
|
@ -38,7 +38,8 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(BluetoothLeDeviceEvent)
|
||||
NS_INTERFACE_MAP_END_INHERITING(Event)
|
||||
|
||||
BluetoothLeDeviceEvent::BluetoothLeDeviceEvent(mozilla::dom::EventTarget* aOwner)
|
||||
BluetoothLeDeviceEvent::BluetoothLeDeviceEvent(
|
||||
mozilla::dom::EventTarget* aOwner)
|
||||
: Event(aOwner, nullptr, nullptr)
|
||||
{
|
||||
mozilla::HoldJSObjects(this);
|
||||
|
@ -301,7 +301,8 @@ RemoveAllSignalHandlers(const nsAString& aKey,
|
||||
nsAutoPtr<BluetoothSignalObserverList>& aData,
|
||||
void* aUserArg)
|
||||
{
|
||||
BluetoothSignalObserver* handler = static_cast<BluetoothSignalObserver*>(aUserArg);
|
||||
BluetoothSignalObserver* handler =
|
||||
static_cast<BluetoothSignalObserver*>(aUserArg);
|
||||
aData->RemoveObserver(handler);
|
||||
// We shouldn't have duplicate instances in the ObserverList, but there's
|
||||
// no appropriate way to do duplication check while registering, so
|
||||
@ -320,13 +321,15 @@ BluetoothService::UnregisterAllSignalHandlers(BluetoothSignalObserver* aHandler)
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothService::DistributeSignal(const nsAString& aName, const nsAString& aPath)
|
||||
BluetoothService::DistributeSignal(const nsAString& aName,
|
||||
const nsAString& aPath)
|
||||
{
|
||||
DistributeSignal(aName, aPath, BluetoothValue(true));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothService::DistributeSignal(const nsAString& aName, const nsAString& aPath,
|
||||
BluetoothService::DistributeSignal(const nsAString& aName,
|
||||
const nsAString& aPath,
|
||||
const BluetoothValue& aValue)
|
||||
{
|
||||
BluetoothSignal signal(nsString(aName), nsString(aPath), aValue);
|
||||
|
@ -184,14 +184,16 @@ BluetoothA2dpManager::Disconnect(BluetoothProfileController* aController)
|
||||
BluetoothService* bs = BluetoothService::Get();
|
||||
if (!bs) {
|
||||
if (aController) {
|
||||
aController->NotifyCompletion(NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE));
|
||||
aController->NotifyCompletion(
|
||||
NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mA2dpConnected) {
|
||||
if (aController) {
|
||||
aController->NotifyCompletion(NS_LITERAL_STRING(ERR_ALREADY_DISCONNECTED));
|
||||
aController->NotifyCompletion(
|
||||
NS_LITERAL_STRING(ERR_ALREADY_DISCONNECTED));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -262,7 +264,8 @@ void
|
||||
BluetoothA2dpManager::HandleSinkPropertyChanged(const BluetoothSignal& aSignal)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(aSignal.value().type() == BluetoothValue::TArrayOfBluetoothNamedValue);
|
||||
MOZ_ASSERT(aSignal.value().type() ==
|
||||
BluetoothValue::TArrayOfBluetoothNamedValue);
|
||||
|
||||
const nsString& address = aSignal.path();
|
||||
/**
|
||||
|
@ -378,7 +378,8 @@ static StaticAutoPtr<Monitor> sStopBluetoothMonitor;
|
||||
// Protects against bug 969447.
|
||||
static StaticAutoPtr<Monitor> sGetPropertyMonitor;
|
||||
|
||||
typedef void (*UnpackFunc)(DBusMessage*, DBusError*, BluetoothValue&, nsAString&);
|
||||
typedef void (*UnpackFunc)(DBusMessage*, DBusError*,
|
||||
BluetoothValue&, nsAString&);
|
||||
typedef bool (*FilterFunc)(const BluetoothValue&);
|
||||
|
||||
static void
|
||||
@ -400,7 +401,8 @@ DispatchToBtThread(nsIRunnable* aRunnable)
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (!sBluetoothThread) {
|
||||
sBluetoothThread = new LazyIdleThread(BT_LAZY_THREAD_TIMEOUT_MS,
|
||||
sBluetoothThread =
|
||||
new LazyIdleThread(BT_LAZY_THREAD_TIMEOUT_MS,
|
||||
NS_LITERAL_CSTRING("BluetoothDBusService"),
|
||||
LazyIdleThread::ManualShutdown);
|
||||
ClearOnShutdown(&sBluetoothThread);
|
||||
@ -589,7 +591,8 @@ public:
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(mSignal.name().EqualsLiteral("PropertyChanged"));
|
||||
MOZ_ASSERT(mSignal.value().type() == BluetoothValue::TArrayOfBluetoothNamedValue);
|
||||
MOZ_ASSERT(mSignal.value().type() ==
|
||||
BluetoothValue::TArrayOfBluetoothNamedValue);
|
||||
|
||||
// Replace object path with device address
|
||||
nsString address = GetAddressFromObjectPath(mSignal.path());
|
||||
@ -1472,7 +1475,8 @@ AgentEventFilter(DBusConnection *conn, DBusMessage *msg, void *data)
|
||||
|
||||
// Do not send a notification to upper layer, too annoying.
|
||||
return DBUS_HANDLER_RESULT_HANDLED;
|
||||
} else if (dbus_message_is_method_call(msg, DBUS_AGENT_IFACE, "RequestPairingConsent")) {
|
||||
} else if (dbus_message_is_method_call(msg, DBUS_AGENT_IFACE,
|
||||
"RequestPairingConsent")) {
|
||||
// Directly SetPairingconfirmation for RequestPairingConsent here
|
||||
if (!dbus_message_get_args(msg, nullptr,
|
||||
DBUS_TYPE_OBJECT_PATH, &objectPath,
|
||||
@ -1481,7 +1485,8 @@ AgentEventFilter(DBusConnection *conn, DBusMessage *msg, void *data)
|
||||
goto handle_error;
|
||||
}
|
||||
|
||||
nsString address = GetAddressFromObjectPath(NS_ConvertUTF8toUTF16(objectPath));
|
||||
nsString address =
|
||||
GetAddressFromObjectPath(NS_ConvertUTF8toUTF16(objectPath));
|
||||
sPairingReqTable->Put(address, msg);
|
||||
Task* task = new SetPairingConfirmationTask(address, true, nullptr);
|
||||
DispatchToDBusThread(task);
|
||||
@ -2093,12 +2098,13 @@ public:
|
||||
/* Normally we'll receive the signal 'AdapterAdded' with the adapter object
|
||||
* path from the DBus daemon during start up. So, there's no need to query
|
||||
* the object path of default adapter here. However, if we restart from a
|
||||
* crash, the default adapter might already be available, so we ask the daemon
|
||||
* explicitly here.
|
||||
* crash, the default adapter might already be available, so we ask the
|
||||
* daemon explicitly here.
|
||||
*/
|
||||
if (sAdapterPath.IsEmpty()) {
|
||||
bool success = sDBusConnection->SendWithReply(OnDefaultAdapterReply, nullptr,
|
||||
1000, BLUEZ_DBUS_BASE_IFC, "/",
|
||||
bool success = sDBusConnection->SendWithReply(OnDefaultAdapterReply,
|
||||
nullptr, 1000,
|
||||
BLUEZ_DBUS_BASE_IFC, "/",
|
||||
DBUS_MANAGER_IFACE,
|
||||
"DefaultAdapter",
|
||||
DBUS_TYPE_INVALID);
|
||||
@ -2483,7 +2489,8 @@ OnSendDiscoveryMessageReply(DBusMessage *aReply, void *aData)
|
||||
}
|
||||
|
||||
nsRefPtr<BluetoothReplyRunnable> runnable =
|
||||
dont_AddRef<BluetoothReplyRunnable>(static_cast<BluetoothReplyRunnable*>(aData));
|
||||
dont_AddRef<BluetoothReplyRunnable>(
|
||||
static_cast<BluetoothReplyRunnable*>(aData));
|
||||
|
||||
DispatchBluetoothReply(runnable.get(), BluetoothValue(true), errorStr);
|
||||
}
|
||||
@ -2823,8 +2830,8 @@ private:
|
||||
};
|
||||
|
||||
nsresult
|
||||
BluetoothDBusService::GetConnectedDevicePropertiesInternal(uint16_t aServiceUuid,
|
||||
BluetoothReplyRunnable* aRunnable)
|
||||
BluetoothDBusService::GetConnectedDevicePropertiesInternal(
|
||||
uint16_t aServiceUuid, BluetoothReplyRunnable* aRunnable)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
@ -3534,8 +3541,8 @@ private:
|
||||
class OnGetServiceChannelReplyHandler : public DBusReplyHandler
|
||||
{
|
||||
public:
|
||||
OnGetServiceChannelReplyHandler(const nsAString& aDeviceAddress,
|
||||
const nsAString& aServiceUUID,
|
||||
OnGetServiceChannelReplyHandler(
|
||||
const nsAString& aDeviceAddress, const nsAString& aServiceUUID,
|
||||
BluetoothProfileManagerBase* aBluetoothProfileManager)
|
||||
: mDeviceAddress(aDeviceAddress),
|
||||
mServiceUUID(aServiceUUID),
|
||||
@ -3559,9 +3566,8 @@ public:
|
||||
channel = dbus_returns_int32(aReply);
|
||||
}
|
||||
|
||||
nsRefPtr<nsRunnable> r = new OnGetServiceChannelRunnable(mDeviceAddress,
|
||||
mServiceUUID,
|
||||
channel,
|
||||
nsRefPtr<nsRunnable> r =
|
||||
new OnGetServiceChannelRunnable(mDeviceAddress, mServiceUUID, channel,
|
||||
mBluetoothProfileManager);
|
||||
nsresult rv = NS_DispatchToMainThread(r);
|
||||
NS_ENSURE_SUCCESS_VOID(rv);
|
||||
@ -3877,8 +3883,8 @@ public:
|
||||
|
||||
// We currently don't support genre field in music player.
|
||||
// In order to send media metadata through AVRCP, we set genre to an empty
|
||||
// string to match the BlueZ method "UpdateMetaData" with signature "sssssss",
|
||||
// which takes genre field as the last parameter.
|
||||
// string to match the BlueZ method "UpdateMetaData" with signature
|
||||
// "sssssss", which takes genre field as the last parameter.
|
||||
nsCString tempGenre = EmptyCString();
|
||||
nsCString tempMediaNumber = EmptyCString();
|
||||
nsCString tempTotalMediaCount = EmptyCString();
|
||||
|
@ -55,8 +55,8 @@ public:
|
||||
GetAdaptersInternal(BluetoothReplyRunnable* aRunnable) override;
|
||||
|
||||
virtual nsresult
|
||||
GetConnectedDevicePropertiesInternal(uint16_t aServiceUuid,
|
||||
BluetoothReplyRunnable* aRunnable) override;
|
||||
GetConnectedDevicePropertiesInternal(
|
||||
uint16_t aServiceUuid, BluetoothReplyRunnable* aRunnable) override;
|
||||
|
||||
virtual nsresult
|
||||
GetPairedDevicePropertiesInternal(const nsTArray<nsString>& aDeviceAddresses,
|
||||
@ -66,9 +66,11 @@ public:
|
||||
FetchUuidsInternal(const nsAString& aDeviceAddress,
|
||||
BluetoothReplyRunnable* aRunnable) override;
|
||||
|
||||
virtual void StartDiscoveryInternal(BluetoothReplyRunnable* aRunnable) override;
|
||||
virtual void
|
||||
StartDiscoveryInternal(BluetoothReplyRunnable* aRunnable) override;
|
||||
|
||||
virtual void StopDiscoveryInternal(BluetoothReplyRunnable* aRunnable) override;
|
||||
virtual void
|
||||
StopDiscoveryInternal(BluetoothReplyRunnable* aRunnable) override;
|
||||
|
||||
virtual nsresult
|
||||
SetProperty(BluetoothObjectType aType,
|
||||
|
@ -590,7 +590,8 @@ BluetoothHfpManager::HandleVolumeChanged(nsISupports* aSubject)
|
||||
// {"key":"volumeup", "value":10}
|
||||
// {"key":"volumedown", "value":2}
|
||||
|
||||
RootedDictionary<dom::SettingChangeNotification> setting(nsContentUtils::RootingCx());
|
||||
RootedDictionary<dom::SettingChangeNotification>
|
||||
setting(nsContentUtils::RootingCx());
|
||||
|
||||
if (!WrappedJSToDictionary(aSubject, setting)) {
|
||||
return;
|
||||
@ -843,7 +844,8 @@ BluetoothHfpManager::ReceiveSocketData(BluetoothSocket* aSocket,
|
||||
if (!atCommandValues[0].EqualsLiteral("3") ||
|
||||
!atCommandValues[1].EqualsLiteral("0")) {
|
||||
if (mCMEE) {
|
||||
SendCommand(RESPONSE_CME_ERROR, BluetoothCmeError::OPERATION_NOT_SUPPORTED);
|
||||
SendCommand(RESPONSE_CME_ERROR,
|
||||
BluetoothCmeError::OPERATION_NOT_SUPPORTED);
|
||||
} else {
|
||||
SendLine("ERROR");
|
||||
}
|
||||
@ -1225,7 +1227,8 @@ BluetoothHfpManager::Disconnect(BluetoothProfileController* aController)
|
||||
|
||||
if (!mSocket) {
|
||||
if (aController) {
|
||||
aController->NotifyCompletion(NS_LITERAL_STRING(ERR_ALREADY_DISCONNECTED));
|
||||
aController->NotifyCompletion(
|
||||
NS_LITERAL_STRING(ERR_ALREADY_DISCONNECTED));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -1507,8 +1510,10 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex,
|
||||
case nsITelephonyService::CALL_STATE_HELD:
|
||||
switch (prevCallState) {
|
||||
case nsITelephonyService::CALL_STATE_CONNECTED: {
|
||||
uint32_t numActive = GetNumberOfCalls(nsITelephonyService::CALL_STATE_CONNECTED);
|
||||
uint32_t numHeld = GetNumberOfCalls(nsITelephonyService::CALL_STATE_HELD);
|
||||
uint32_t numActive =
|
||||
GetNumberOfCalls(nsITelephonyService::CALL_STATE_CONNECTED);
|
||||
uint32_t numHeld =
|
||||
GetNumberOfCalls(nsITelephonyService::CALL_STATE_HELD);
|
||||
uint32_t numConCalls = GetNumberOfConCalls();
|
||||
|
||||
/**
|
||||
@ -1530,20 +1535,24 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex,
|
||||
if (!aIsConference) {
|
||||
if (numActive + numHeld == 1) {
|
||||
// A single active call is put on hold.
|
||||
sCINDItems[CINDType::CALLHELD].value = CallHeldState::ONHOLD_NOACTIVE;
|
||||
sCINDItems[CINDType::CALLHELD].value =
|
||||
CallHeldState::ONHOLD_NOACTIVE;
|
||||
} else {
|
||||
// An active call is placed on hold or active/held calls swapped.
|
||||
sCINDItems[CINDType::CALLHELD].value = CallHeldState::ONHOLD_ACTIVE;
|
||||
sCINDItems[CINDType::CALLHELD].value =
|
||||
CallHeldState::ONHOLD_ACTIVE;
|
||||
}
|
||||
SendCommand(RESPONSE_CIEV, CINDType::CALLHELD);
|
||||
} else if (GetNumberOfConCalls(nsITelephonyService::CALL_STATE_HELD)
|
||||
== numConCalls) {
|
||||
if (numActive + numHeld == numConCalls) {
|
||||
// An active conference call is put on hold.
|
||||
sCINDItems[CINDType::CALLHELD].value = CallHeldState::ONHOLD_NOACTIVE;
|
||||
sCINDItems[CINDType::CALLHELD].value =
|
||||
CallHeldState::ONHOLD_NOACTIVE;
|
||||
} else {
|
||||
// Active calls are placed on hold or active/held calls swapped.
|
||||
sCINDItems[CINDType::CALLHELD].value = CallHeldState::ONHOLD_ACTIVE;
|
||||
sCINDItems[CINDType::CALLHELD].value =
|
||||
CallHeldState::ONHOLD_ACTIVE;
|
||||
}
|
||||
SendCommand(RESPONSE_CIEV, CINDType::CALLHELD);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user