diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-08-18 03:00:07 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-08-18 03:00:07 +0200 |
commit | 05cad85003f5bdb15834fe4eb651fdcc57874364 (patch) | |
tree | ebcc7c4af8669c14411de32b3780d15793ea2b48 /src | |
parent | 0f930cddefe386c6b6f65b8b11342c9e76876a9b (diff) | |
parent | 72a48c7d108e1f3faaab0a03c6d2a6ead16d2bcc (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I3ea075969f9a9b8e94a34b3c7cd92aaea72175af
Diffstat (limited to 'src')
-rw-r--r-- | src/bluetooth/qbluetoothservicediscoveryagent_android.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp b/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp index 63601058..d1e6b4e4 100644 --- a/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp +++ b/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp @@ -393,10 +393,6 @@ void QBluetoothServiceDiscoveryAgentPrivate::populateDiscoveredServices(const QB serviceInfo.setServiceUuid(uuids.at(i)); } - //Check if the UUID is in the uuidFilter - if (!uuidFilter.isEmpty() && !uuidFilter.contains(serviceInfo.serviceUuid())) - continue; - serviceInfo.setAttribute(QBluetoothServiceInfo::ProtocolDescriptorList, protocolDescriptorList); serviceInfo.setAttribute(QBluetoothServiceInfo::BrowseGroupList, QBluetoothUuid(QBluetoothUuid::PublicBrowseGroup)); @@ -411,6 +407,16 @@ void QBluetoothServiceDiscoveryAgentPrivate::populateDiscoveredServices(const QB serviceInfo.setServiceName(QBluetoothUuid::serviceClassToString(clsId)); } + //Check if the service is in the uuidFilter + if (!uuidFilter.isEmpty()) { + bool match = uuidFilter.contains(serviceInfo.serviceUuid()); + for (const auto &uuid : qAsConst(uuidFilter)) + match |= serviceInfo.serviceClassUuids().contains(uuid); + + if (!match) + continue; + } + //don't include the service if we already discovered it before if (!isDuplicatedService(serviceInfo)) { discoveredServices << serviceInfo; |