Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.12.0
-
None
-
-
2020wk22
Description
In Qt ( http://doc.qt.io/qt-5/qtandroid.html#PermissionResult-enum ):
enum QtAndroid::PermissionResult { Granted = 0, Denied = 1 }
Meanwhile:
https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_DENIED
public static final int PERMISSION_DENIED = -1;
While it's best practice to use enums, using the platform value is also best practice.
In this way, the only portable code can only ever == Granted or != Granted, and checking for equivalency of Denied is not the same thing as checking for Permission.PERMISSION_DENIED - it is now a thing that will never work.
You can use
enum QtAndroid::PermissionResult { Denied = -1, Granted = 0 }
Now there is code that translates 1>1 and any apps that are sharing these results between Qt and Android SDK have to implement that too.
Attachments
Issue Links
- depends on
-
QTBUG-84382 QtAndroidExtras in Qt 6
- Closed
- mentioned in
-
Page Loading...
For Gerrit Dashboard: QTBUG-73409 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
301912,3 | Make PermissionResult compatible with the Android values | dev | qt/qtandroidextras | Status: MERGED | +2 | 0 |