Merge b2g-inbound to m-c a=merge CLOSED TREE

This commit is contained in:
Wes Kocher 2015-02-26 18:47:34 -08:00
Родитель d1dab12dcf e7a8e00fc5
Коммит c4a10197bb
29 изменённых файлов: 485 добавлений и 88 удалений

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="22230c9a340a0a2c3af73320cf47e1cb544517ad"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="7512026a377271a0cade12d70846557f0bc7781c"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3905180d9e2dbe03d7ce3b3a6debe4d4adc938d1"/>
<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="22230c9a340a0a2c3af73320cf47e1cb544517ad"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="7512026a377271a0cade12d70846557f0bc7781c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3905180d9e2dbe03d7ce3b3a6debe4d4adc938d1"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="93f9ba577f68d772093987c2f1c0a4ae293e1802"/>

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

@ -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="22230c9a340a0a2c3af73320cf47e1cb544517ad"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="7512026a377271a0cade12d70846557f0bc7781c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3905180d9e2dbe03d7ce3b3a6debe4d4adc938d1"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="c42985975f2bbc42859b9136ed348186d989b93d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a1ddea3133e0807350326cee5dcf0d06fad00c08"/>
@ -135,7 +135,7 @@
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="c5f8d282efe4a4e8b1e31a37300944e338e60e4f"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="9f28c4faea3b2f01db227b2467b08aeba96d9bec"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="d19dad5844e8803d5e88d1577a2742b4f5cbc467"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="84395037a7a04546e8ef7cb81572eb516b85562b"/>
<project name="android-sdk" path="sdk" remote="b2g" revision="8b1365af38c9a653df97349ee53a3f5d64fd590a"/>
<project name="darwinstreamingserver" path="system/darwinstreamingserver" remote="b2g" revision="cf85968c7f85e0ec36e72c87ceb4837a943b8af6"/>
</manifest>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="22230c9a340a0a2c3af73320cf47e1cb544517ad"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="7512026a377271a0cade12d70846557f0bc7781c"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3905180d9e2dbe03d7ce3b3a6debe4d4adc938d1"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="52775e03a2d8532429dff579cb2cd56718e488c3">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="22230c9a340a0a2c3af73320cf47e1cb544517ad"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="7512026a377271a0cade12d70846557f0bc7781c"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3905180d9e2dbe03d7ce3b3a6debe4d4adc938d1"/>
<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="22230c9a340a0a2c3af73320cf47e1cb544517ad"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="7512026a377271a0cade12d70846557f0bc7781c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3905180d9e2dbe03d7ce3b3a6debe4d4adc938d1"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="93f9ba577f68d772093987c2f1c0a4ae293e1802"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="22230c9a340a0a2c3af73320cf47e1cb544517ad"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="7512026a377271a0cade12d70846557f0bc7781c"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3905180d9e2dbe03d7ce3b3a6debe4d4adc938d1"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -146,7 +146,7 @@
<project name="platform/hardware/ril" path="hardware/ril" revision="12b1977cc704b35f2e9db2bb423fa405348bc2f3"/>
<project name="platform/system/bluetooth" path="system/bluetooth" revision="985bf15264d865fe7b9c5b45f61c451cbaafa43d"/>
<project name="platform/system/core" path="system/core" revision="42839aedcf70bf6bc92a3b7ea4a5cc9bf9aef3f9"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="d19dad5844e8803d5e88d1577a2742b4f5cbc467"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="84395037a7a04546e8ef7cb81572eb516b85562b"/>
<project name="platform/system/qcom" path="system/qcom" revision="63e3f6f176caad587d42bba4c16b66d953fb23c2"/>
<project name="platform/vendor/qcom-opensource/wlan/prima" path="vendor/qcom/opensource/wlan/prima" revision="d8952a42771045fca73ec600e2b42a4c7129d723"/>
<project name="platform/vendor/qcom/msm8610" path="device/qcom/msm8610" revision="4c187c1f3a0dffd8e51a961735474ea703535b99"/>

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

@ -17,7 +17,7 @@
</project>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="22230c9a340a0a2c3af73320cf47e1cb544517ad"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="7512026a377271a0cade12d70846557f0bc7781c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3905180d9e2dbe03d7ce3b3a6debe4d4adc938d1"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="c42985975f2bbc42859b9136ed348186d989b93d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a1ddea3133e0807350326cee5dcf0d06fad00c08"/>
@ -145,7 +145,7 @@
<project name="platform/hardware/ril" path="hardware/ril" revision="c4e2ac95907a5519a0e09f01a0d8e27fec101af0"/>
<project name="platform/system/bluetooth" path="system/bluetooth" revision="e1eb226fa3ad3874ea7b63c56a9dc7012d7ff3c2"/>
<project name="platform/system/core" path="system/core" revision="adc485d8755af6a61641d197de7cfef667722580"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="d19dad5844e8803d5e88d1577a2742b4f5cbc467"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="84395037a7a04546e8ef7cb81572eb516b85562b"/>
<project name="platform/system/qcom" path="system/qcom" revision="1cdab258b15258b7f9657da70e6f06ebd5a2fc25"/>
<project name="platform/vendor/qcom/msm8610" path="device/qcom/msm8610" revision="4ae5df252123591d5b941191790e7abed1bce5a4"/>
<project name="platform/vendor/qcom-opensource/wlan/prima" path="vendor/qcom/opensource/wlan/prima" revision="ce18b47b4a4f93a581d672bbd5cb6d12fe796ca9"/>

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

