merge b2g-inbound to mozilla-central a=merge

This commit is contained in:
Carsten "Tomcat" Book 2015-11-26 16:50:50 +01:00
commit ed5b6f739a
2 changed files with 31 additions and 2 deletions

View File

@ -1268,6 +1268,28 @@ private:
BluetoothReplyRunnable* mRunnable;
};
class BluetoothServiceBluedroid::CancelBondResultHandler final
: public BluetoothCoreResultHandler
{
public:
CancelBondResultHandler(BluetoothReplyRunnable* aRunnable)
: mRunnable(aRunnable)
{ }
void CancelBond() override
{
DispatchReplySuccess(mRunnable);
}
void OnError(BluetoothStatus aStatus) override
{
DispatchReplyError(mRunnable, aStatus);
}
private:
BluetoothReplyRunnable* mRunnable;
};
void
BluetoothServiceBluedroid::PinReplyInternal(
const BluetoothAddress& aDeviceAddress, bool aAccept,
@ -1277,8 +1299,14 @@ BluetoothServiceBluedroid::PinReplyInternal(
ENSURE_BLUETOOTH_IS_ENABLED_VOID(aRunnable);
sBtCoreInterface->PinReply(aDeviceAddress, aAccept, aPinCode,
new PinReplyResultHandler(aRunnable));
if (aAccept) {
sBtCoreInterface->PinReply(aDeviceAddress, aAccept, aPinCode,
new PinReplyResultHandler(aRunnable));
} else {
// Call CancelBond to trigger BondStateChangedNotification
sBtCoreInterface->CancelBond(aDeviceAddress,
new CancelBondResultHandler(aRunnable));
}
}
void

View File

@ -20,6 +20,7 @@ class BluetoothServiceBluedroid
, public BluetoothCoreNotificationHandler
, public BluetoothNotificationHandler
{
class CancelBondResultHandler;
class CleanupResultHandler;
class DisableResultHandler;
class DispatchReplyErrorResultHandler;