diff options
author | Alex Blasche <alexander.blasche@qt.io> | 2018-09-25 11:02:52 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@qt.io> | 2018-09-26 06:21:30 +0000 |
commit | a48a19d9db855973f7f0d89ca0759fd7f6856f55 (patch) | |
tree | a8587029325ab476fbda491039fcac06612738cd | |
parent | f8c0572ddcd0cf152cfcf9f1d5478e520a6a457e (diff) |
Don't trigger passkey pairing notification if remote device is unknown
The device address is essential for proper processing of
pairingDisplayConfirmation() signal on Android. If it is not available
abort immediately. This brings the passkey pairing code in line with
pincode pairing.
Change-Id: I174a2478d48463c58ba937e71ced377d45892f1a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
-rw-r--r-- | src/bluetooth/android/localdevicebroadcastreceiver.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/bluetooth/android/localdevicebroadcastreceiver.cpp b/src/bluetooth/android/localdevicebroadcastreceiver.cpp index 2d247574..e3b01987 100644 --- a/src/bluetooth/android/localdevicebroadcastreceiver.cpp +++ b/src/bluetooth/android/localdevicebroadcastreceiver.cpp @@ -244,6 +244,9 @@ void LocalDeviceBroadcastReceiver::onReceive(JNIEnv *env, jobject context, jobje "(Ljava/lang/String;)Landroid/os/Parcelable;", keyExtra.object<jstring>()); + if (!bluetoothDevice.isValid()) + return; + //we need to keep a reference around in case the user confirms later on pairingDevice = bluetoothDevice; |