diff options
-rw-r--r-- | src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp | 6 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp | 14 |
2 files changed, 12 insertions, 8 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp index 443be14d..ce3b8f10 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp @@ -150,10 +150,8 @@ void QBluetoothDeviceDiscoveryAgentPrivate::start(QBluetoothDeviceDiscoveryAgent } // check Android v23+ permissions - // -> BTLE search requires android.permission.ACCESS_COARSE_LOCATION or android.permission.ACCESS_FINE_LOCATION - if (requestedMethods & QBluetoothDeviceDiscoveryAgent::LowEnergyMethod - && QtAndroid::androidSdkVersion() >= 23) - { + // -> any device search requires android.permission.ACCESS_COARSE_LOCATION or android.permission.ACCESS_FINE_LOCATION + if (QtAndroid::androidSdkVersion() >= 23) { const QString coarsePermission(QLatin1String("android.permission.ACCESS_COARSE_LOCATION")); const QString finePermission(QLatin1String("android.permission.ACCESS_FINE_LOCATION")); diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp index ae8e9184..30aa3fcc 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp @@ -440,8 +440,11 @@ void QWinRTBluetoothDeviceDiscoveryWorker::classicBluetoothInfoFromDeviceIdAsync hr = deviceFromIdOperation->put_Completed(Callback<IAsyncOperationCompletedHandler<BluetoothDevice *>> ([thisPointer](IAsyncOperation<BluetoothDevice *> *op, AsyncStatus status) { - if (status == Completed && thisPointer) - thisPointer->onPairedClassicBluetoothDeviceFoundAsync(op, status); + if (thisPointer) { + if (status == Completed) + thisPointer->onPairedClassicBluetoothDeviceFoundAsync(op, status); + --thisPointer->m_pendingPairedDevices; + } return S_OK; }).Get()); if (FAILED(hr)) { @@ -474,8 +477,11 @@ void QWinRTBluetoothDeviceDiscoveryWorker::leBluetoothInfoFromDeviceIdAsync(HSTR hr = deviceFromIdOperation->put_Completed(Callback<IAsyncOperationCompletedHandler<BluetoothLEDevice *>> ([thisPointer] (IAsyncOperation<BluetoothLEDevice *> *op, AsyncStatus status) { - if (status == Completed && thisPointer) - thisPointer->onPairedBluetoothLEDeviceFoundAsync(op, status); + if (thisPointer) { + if (status == Completed) + thisPointer->onPairedBluetoothLEDeviceFoundAsync(op, status); + --thisPointer->m_pendingPairedDevices; + } return S_OK; }).Get()); if (FAILED(hr)) { |