summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp
diff options
context:
space:
mode:
authorBogDan Vatra <bogdan@kde.org>2019-04-04 14:26:04 +0300
committerBogDan Vatra <bogdan@kdab.com>2019-04-05 06:37:39 +0000
commitc161203b5dd91ace4b14d46542c49115e8de8d92 (patch)
treef1079cf99cf6907835b482606ff742116cd55a5f /src/bluetooth/qbluetoothservicediscoveryagent_android.cpp
parent38bb5bae0a05407ec180a140c00231a39ef23cd2 (diff)
Check the reverted UUID when filtering
Change-Id: Idb12d3bb116d6c5b34f1ca145f473b118b58d5ee Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/bluetooth/qbluetoothservicediscoveryagent_android.cpp')
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent_android.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp b/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp
index ddc53421..e607a27e 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp
+++ b/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp
@@ -47,6 +47,7 @@
#include <QtBluetooth/QBluetoothServiceDiscoveryAgent>
#include "qbluetoothservicediscoveryagent_p.h"
+#include "qbluetoothsocket_android_p.h"
#include "android/servicediscoverybroadcastreceiver_p.h"
#include "android/localdevicebroadcastreceiver_p.h"
@@ -449,8 +450,11 @@ void QBluetoothServiceDiscoveryAgentPrivate::populateDiscoveredServices(const QB
//Check if the service is in the uuidFilter
if (!uuidFilter.isEmpty()) {
bool match = uuidFilter.contains(serviceInfo.serviceUuid());
- for (const auto &uuid : qAsConst(uuidFilter))
+ match |= uuidFilter.contains(QBluetoothSocketPrivateAndroid::reverseUuid(serviceInfo.serviceUuid()));
+ for (const auto &uuid : qAsConst(uuidFilter)) {
match |= serviceInfo.serviceClassUuids().contains(uuid);
+ match |= serviceInfo.serviceClassUuids().contains(QBluetoothSocketPrivateAndroid::reverseUuid(uuid));
+ }
if (!match)
continue;