Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-88638

”Location service”-error when calling QBluetoothDeviceDiscoveryAgent::start()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Incomplete
    • Affects Version/s: 5.14.2
    • Fix Version/s: None
    • Labels:
      None
    • Platform/s:
      Android

      Description

      Hello,

      I am trying to scan and connect to Bluetooth devices with the Qt Bluetooth API. In order to connect to a device i have to start a device scan. I do this by calling "void QBluetoothDeviceDiscoveryAgent::start()" ( ”QBluetoothDeviceDiscoveryAgent” ) . When i call start() i get:
      qt.bluetooth.android: ACCESS_COARSE|FINE_LOCATION permission available
      qt.bluetooth.android: Search not possible due to turned off Location service
      And there will not pop up some nearby Bluetooth devices. It feels like the Qt Bluetooth API believes that there is no permissions granted. Or what do they mean with ”Location service”?

      I get this problems on Lenovo TB-8505F with Android 10 and Samsung Galaxy S9 (SM-G965F) with Android 10. But not on devices like Lenovo TB-8504X (Android 8.1.0) and Samsung Galaxy S10 SM-G973F (Android 10)
      I can not really test this on emulators, i get ”qt.bluetooth.android: Device does not support Bluetooth”.

      I also do these permission-checks before i do the QBluetoothDeviceDiscoveryAgent::start()
      QtAndroid::checkPermission("android.permission.ACCESS_FINE_LOCATION")
      QtAndroid::checkPermission("android.permission.ACCESS_COARSE_LOCATION")
      And in the ”App info” for my app i can see that ”Location”-permissions is Enabled.

      I am using:
      SDK 2.1
      NDK 21.3.6528147

      This ”Location service”-problems occurs on Qt 5.14.2 or higher. On Qt 5.14.1 i can scan for devices and connect.

      What should i do to be able to scan for Bluetooth devices with for example Lenovo TB-8505F on Qt 5.14.2 or later? Or is there a bug in the Qt Bluetooth API ? Someone who have a clue?

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            ablasche Alex Blasche
            Reporter:
            pga4711 Philip Gabrielsson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes