summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp')
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp
index e76ddff7..303dd67f 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp
@@ -165,7 +165,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::start(QBluetoothDeviceDiscoveryAgent
{
qCWarning(QT_BT_ANDROID) << "Search not possible due to missing permission (ACCESS_COARSE_LOCATION)";
lastError = QBluetoothDeviceDiscoveryAgent::UnknownError;
- errorString = QBluetoothDeviceDiscoveryAgent::tr("Missing Location permission. Search is not possible");
+ errorString = QBluetoothDeviceDiscoveryAgent::tr("Missing Location permission. Search is not possible.");
emit q->error(lastError);
return;
}
@@ -225,6 +225,9 @@ void QBluetoothDeviceDiscoveryAgentPrivate::stop()
return;
if (m_active == SDPScanActive) {
+ if (pendingCancel)
+ return;
+
pendingCancel = true;
pendingStart = false;
bool success = adapter.callMethod<jboolean>("cancelDiscovery");
@@ -304,7 +307,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::processDiscoveredDevices(
for (int i = 0; i < discoveredDevices.size(); i++) {
if (discoveredDevices[i].address() == info.address()) {
- if (discoveredDevices[i] == info) {
+ if (discoveredDevices[i] == info && lowEnergySearchTimeout > 0) {
qCDebug(QT_BT_ANDROID) << "Duplicate: " << info.address()
<< "isLeScanResult:" << isLeResult;
return;