summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@theqtcompany.com>2016-04-13 09:09:24 +0200
committerAlex Blasche <alexander.blasche@theqtcompany.com>2016-04-13 07:45:44 +0000
commit20b0a09547131cf0d01f7373735c4382843461bd (patch)
tree759a0c1389ce7f363e77c273db10b5511dd568ed /src
parentb869626b9dce9b258149b109a57684c0b0e08954 (diff)
Android: Ensure Bluetooth device discovery finds remote devices
Since Android 6.0 Bluetooth device discovery requires new permissions (ACCESS_FINE_LOCATION or ACCESS_COURSE_LOCATION). Otherwise non-BTLE devices will no show up anymore. This patch adds the required permissions to QtBLuetooth. For details see http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-hardware-id Task-number: QTBUG-52530 Change-Id: I7b64ab57c5c9ee2e08308eaa58d33708c5e31244 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/bluetooth/bluetooth.pro3
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent.cpp2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/bluetooth/bluetooth.pro b/src/bluetooth/bluetooth.pro
index 6fc19ef0..359ecf4a 100644
--- a/src/bluetooth/bluetooth.pro
+++ b/src/bluetooth/bluetooth.pro
@@ -102,7 +102,8 @@ config_bluez:qtHaveModule(dbus) {
ANDROID_PERMISSIONS = \
android.permission.BLUETOOTH \
- android.permission.BLUETOOTH_ADMIN
+ android.permission.BLUETOOTH_ADMIN \
+ android.permission.ACCESS_COARSE_LOCATION # since Android 6.0 (API lvl 23)
ANDROID_BUNDLED_JAR_DEPENDENCIES = \
jar/QtAndroidBluetooth-bundled.jar:org.qtproject.qt5.android.bluetooth.QtBluetoothBroadcastReceiver
ANDROID_JAR_DEPENDENCIES = \
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent.cpp
index 073146bc..1dbe26b3 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent.cpp
@@ -64,6 +64,8 @@ QT_BEGIN_NAMESPACE
of devices. However not every platform can detect both types of devices.
On platforms with this limitation (for example iOS only suports Low Energy discovery),
the discovery process will limit the search to the type which is supported.
+
+ \note Since Android 6.0 the ability to detect devices requires ACCESS_COURSE_LOCATION.
*/
/*!