summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/android/localdevicebroadcastreceiver.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-09-17 03:05:58 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-09-17 03:06:04 +0200
commit125dbf5e1e1b927330f6f20973b0d2437ad4aa47 (patch)
tree62815c855ff4060fa02bdebaf60272a5eeca886e /src/bluetooth/android/localdevicebroadcastreceiver.cpp
parent75bb24bf9efc771d8462a3ee69ace6b398f8515f (diff)
parent434f713defbbe060207fd6b690e802ad1fa6c5bb (diff)
Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"
Diffstat (limited to 'src/bluetooth/android/localdevicebroadcastreceiver.cpp')
-rw-r--r--src/bluetooth/android/localdevicebroadcastreceiver.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/bluetooth/android/localdevicebroadcastreceiver.cpp b/src/bluetooth/android/localdevicebroadcastreceiver.cpp
index e3b01987..78aecc12 100644
--- a/src/bluetooth/android/localdevicebroadcastreceiver.cpp
+++ b/src/bluetooth/android/localdevicebroadcastreceiver.cpp
@@ -189,6 +189,14 @@ void LocalDeviceBroadcastReceiver::onReceive(JNIEnv *env, jobject context, jobje
return;
case 0: //BluetoothDevice.PAIRING_VARIANT_PIN
{
+ qCDebug(QT_BT_ANDROID) << "Pairing : PAIRING_VARIANT_PIN -> use Android default handling";
+
+ // The section below is disabled because this Android pairing variant
+ // requires the user to enter a pin. Since QBluetoothLocalDevice does
+ // not have a setPin() equivalent which might be used to return the user's value.
+ // For now we ignore this request. If an app ignores such requests,
+ // Android shows a "fall-back" pin code entry form.
+ /*
//generate a random key
const QString pin = QStringLiteral("%1").arg(QRandomGenerator::global()->bounded(1000000),
6, 10, QLatin1Char('0'));
@@ -225,10 +233,12 @@ void LocalDeviceBroadcastReceiver::onReceive(JNIEnv *env, jobject context, jobje
}
const QBluetoothAddress address(bluetoothDevice.callObjectMethod<jstring>("getAddress").toString());
- emit pairingDisplayPinCode(address, pin);
+ emit pairingDisplayPinCode(address, pin);*/
+ break;
}
case 2: //BluetoothDevice.PAIRING_VARIANT_PASSKEY_CONFIRMATION
{
+ qCDebug(QT_BT_ANDROID) << "Pairing : PAIRING_VARIANT_PASSKEY_CONFIRMATION";
keyExtra = valueForStaticField(JavaNames::BluetoothDevice,
JavaNames::ExtraPairingKey);
key = intentObject.callMethod<jint>("getIntExtra",