summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bluetooth/qlowenergycontroller_android.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bluetooth/qlowenergycontroller_android.cpp b/src/bluetooth/qlowenergycontroller_android.cpp
index fd4ea753..cb08b6f9 100644
--- a/src/bluetooth/qlowenergycontroller_android.cpp
+++ b/src/bluetooth/qlowenergycontroller_android.cpp
@@ -326,6 +326,14 @@ void QLowEnergyControllerPrivate::connectionUpdated(
if (newState == QLowEnergyController::UnconnectedState
&& !(oldState == QLowEnergyController::UnconnectedState
|| oldState == QLowEnergyController::ConnectingState)) {
+
+ // Invalidate the services if the disconnect came from the remote end.
+ // Qtherwise we disconnected via QLowEnergyController::disconnectDevice() which
+ // triggered invalidation already
+ if (!serviceList.isEmpty()) {
+ Q_ASSERT(oldState != QLowEnergyController::ClosingState);
+ invalidateServices();
+ }
emit q->disconnected();
} else if (newState == QLowEnergyController::ConnectedState
&& oldState != QLowEnergyController::ConnectedState ) {