@ -1,9 +1,9 @@
{
"git": {
"git_revision": "22230c9a340a0a2c3af73320cf47e1cb544517ad",
"git_revision": "7512026a377271a0cade12d70846557f0bc7781c",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
"revision": "298fece36f2564e042e347a48fcc104aca78e3b5",
"revision": "53713e514b92cccfd55404cebd2b627cb9804bc2",
"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="22230c9a340a0a2c3af73320cf47e1cb544517ad"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="7512026a377271a0cade12d70846557f0bc7781c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3905180d9e2dbe03d7ce3b3a6debe4d4adc938d1"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="c42985975f2bbc42859b9136ed348186d989b93d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a1ddea3133e0807350326cee5dcf0d06fad00c08"/>
@ -130,7 +130,7 @@
<project name="device-mako" path="device/lge/mako" remote="b2g" revision="78d17f0c117f0c66dd55ee8d5c5dde8ccc93ecba"/>
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="3a9a17613cc685aa232432566ad6cc607eab4ec1"/>
<project name="device/lge/mako-kernel" path="device/lge/mako-kernel" revision="d1729e53d71d711c8fde25eab8728ff2b9b4df0e"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="d19dad5844e8803d5e88d1577a2742b4f5cbc467"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="84395037a7a04546e8ef7cb81572eb516b85562b"/>
<project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="7d33aaf740bbf6c7c6e9c34a92b371eda311b66b"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/>
<project name="platform/hardware/broadcom/wlan" path="hardware/broadcom/wlan" revision="0e1929fa3aa38bf9d40e9e953d619fab8164c82e"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="52775e03a2d8532429dff579cb2cd56718e488c3">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="22230c9a340a0a2c3af73320cf47e1cb544517ad"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="7512026a377271a0cade12d70846557f0bc7781c"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3905180d9e2dbe03d7ce3b3a6debe4d4adc938d1"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -141,7 +141,7 @@
<default remote="caf" revision="refs/tags/android-5.0.0_r6" sync-j="4"/>
<!-- Nexus 5 specific things -->
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="ba62cc8b78c30d36181b8060a2016cc8da166236"/>
<project name="device-hammerhead" path="device/lge/hammerhead" remote="b2g" revision="b765862a60e0063fc2451f5e3e137247dd9838c3"/>
<project name="device-hammerhead" path="device/lge/hammerhead" remote="b2g" revision="dc525eeb67301a44f514a7ac40a59ec592b34e31"/>
<project name="device/qcom/common" path="device/qcom/common" remote="caf" revision="3697e5acf25629b82658334e3f8ee3b6df5becab"/>
<project name="device_lge_hammerhead-kernel" path="device/lge/hammerhead-kernel" remote="b2g" revision="1268f640184df5ef759ada669f101a613451673a"/>
<project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="0cb8574d338bf9f15b45ace7c08ad6deae9673ee"/>
@ -157,5 +157,5 @@
<project name="platform/hardware/qcom/sensors" path="hardware/qcom/sensors" revision="3724fd91ef5183684d97e2bf1d7ff948faabe090"/>
<project name="platform/hardware/qcom/wlan" path="hardware/qcom/wlan" revision="2e54754cc0529d26ccac37ed291600048adbf6c0"/>
<project name="platform/hardware/ril" path="hardware/ril" revision="71dfa8228ad0d6cdf6bac0426ac59404ab74b7f3"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="d19dad5844e8803d5e88d1577a2742b4f5cbc467"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="84395037a7a04546e8ef7cb81572eb516b85562b"/>
</manifest>

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

@ -0,0 +1,28 @@
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
/* vim: set ts=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 "BluetoothInterfaceHelpers.h"
BEGIN_BLUETOOTH_NAMESPACE
//
// Conversion
//
nsresult
Convert(nsresult aIn, BluetoothStatus& aOut)
{
if (NS_SUCCEEDED(aIn)) {
aOut = STATUS_SUCCESS;
} else if (aIn == NS_ERROR_OUT_OF_MEMORY) {
aOut = STATUS_NOMEM;
} else {
aOut = STATUS_FAIL;
}
return NS_OK;
}
END_BLUETOOTH_NAMESPACE

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

@ -12,6 +12,13 @@
BEGIN_BLUETOOTH_NAMESPACE
//
// Conversion
//
nsresult
Convert(nsresult aIn, BluetoothStatus& aOut);
//
// Result handling
//
@ -49,6 +56,9 @@ public:
static void
Dispatch(Obj* aObj, Res (Obj::*aMethod)(), const InitOp& aInitOp)
{
if (!aObj) {
return; // silently return if no result runnable has been given
}
nsRefPtr<SelfType> runnable = Create(aObj, aMethod, aInitOp);
if (!runnable) {
BT_LOGR("BluetoothResultRunnable0::Create failed");
@ -108,6 +118,9 @@ public:
static void
Dispatch(Obj* aObj, Res (Obj::*aMethod)(Arg1), const InitOp& aInitOp)
{
if (!aObj) {
return; // silently return if no result runnable has been given
}
nsRefPtr<SelfType> runnable = Create(aObj, aMethod, aInitOp);
if (!runnable) {
BT_LOGR("BluetoothResultRunnable1::Create failed");
@ -174,6 +187,9 @@ public:
Dispatch(Obj* aObj, Res (Obj::*aMethod)(Arg1, Arg2, Arg3),
const InitOp& aInitOp)
{
if (!aObj) {
return; // silently return if no result runnable has been given
}
nsRefPtr<SelfType> runnable = Create(aObj, aMethod, aInitOp);
if (!runnable) {
BT_LOGR("BluetoothResultRunnable3::Create failed");

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

@ -335,6 +335,9 @@ public:
{
BT_WARNING("BluetoothAvrcpInterface::Cleanup failed: %d",
(int)aStatus);
sBtAvrcpInterface = nullptr;
if (mRes) {
if (aStatus == STATUS_UNSUPPORTED) {
/* Not all versions of Bluedroid support AVRCP. So if the
@ -371,6 +374,9 @@ public:
{
BT_WARNING("BluetoothA2dpInterface::Cleanup failed: %d",
(int)aStatus);
sBtA2dpInterface = nullptr;
if (mRes) {
mRes->OnError(NS_ERROR_FAILURE);
}

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

@ -395,7 +395,7 @@ BluetoothDaemonA2dpInterface::Init(
nsresult rv = mModule->RegisterModule(BluetoothDaemonA2dpModule::SERVICE_ID,
0x00, BluetoothDaemonA2dpModule::MAX_NUM_CLIENTS, res);
if (NS_FAILED(rv) && aRes) {
DispatchError(aRes, STATUS_FAIL);
DispatchError(aRes, rv);
}
}
@ -443,8 +443,12 @@ void
BluetoothDaemonA2dpInterface::Cleanup(
BluetoothA2dpResultHandler* aRes)
{
mModule->UnregisterModule(BluetoothDaemonA2dpModule::SERVICE_ID,
new CleanupResultHandler(mModule, aRes));
nsresult rv = mModule->UnregisterModule(
BluetoothDaemonA2dpModule::SERVICE_ID,
new CleanupResultHandler(mModule, aRes));
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
/* Connect / Disconnect */
@ -455,7 +459,10 @@ BluetoothDaemonA2dpInterface::Connect(
{
MOZ_ASSERT(mModule);
mModule->ConnectCmd(aBdAddr, aRes);
nsresult rv = mModule->ConnectCmd(aBdAddr, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -464,7 +471,10 @@ BluetoothDaemonA2dpInterface::Disconnect(
{
MOZ_ASSERT(mModule);
mModule->DisconnectCmd(aBdAddr, aRes);
nsresult rv = mModule->DisconnectCmd(aBdAddr, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -477,4 +487,16 @@ BluetoothDaemonA2dpInterface::DispatchError(
ConstantInitOp1<BluetoothStatus>(aStatus));
}
void
BluetoothDaemonA2dpInterface::DispatchError(
BluetoothA2dpResultHandler* aRes, nsresult aRv)
{
BluetoothStatus status;
if (NS_WARN_IF(NS_FAILED(Convert(aRv, status)))) {
status = STATUS_FAIL;
}
DispatchError(aRes, status);
}
END_BLUETOOTH_NAMESPACE

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

@ -155,6 +155,7 @@ public:
private:
void DispatchError(BluetoothA2dpResultHandler* aRes,
BluetoothStatus aStatus);
void DispatchError(BluetoothA2dpResultHandler* aRes, nsresult aRv);
BluetoothDaemonA2dpModule* mModule;
};

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

@ -893,7 +893,7 @@ BluetoothDaemonAvrcpInterface::Init(
BluetoothDaemonAvrcpModule::MAX_NUM_CLIENTS, 0x00, res);
if (NS_FAILED(rv) && aRes) {
DispatchError(aRes, STATUS_FAIL);
DispatchError(aRes, rv);
}
}
@ -943,8 +943,12 @@ BluetoothDaemonAvrcpInterface::Cleanup(
{
MOZ_ASSERT(mModule);
mModule->UnregisterModule(BluetoothDaemonAvrcpModule::SERVICE_ID,
new CleanupResultHandler(mModule, aRes));
nsresult rv = mModule->UnregisterModule(
BluetoothDaemonAvrcpModule::SERVICE_ID,
new CleanupResultHandler(mModule, aRes));
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -954,7 +958,11 @@ BluetoothDaemonAvrcpInterface::GetPlayStatusRsp(
{
MOZ_ASSERT(mModule);
mModule->GetPlayStatusRspCmd(aPlayStatus, aSongLen, aSongPos, aRes);
nsresult rv = mModule->GetPlayStatusRspCmd(aPlayStatus, aSongLen,
aSongPos, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -964,7 +972,10 @@ BluetoothDaemonAvrcpInterface::ListPlayerAppAttrRsp(
{
MOZ_ASSERT(mModule);
mModule->ListPlayerAppAttrRspCmd(aNumAttr, aPAttrs, aRes);
nsresult rv = mModule->ListPlayerAppAttrRspCmd(aNumAttr, aPAttrs, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -973,7 +984,10 @@ BluetoothDaemonAvrcpInterface::ListPlayerAppValueRsp(
{
MOZ_ASSERT(mModule);
mModule->ListPlayerAppValueRspCmd(aNumVal, aPVals, aRes);
nsresult rv = mModule->ListPlayerAppValueRspCmd(aNumVal, aPVals, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -983,7 +997,11 @@ BluetoothDaemonAvrcpInterface::GetPlayerAppValueRsp(
{
MOZ_ASSERT(mModule);
mModule->GetPlayerAppValueRspCmd(aNumAttrs, aIds, aValues, aRes);
nsresult rv = mModule->GetPlayerAppValueRspCmd(aNumAttrs, aIds,
aValues, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -993,7 +1011,11 @@ BluetoothDaemonAvrcpInterface::GetPlayerAppAttrTextRsp(
{
MOZ_ASSERT(mModule);
mModule->GetPlayerAppAttrTextRspCmd(aNumAttr, aIds, aTexts, aRes);
nsresult rv = mModule->GetPlayerAppAttrTextRspCmd(aNumAttr, aIds,
aTexts, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -1003,7 +1025,11 @@ BluetoothDaemonAvrcpInterface::GetPlayerAppValueTextRsp(
{
MOZ_ASSERT(mModule);
mModule->GetPlayerAppValueTextRspCmd(aNumVal, aIds, aTexts, aRes);
nsresult rv = mModule->GetPlayerAppValueTextRspCmd(aNumVal, aIds,
aTexts, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -1013,7 +1039,10 @@ BluetoothDaemonAvrcpInterface::GetElementAttrRsp(
{
MOZ_ASSERT(mModule);
mModule->GetElementAttrRspCmd(aNumAttr, aAttr, aRes);
nsresult rv = mModule->GetElementAttrRspCmd(aNumAttr, aAttr, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -1022,7 +1051,10 @@ BluetoothDaemonAvrcpInterface::SetPlayerAppValueRsp(
{
MOZ_ASSERT(mModule);
mModule->SetPlayerAppValueRspCmd(aRspStatus, aRes);
nsresult rv = mModule->SetPlayerAppValueRspCmd(aRspStatus, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -1034,7 +1066,11 @@ BluetoothDaemonAvrcpInterface::RegisterNotificationRsp(
{
MOZ_ASSERT(mModule);
mModule->RegisterNotificationRspCmd(aEvent, aType, aParam, aRes);
nsresult rv = mModule->RegisterNotificationRspCmd(aEvent, aType,
aParam, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -1043,7 +1079,10 @@ BluetoothDaemonAvrcpInterface::SetVolume(
{
MOZ_ASSERT(mModule);
mModule->SetVolumeCmd(aVolume, aRes);
nsresult rv = mModule->SetVolumeCmd(aVolume, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -1056,4 +1095,16 @@ BluetoothDaemonAvrcpInterface::DispatchError(
ConstantInitOp1<BluetoothStatus>(aStatus));
}
void
BluetoothDaemonAvrcpInterface::DispatchError(
BluetoothAvrcpResultHandler* aRes, nsresult aRv)
{
BluetoothStatus status;
if (NS_WARN_IF(NS_FAILED(Convert(aRv, status)))) {
status = STATUS_FAIL;
}
DispatchError(aRes, status);
}
END_BLUETOOTH_NAMESPACE

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

@ -346,6 +346,7 @@ public:
private:
void DispatchError(BluetoothAvrcpResultHandler* aRes,
BluetoothStatus aStatus);
void DispatchError(BluetoothAvrcpResultHandler* aRes, nsresult aRv);
BluetoothDaemonAvrcpModule* mModule;
};

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

@ -1512,7 +1512,7 @@ BluetoothDaemonHandsfreeInterface::Init(
aMaxNumClients, res);
if (NS_FAILED(rv) && aRes) {
DispatchError(aRes, STATUS_FAIL);
DispatchError(aRes, rv);
}
}
@ -1532,6 +1532,7 @@ public:
{
MOZ_ASSERT(NS_IsMainThread());
BT_LOGR("%s:%d", __func__, __LINE__);
if (mRes) {
mRes->OnError(aStatus);
}
@ -1541,6 +1542,7 @@ public:
{
MOZ_ASSERT(NS_IsMainThread());
BT_LOGR("%s:%d", __func__, __LINE__);
// Clear notification handler _after_ module has been
// unregistered. While unregistering the module, we might
// still receive notifications.
@ -1560,8 +1562,14 @@ void
BluetoothDaemonHandsfreeInterface::Cleanup(
BluetoothHandsfreeResultHandler* aRes)
{
mModule->UnregisterModule(BluetoothDaemonHandsfreeModule::SERVICE_ID,
new CleanupResultHandler(mModule, aRes));
BT_LOGR("%s:%d", __func__, __LINE__);
nsresult rv = mModule->UnregisterModule(
BluetoothDaemonHandsfreeModule::SERVICE_ID,
new CleanupResultHandler(mModule, aRes));
BT_LOGR("%s:%d", __func__, __LINE__);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
/* Connect / Disconnect */
@ -1572,7 +1580,10 @@ BluetoothDaemonHandsfreeInterface::Connect(
{
MOZ_ASSERT(mModule);
mModule->ConnectCmd(aBdAddr, aRes);
nsresult rv = mModule->ConnectCmd(aBdAddr, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -1581,7 +1592,10 @@ BluetoothDaemonHandsfreeInterface::Disconnect(
{
MOZ_ASSERT(mModule);
mModule->DisconnectCmd(aBdAddr, aRes);
nsresult rv = mModule->DisconnectCmd(aBdAddr, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -1590,7 +1604,10 @@ BluetoothDaemonHandsfreeInterface::ConnectAudio(
{
MOZ_ASSERT(mModule);
mModule->ConnectAudioCmd(aBdAddr, aRes);
nsresult rv = mModule->ConnectAudioCmd(aBdAddr, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -1599,7 +1616,10 @@ BluetoothDaemonHandsfreeInterface::DisconnectAudio(
{
MOZ_ASSERT(mModule);
mModule->DisconnectAudioCmd(aBdAddr, aRes);
nsresult rv = mModule->DisconnectAudioCmd(aBdAddr, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
/* Voice Recognition */
@ -1610,7 +1630,10 @@ BluetoothDaemonHandsfreeInterface::StartVoiceRecognition(
{
MOZ_ASSERT(mModule);
mModule->StartVoiceRecognitionCmd(aBdAddr, aRes);
nsresult rv = mModule->StartVoiceRecognitionCmd(aBdAddr, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -1619,7 +1642,10 @@ BluetoothDaemonHandsfreeInterface::StopVoiceRecognition(
{
MOZ_ASSERT(mModule);
mModule->StopVoiceRecognitionCmd(aBdAddr, aRes);
nsresult rv = mModule->StopVoiceRecognitionCmd(aBdAddr, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
/* Volume */
@ -1631,7 +1657,10 @@ BluetoothDaemonHandsfreeInterface::VolumeControl(
{
MOZ_ASSERT(mModule);
mModule->VolumeControlCmd(aType, aVolume, aBdAddr, aRes);
nsresult rv = mModule->VolumeControlCmd(aType, aVolume, aBdAddr, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
/* Device status */
@ -1644,8 +1673,12 @@ BluetoothDaemonHandsfreeInterface::DeviceStatusNotification(
{
MOZ_ASSERT(mModule);
mModule->DeviceStatusNotificationCmd(aNtkState, aSvcType, aSignal,
aBattChg, aRes);
nsresult rv = mModule->DeviceStatusNotificationCmd(aNtkState, aSvcType,
aSignal, aBattChg,
aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
/* Responses */
@ -1657,7 +1690,10 @@ BluetoothDaemonHandsfreeInterface::CopsResponse(
{
MOZ_ASSERT(mModule);
mModule->CopsResponseCmd(aCops, aBdAddr, aRes);
nsresult rv = mModule->CopsResponseCmd(aCops, aBdAddr, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -1669,8 +1705,12 @@ BluetoothDaemonHandsfreeInterface::CindResponse(
{
MOZ_ASSERT(mModule);
mModule->CindResponseCmd(aSvc, aNumActive, aNumHeld, aCallSetupState,
aSignal, aRoam, aBattChg, aBdAddr, aRes);
nsresult rv = mModule->CindResponseCmd(aSvc, aNumActive, aNumHeld,
aCallSetupState, aSignal,
aRoam, aBattChg, aBdAddr, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -1680,7 +1720,10 @@ BluetoothDaemonHandsfreeInterface::FormattedAtResponse(
{
MOZ_ASSERT(mModule);
mModule->FormattedAtResponseCmd(aRsp, aBdAddr, aRes);
nsresult rv = mModule->FormattedAtResponseCmd(aRsp, aBdAddr, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -1690,7 +1733,11 @@ BluetoothDaemonHandsfreeInterface::AtResponse(
{
MOZ_ASSERT(mModule);
mModule->AtResponseCmd(aResponseCode, aErrorCode, aBdAddr, aRes);
nsresult rv = mModule->AtResponseCmd(aResponseCode, aErrorCode,
aBdAddr, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -1706,8 +1753,11 @@ BluetoothDaemonHandsfreeInterface::ClccResponse(
{
MOZ_ASSERT(mModule);
mModule->ClccResponseCmd(aIndex, aDir, aState, aMode, aMpty, aNumber,
aType, aBdAddr, aRes);
nsresult rv = mModule->ClccResponseCmd(aIndex, aDir, aState, aMode, aMpty,
aNumber, aType, aBdAddr, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
/* Phone State */
@ -1722,8 +1772,12 @@ BluetoothDaemonHandsfreeInterface::PhoneStateChange(
{
MOZ_ASSERT(mModule);
mModule->PhoneStateChangeCmd(aNumActive, aNumHeld, aCallSetupState, aNumber,
aType, aRes);
nsresult rv = mModule->PhoneStateChangeCmd(aNumActive, aNumHeld,
aCallSetupState, aNumber,
aType, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
/* Wide Band Speech */
@ -1735,7 +1789,10 @@ BluetoothDaemonHandsfreeInterface::ConfigureWbs(
{
MOZ_ASSERT(mModule);
mModule->ConfigureWbsCmd(aBdAddr, aConfig, aRes);
nsresult rv = mModule->ConfigureWbsCmd(aBdAddr, aConfig, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -1748,4 +1805,16 @@ BluetoothDaemonHandsfreeInterface::DispatchError(
ConstantInitOp1<BluetoothStatus>(aStatus));
}
void
BluetoothDaemonHandsfreeInterface::DispatchError(
BluetoothHandsfreeResultHandler* aRes, nsresult aRv)
{
BluetoothStatus status;
if (NS_WARN_IF(NS_FAILED(Convert(aRv, status)))) {
status = STATUS_FAIL;
}
DispatchError(aRes, status);
}
END_BLUETOOTH_NAMESPACE

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

@ -472,6 +472,7 @@ public:
private:
void DispatchError(BluetoothHandsfreeResultHandler* aRes,
BluetoothStatus aStatus);
void DispatchError(BluetoothHandsfreeResultHandler* aRes, nsresult aRv);
BluetoothDaemonHandsfreeModule* mModule;
};

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

@ -1893,7 +1893,15 @@ void
BluetoothDaemonInterface::OnDisconnect(enum Channel aChannel)
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(!mResultHandlerQ.IsEmpty());
if (mResultHandlerQ.IsEmpty()) {
if (sNotificationHandler) {
// Bluetooth daemon crashed; clear state
sNotificationHandler->AdapterStateChangedNotification(false);
sNotificationHandler = nullptr;
}
return;
}
switch (aChannel) {
case CMD_CHANNEL:
@ -2194,19 +2202,31 @@ BluetoothDaemonInterface::Cleanup(BluetoothResultHandler* aRes)
mResultHandlerQ.AppendElement(aRes);
// Cleanup, step 1: Unregister Socket module
mProtocol->UnregisterModuleCmd(0x02, new CleanupResultHandler(this));
nsresult rv = mProtocol->UnregisterModuleCmd(
0x02, new CleanupResultHandler(this));
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
BluetoothDaemonInterface::Enable(BluetoothResultHandler* aRes)
{
static_cast<BluetoothDaemonCoreModule*>(mProtocol)->EnableCmd(aRes);
nsresult rv =
static_cast<BluetoothDaemonCoreModule*>(mProtocol)->EnableCmd(aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
BluetoothDaemonInterface::Disable(BluetoothResultHandler* aRes)
{
static_cast<BluetoothDaemonCoreModule*>(mProtocol)->DisableCmd(aRes);
nsresult rv =
static_cast<BluetoothDaemonCoreModule*>(mProtocol)->DisableCmd(aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
/* Adapter Properties */
@ -2214,24 +2234,33 @@ BluetoothDaemonInterface::Disable(BluetoothResultHandler* aRes)
void
BluetoothDaemonInterface::GetAdapterProperties(BluetoothResultHandler* aRes)
{
static_cast<BluetoothDaemonCoreModule*>
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
(mProtocol)->GetAdapterPropertiesCmd(aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
BluetoothDaemonInterface::GetAdapterProperty(const nsAString& aName,
BluetoothResultHandler* aRes)
{
static_cast<BluetoothDaemonCoreModule*>
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
(mProtocol)->GetAdapterPropertyCmd(aName, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
BluetoothDaemonInterface::SetAdapterProperty(
const BluetoothNamedValue& aProperty, BluetoothResultHandler* aRes)
{
static_cast<BluetoothDaemonCoreModule*>
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
(mProtocol)->SetAdapterPropertyCmd(aProperty, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
/* Remote Device Properties */
@ -2240,8 +2269,11 @@ void
BluetoothDaemonInterface::GetRemoteDeviceProperties(
const nsAString& aRemoteAddr, BluetoothResultHandler* aRes)
{
static_cast<BluetoothDaemonCoreModule*>
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
(mProtocol)->GetRemoteDevicePropertiesCmd(aRemoteAddr, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -2249,8 +2281,11 @@ BluetoothDaemonInterface::GetRemoteDeviceProperty(
const nsAString& aRemoteAddr, const nsAString& aName,
BluetoothResultHandler* aRes)
{
static_cast<BluetoothDaemonCoreModule*>
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
(mProtocol)->GetRemoteDevicePropertyCmd(aRemoteAddr, aName, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -2258,8 +2293,11 @@ BluetoothDaemonInterface::SetRemoteDeviceProperty(
const nsAString& aRemoteAddr, const BluetoothNamedValue& aProperty,
BluetoothResultHandler* aRes)
{
static_cast<BluetoothDaemonCoreModule*>
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
(mProtocol)->SetRemoteDevicePropertyCmd(aRemoteAddr, aProperty, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
/* Remote Services */
@ -2269,16 +2307,22 @@ BluetoothDaemonInterface::GetRemoteServiceRecord(const nsAString& aRemoteAddr,
const uint8_t aUuid[16],
BluetoothResultHandler* aRes)
{
static_cast<BluetoothDaemonCoreModule*>(
mProtocol)->GetRemoteServiceRecordCmd(aRemoteAddr, aUuid, aRes);
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
(mProtocol)->GetRemoteServiceRecordCmd(aRemoteAddr, aUuid, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
BluetoothDaemonInterface::GetRemoteServices(const nsAString& aRemoteAddr,
BluetoothResultHandler* aRes)
{
static_cast<BluetoothDaemonCoreModule*>(
mProtocol)->GetRemoteServicesCmd(aRemoteAddr, aRes);
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
(mProtocol)->GetRemoteServicesCmd(aRemoteAddr, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
/* Discovery */
@ -2286,14 +2330,21 @@ BluetoothDaemonInterface::GetRemoteServices(const nsAString& aRemoteAddr,
void
BluetoothDaemonInterface::StartDiscovery(BluetoothResultHandler* aRes)
{
static_cast<BluetoothDaemonCoreModule*>(mProtocol)->StartDiscoveryCmd(aRes);
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
(mProtocol)->StartDiscoveryCmd(aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
BluetoothDaemonInterface::CancelDiscovery(BluetoothResultHandler* aRes)
{
static_cast<BluetoothDaemonCoreModule*>
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
(mProtocol)->CancelDiscoveryCmd(aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
/* Bonds */
@ -2303,24 +2354,33 @@ BluetoothDaemonInterface::CreateBond(const nsAString& aBdAddr,
BluetoothTransport aTransport,
BluetoothResultHandler* aRes)
{
static_cast<BluetoothDaemonCoreModule*>
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
(mProtocol)->CreateBondCmd(aBdAddr, aTransport, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
BluetoothDaemonInterface::RemoveBond(const nsAString& aBdAddr,
BluetoothResultHandler* aRes)
{
static_cast<BluetoothDaemonCoreModule*>
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
(mProtocol)->RemoveBondCmd(aBdAddr, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
BluetoothDaemonInterface::CancelBond(const nsAString& aBdAddr,
BluetoothResultHandler* aRes)
{
static_cast<BluetoothDaemonCoreModule*>
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
(mProtocol)->CancelBondCmd(aBdAddr, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
/* Connection */
@ -2339,8 +2399,11 @@ BluetoothDaemonInterface::PinReply(const nsAString& aBdAddr, bool aAccept,
const nsAString& aPinCode,
BluetoothResultHandler* aRes)
{
static_cast<BluetoothDaemonCoreModule*>
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
(mProtocol)->PinReplyCmd(aBdAddr, aAccept, aPinCode, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -2349,8 +2412,11 @@ BluetoothDaemonInterface::SspReply(const nsAString& aBdAddr,
bool aAccept, uint32_t aPasskey,
BluetoothResultHandler* aRes)
{
static_cast<BluetoothDaemonCoreModule*>
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
(mProtocol)->SspReplyCmd(aBdAddr, aVariant, aAccept, aPasskey, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
/* DUT Mode */
@ -2359,8 +2425,11 @@ void
BluetoothDaemonInterface::DutModeConfigure(bool aEnable,
BluetoothResultHandler* aRes)
{
static_cast<BluetoothDaemonCoreModule*>
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
(mProtocol)->DutModeConfigureCmd(aEnable, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -2368,8 +2437,11 @@ BluetoothDaemonInterface::DutModeSend(uint16_t aOpcode, uint8_t* aBuf,
uint8_t aLen,
BluetoothResultHandler* aRes)
{
static_cast<BluetoothDaemonCoreModule*>
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
(mProtocol)->DutModeSendCmd(aOpcode, aBuf, aLen, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
/* LE Mode */
@ -2379,8 +2451,11 @@ BluetoothDaemonInterface::LeTestMode(uint16_t aOpcode, uint8_t* aBuf,
uint8_t aLen,
BluetoothResultHandler* aRes)
{
static_cast<BluetoothDaemonCoreModule*>
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
(mProtocol)->LeTestModeCmd(aOpcode, aBuf, aLen, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
/* Energy Information */
@ -2401,6 +2476,18 @@ BluetoothDaemonInterface::DispatchError(BluetoothResultHandler* aRes,
ConstantInitOp1<BluetoothStatus>(aStatus));
}
void
BluetoothDaemonInterface::DispatchError(BluetoothResultHandler* aRes,
nsresult aRv)
{
BluetoothStatus status;
if (NS_WARN_IF(NS_FAILED(Convert(aRv, status)))) {
status = STATUS_FAIL;
}
DispatchError(aRes, status);
}
// Profile Interfaces
//

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

@ -135,6 +135,7 @@ protected:
private:
void DispatchError(BluetoothResultHandler* aRes, BluetoothStatus aStatus);
void DispatchError(BluetoothResultHandler* aRes, nsresult aRv);
nsCString mListenSocketName;
nsRefPtr<BluetoothDaemonListenSocket> mListenSocket;

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

@ -315,8 +315,11 @@ BluetoothDaemonSocketInterface::Listen(BluetoothSocketType aType,
{
MOZ_ASSERT(mModule);
mModule->ListenCmd(aType, aServiceName, aServiceUuid, aChannel,
aEncrypt, aAuth, aRes);
nsresult rv = mModule->ListenCmd(aType, aServiceName, aServiceUuid,
aChannel, aEncrypt, aAuth, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -329,7 +332,11 @@ BluetoothDaemonSocketInterface::Connect(const nsAString& aBdAddr,
{
MOZ_ASSERT(mModule);
mModule->ConnectCmd(aBdAddr, aType, aUuid, aChannel, aEncrypt, aAuth, aRes);
nsresult rv = mModule->ConnectCmd(aBdAddr, aType, aUuid, aChannel,
aEncrypt, aAuth, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -338,7 +345,10 @@ BluetoothDaemonSocketInterface::Accept(int aFd,
{
MOZ_ASSERT(mModule);
mModule->AcceptCmd(aFd, aRes);
nsresult rv = mModule->AcceptCmd(aFd, aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
@ -346,7 +356,32 @@ BluetoothDaemonSocketInterface::Close(BluetoothSocketResultHandler* aRes)
{
MOZ_ASSERT(mModule);
mModule->CloseCmd(aRes);
nsresult rv = mModule->CloseCmd(aRes);
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
void
BluetoothDaemonSocketInterface::DispatchError(
BluetoothSocketResultHandler* aRes, BluetoothStatus aStatus)
{
BluetoothResultRunnable1<BluetoothSocketResultHandler, void,
BluetoothStatus, BluetoothStatus>::Dispatch(
aRes, &BluetoothSocketResultHandler::OnError,
ConstantInitOp1<BluetoothStatus>(aStatus));
}
void
BluetoothDaemonSocketInterface::DispatchError(
BluetoothSocketResultHandler* aRes, nsresult aRv)
{
BluetoothStatus status;
if (NS_WARN_IF(NS_FAILED(Convert(aRv, status)))) {
status = STATUS_FAIL;
}
DispatchError(aRes, status);
}
END_BLUETOOTH_NAMESPACE

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

@ -113,6 +113,10 @@ public:
void Close(BluetoothSocketResultHandler* aRes);
private:
void DispatchError(BluetoothSocketResultHandler* aRes,
BluetoothStatus aStatus);
void DispatchError(BluetoothSocketResultHandler* aRes, nsresult aRv);
BluetoothDaemonSocketModule* mModule;
};

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

@ -310,7 +310,8 @@ public:
BT_LOGR("BluetoothInterface::Disable failed: %d", aStatus);
BluetoothService::AcknowledgeToggleBt(true);
// Always make progress; even on failures
BluetoothService::AcknowledgeToggleBt(false);
}
};

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

@ -432,6 +432,9 @@ public:
void OnError(BluetoothStatus aStatus) MOZ_OVERRIDE
{
BT_WARNING("BluetoothHandsfreeInterface::Cleanup failed: %d", (int)aStatus);
sBluetoothHfpInterface = nullptr;
if (mRes) {
mRes->OnError(NS_ERROR_FAILURE);
}

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

@ -10,6 +10,7 @@ if CONFIG['MOZ_B2G_BT']:
'BluetoothDevice.cpp',
'BluetoothHidManager.cpp',
'BluetoothInterface.cpp',
'BluetoothInterfaceHelpers.cpp',
'BluetoothManager.cpp',
'BluetoothProfileController.cpp',
'BluetoothPropertyContainer.cpp',

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

@ -0,0 +1,35 @@
---
# For complete sample of all build and test jobs,
# see <gecko>/testing/taskcluster/tasks/job_flags.yml
$inherits:
from: tasks/branches/base_job_flags.yml
builds:
flame-kk:
platforms:
- b2g
types:
opt:
task: tasks/builds/b2g_flame_kk_opt.yml
flame-kk-eng:
platforms:
- b2g
types:
opt:
task: tasks/builds/b2g_flame_kk_eng.yml
tests:
gaia-build:
allowed_build_tasks:
tasks/builds/b2g_flame_kk_opt.yml:
task: tasks/tests/b2g_build_test.yml
tasks/builds/b2g_flame_kk_eng.yml:
task: tasks/tests/b2g_build_test.yml
gaia-linter:
allowed_build_tasks:
tasks/builds/b2g_flame_kk_opt.yml:
task: tasks/tests/b2g_linter.yml
tasks/builds/b2g_flame_kk_eng.yml:
task: tasks/tests/b2g_linter.yml

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

@ -0,0 +1,35 @@
---
# For complete sample of all build and test jobs,
# see <gecko>/testing/taskcluster/tasks/job_flags.yml
$inherits:
from: tasks/branches/base_job_flags.yml
builds:
flame-kk:
platforms:
- b2g
types:
opt:
task: tasks/builds/b2g_flame_kk_opt.yml
flame-kk-eng:
platforms:
- b2g
types:
opt:
task: tasks/builds/b2g_flame_kk_eng.yml
tests:
gaia-build:
allowed_build_tasks:
tasks/builds/b2g_flame_kk_opt.yml:
task: tasks/tests/b2g_build_test.yml
tasks/builds/b2g_flame_kk_eng.yml:
task: tasks/tests/b2g_build_test.yml
gaia-linter:
allowed_build_tasks:
tasks/builds/b2g_flame_kk_opt.yml:
task: tasks/tests/b2g_linter.yml
tasks/builds/b2g_flame_kk_eng.yml:
task: tasks/tests/b2g_linter.yml