BlueZ: treat AuthenticationCanceled as a PairingError
... when it is not triggered from our side.
The linked Jira ticket, as well as some searches over the internet,
show that some devices report org.bluez.Error.AuthenticationCanceled
error when the authentication fails, not when it is canceled.
At the same time, it is also possible to get this error code by trying
to pair with the device, and then immideately cancelling the pairing,
like this:
QBluetoothLocalDevice dev;
dev.requestPairing(address, QBluetoothLocalDevice::Paired);
dev.requestPairing(address, QBluetoothLocalDevice::Unpaired);
The pre-existing code was only considering the latter usecase, and so
was not reporting AuthenticationCanceled as a PairingError.
This patch introduces an extra flag to check if the pairing was canceled
from our side. If that's the case - the old behavior is preserved, and
we do not report an error. In other cases, a PairingError is reported.
Fixes: QTBUG-118895
Pick-to: 6.6 6.5
Change-Id: I1fe246eb8a0da6efb62eddc9a843de7be0f7b2c5
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>