summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Rustler <peter.rustler@basyskom.com>2015-05-06 15:13:54 +0200
committerAlex Blasche <alexander.blasche@theqtcompany.com>2015-05-08 07:18:07 +0000
commite686b22a119c53f8ea4abc1a96f0fb15e37277fe (patch)
tree11af31e92872192f7830eaaf90c4c936c1473a5e
parent61341e08b0771f76c6c71957a4924254bbee5890 (diff)
Bugfix Andoid Bluetooth coreConfiguration data in discoveredDevices
In current implementation of processDiscoveredDevices, if we receive the same device again with different coreConfiguration, the device will be just replaced. In Android there are 2 ways to scan for bluetooth devices. One is the scan for all bluetooth devices (including LE) and one for scanning just LE devices. Currently they are used both, which means we receive dual devices multiple times. Depending of the arrival in time of the QBluetoothDeviceInfo the coreConfiguration is different. In the List of discovered devices this lead to devices reported as LE only or classic only which is wrong. If the Application calls discoveredDevices() it will get a list with wrong coreConfiguration. This patch update the coreConfiguration of the QBluetoothDeviceInfo in list. Change-Id: I312544ca513503c5d6b31a1ca0cfbe530c0be911 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp
index 9d3387ec..a6aaaf03 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp
@@ -228,8 +228,8 @@ void QBluetoothDeviceDiscoveryAgentPrivate::processDiscoveredDevices(
return;
}
- // same device found -> avoid duplicates and update info in place
- discoveredDevices.replace(i, info);
+ // same device found -> avoid duplicates and update core configuration
+ discoveredDevices[i].setCoreConfigurations(discoveredDevices[i].coreConfigurations() | info.coreConfigurations());
emit q->deviceDiscovered(info);
return;