summaryrefslogtreecommitdiffstats
path: root/src/android
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2017-01-10 18:04:51 +0400
committerAlex Blasche <alexander.blasche@qt.io>2017-01-16 07:54:19 +0000
commitdcd89c6268f11c50a0833c41e5ab065aceb3c05f (patch)
tree4e30b1b3af9ae019839ef4968987fa3175f04b0a /src/android
parent8690dd6d59831206736b3a7839d8d3fd14251362 (diff)
[REG] LE/Android: report ServiceDiscovered for an empty services as well
a regression has been introduced by the service discoverer refactoring, causing an empty service to stuck in DiscoveringServices state for ever Change-Id: I1d339279e77f5409231d5fbd3677f9e2eb98a0a8 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/android')
-rw-r--r--src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java b/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java
index b375f00e..5c336dc0 100644
--- a/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java
+++ b/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java
@@ -844,6 +844,12 @@ public class QtBluetoothLE {
GattEntry serviceEntry = entries.get(serviceHandle);
final int endHandle = serviceEntry.endHandle;
+ if (serviceHandle == endHandle) {
+ Log.w(TAG, "scheduleServiceDetailDiscovery: service is empty; nothing to discover");
+ finishCurrentServiceDiscovery(serviceHandle);
+ return;
+ }
+
synchronized (readWriteQueue) {
// entire block inside mutex to ensure all service discovery jobs go in one after the other
// ensures that serviceDiscovered() signal is sent when required