mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1227440 - Reject pin reply by cancelling bond to trigger BondStateChangedNotification, in order to inform gaia setting app, r=shuang
This commit is contained in:
parent
5f2dd66ef8
commit
d77d11887e
@ -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
|
||||
|
@ -20,6 +20,7 @@ class BluetoothServiceBluedroid
|
||||
, public BluetoothCoreNotificationHandler
|
||||
, public BluetoothNotificationHandler
|
||||
{
|
||||
class CancelBondResultHandler;
|
||||
class CleanupResultHandler;
|
||||
class DisableResultHandler;
|
||||
class DispatchReplyErrorResultHandler;
|
||||
|
Loading…
Reference in New Issue
Block a user