diff options
author | Juha Vuolle <juha.vuolle@insta.fi> | 2022-05-13 12:38:01 +0300 |
---|---|---|
committer | Juha Vuolle <juha.vuolle@insta.fi> | 2022-05-17 10:20:14 +0300 |
commit | 4fa0a78d6a46b58cf5bdfa505aaa247dcda4d9e4 (patch) | |
tree | 6ea6fe5c35bc5cd081e525dce813c752a2c1017a /tests | |
parent | 320921cf118d5c5bd64361b5e79c6602cec9c4d4 (diff) |
Android bluetooth local device always to use "Paired"
QBluetoothLocalDevice on Android doesn't distinguish between
"AuthorizedPaired" and "Paired" but regresses to "Paired".
This commit changes one place where the code echoes back whatever
pairing mode the user requested, instead of "Paired". This caused
the sent pairingFinished() signal to have different value than
what a call to pairingStatus() gives.
In addition this commit fixes the related autotest when run in "manual
mode" ie. the BT_TEST_DEVICE and live counterpart device is used.
Task-number: QTBUG-102874
Change-Id: I24c76b03ad1d0b27b8afeaf94f146393e4547712
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qbluetoothlocaldevice/tst_qbluetoothlocaldevice.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/auto/qbluetoothlocaldevice/tst_qbluetoothlocaldevice.cpp b/tests/auto/qbluetoothlocaldevice/tst_qbluetoothlocaldevice.cpp index 7e63007f..81d99d55 100644 --- a/tests/auto/qbluetoothlocaldevice/tst_qbluetoothlocaldevice.cpp +++ b/tests/auto/qbluetoothlocaldevice/tst_qbluetoothlocaldevice.cpp @@ -423,7 +423,13 @@ void tst_QBluetoothLocalDevice::tst_pairDevice() // Verify that the local device pairing status and the signal value match QCOMPARE(pairingResult, localDevice.pairingStatus(deviceAddress)); #ifndef Q_OS_WIN - // On Windows the resulting pairing mode may differ from test's "expected" + // On Windows the resulting pairing mode may differ from test's "expected" as the + // decision is up to Windows. +#ifdef Q_OS_ANDROID + // On Android we always use "Paired" + if (pairingExpected == QBluetoothLocalDevice::AuthorizedPaired) + pairingExpected = QBluetoothLocalDevice::Paired; +#endif QCOMPARE(pairingResult, pairingExpected); QCOMPARE(localDevice.pairingStatus(deviceAddress), pairingExpected); #endif |