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

QPermission incorrectly checks and requests permissions on Android

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.5.1, 6.6.0
    • 6.5.0
    • Core: Other
    • None
    • Android
    • 3
    • 10242a825 (dev), f85e783e6 (6.5)
    • Foundations Sprint 79

    Description

      On Android the QPermission object might resolve to multiple underlying permission strings. See QLocationPermission and QBluetoothPermission as examples.

      The Android backend implementation takes a QPermission object, and extracts a list of permissions.

      The QPermissions::Private::checkPermission() method on Android always checks for the first permission only, and uses its status as a result. This can lead to a situation when one permission is granted, and the others are not, but the API incorrectly reports that all permissions are granted.

      The QPermission::Private::requestPermission() method on Android uses the QtAndroidPrivate::requestPermissions() method, which correctly requests multiple permissions and returns a QFuture with multiple results. However, only the first result is used to extract the status and report it in the callback. This, again, can lead to a situation, when only the first permission was granted, but the API reports that all permissions were granted.

      To fix both cases we need to collect individual statuses from different permissions, and report a combined status to the user. The combined status would be the "worst" status of all. If one of the permissions is Denied, we can't report that the permission is granted...

      Attachments

        Activity

          People

            ivan.solovev Ivan Solovev
            ivan.solovev Ivan Solovev
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: