summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2022-01-20 13:30:47 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-01-24 11:00:33 +0000
commitb7531ea9ffc57d2647c1c35d1cb222b8b2dfb3c6 (patch)
treefd9fa594f78b0654091d098fad34d531276970d5 /src
parentf43bb5860f860331e6b732036ef231e600fe81aa (diff)
Android: fix signal order during service discovery
Android implementation uses timers to check for services with a delay. At some point it could lead to a state, when all discovered devices are handled, but the timers for service discoveries were still active. Before the patch, a finished() signal was emitted in such case, and later, when the timer expires, the services got populated and we received a serviceDiscovered() signal. With this patch, we do not emit a finished() signal when the timers are still pending. Instead the signal is emitted from the slot (which was done anyway). Change-Id: I55485ed842ff45f8aedfdca92b3fb1ee0adbae37 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi> (cherry picked from commit c24a04ba4beb719ed423f69f80850d0bea5903b9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent_android.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp b/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp
index 2b77390a..8947dc0c 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp
+++ b/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp
@@ -274,9 +274,10 @@ void QBluetoothServiceDiscoveryAgentPrivate::_q_processFetchedUuids(
Q_Q(QBluetoothServiceDiscoveryAgent);
QTimer::singleShot(4000, q, [this]() {
this->_q_fetchUuidsTimeout();
- });
+ }); // will also call _q_seriveDiscoveryFinished()
+ } else {
+ _q_serviceDiscoveryFinished();
}
- _q_serviceDiscoveryFinished();
return;
}