diff options
author | Alex Blasche <alexander.blasche@theqtcompany.com> | 2016-06-03 10:09:38 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2016-06-06 05:40:04 +0000 |
commit | 3e4236996d0d961bb91d30eff10e9b2aa8b7d4a7 (patch) | |
tree | 30498f9523d137f2e1aa509c5db8380d394dbbf3 /src | |
parent | c347a3748af663da9e8e6ce5e233248b80217f96 (diff) |
BlueZ4: Don't process stop discovery notification in unready state
Multiple device discovery agents can influence each other as they
monitor the same DBus BlueZ adapter. When one agent started
and another just stopped/finished the discovery process, the newly
started agent is caught in an unprepared state.
The other use case where this might happen is when one agent stopped
the discovery and another agent goes through the same start/stop cycle
in very quick order, then the first agent may still have pending signals
despiter adapter being deleted.
In any case this patch simply ensures that an already inactive
agent doesn't go through the finishing process again.
Task-number: QTBUG-51307
Change-Id: If0e2b944f1ceadb9037179c4fde2f3f79741d0a5
Reviewed-by: dmnikola <dmitry.nikolaev@theqtcompany.com>
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp index 47323e85..7ff57adf 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp @@ -432,6 +432,10 @@ void QBluetoothDeviceDiscoveryAgentPrivate::_q_propertyChanged(const QString &na pendingCancel = false; start(); } else { + // happens when agent is created while other agent called StopDiscovery() + if (!adapter) + return; + if (useExtendedDiscovery) { useExtendedDiscovery = false; /* We don't use the Start/StopDiscovery combo here |