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

(Classic) bluetooth service scan sometimes hangs indefinitely on Android

    XMLWordPrintable

Details

    • Android
    • 8
    • 7c7d860ca5 (qt/qtconnectivity/dev) 980312ee7e (qt/qtconnectivity/6.3) cbd5f6c09a (qt/qtconnectivity/6.4) 980312ee7e (qt/tqtc-qtconnectivity/6.3) cbd5f6c09a (qt/tqtc-qtconnectivity/6.4) 7c7d860ca5 (qt/tqtc-qtconnectivity/dev)
    • Team A Foundation Sprint 60

    Description

      Starting a QBluetoothServiceDiscoveryAgent(FullDiscovery) sometimes hangs forever.

      Detailed analysis is still pending but at this point I venture a guess of what is happening:
      First everything goes as usual:

      • First the device discovery is done
      • Then the service discovery kicks in
      • All devices are discovered for their services

      However, if the device for whatever reason fails discover any services on any of the devices *), the internal "sdpCache" will not get any entries. Then, on the last device's service discovery, the code calls (via timer) this function:

      https://code.qt.io/cgit/qt/qtconnectivity.git/tree/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp#n425

      But since the sdpCache is empty, the function immediately returns and the discovery won't get finished. I guess the sdpCache.isEmpty() is interpreted as "service scan has been stopped already", but in this corner-case it doesn't hold true.

      *) A way to reproduce is to unpair first all devices that are in vicinity (and possibly also clear device's bluetooth caches)

      Attachments

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

        Activity

          People

            vuokko Juha Vuolle
            vuokko Juha Vuolle
            Vladimir Minenko Vladimir Minenko
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews