Bug 941462 - Reply internal error code when getting I/O error from BlueZ, r=gyeh

This commit is contained in:
Shawn Huang 2013-12-12 19:37:42 +08:00
parent e6d324a042
commit c533d73a07
2 changed files with 11 additions and 0 deletions

View File

@ -108,6 +108,9 @@ extern bool gBluetoothDebugFlag;
#define BLUETOOTH_ADDRESS_NONE "00:00:00:00:00:00"
#define BLUETOOTH_ADDRESS_BYTES 6
// Bluetooth stack internal error, such as I/O error
#define ERR_INTERNAL_ERROR "InternalError"
BEGIN_BLUETOOTH_NAMESPACE
enum BluetoothSocketType {

View File

@ -497,6 +497,14 @@ RunDBusCallback(DBusMessage* aMsg, void* aBluetoothReplyRunnable,
nsAutoString replyError;
BluetoothValue v;
aFunc(aMsg, nullptr, v, replyError);
// Bug 941462. When blueZ replys 'I/O error', we treat it as 'internal error'.
// This usually happned when the first pairing request has not yet finished,
// the second pairing request issued immediately.
if (replyError.EqualsLiteral("I/O error")) {
replyError.AssignLiteral(ERR_INTERNAL_ERROR);
}
DispatchBluetoothReply(replyRunnable, v, replyError);
}