summaryrefslogtreecommitdiffstats
path: root/examples/corelib/permissions
Commit message (Collapse)AuthorAgeFilesLines
* Move permissions example to manual testTor Arne Vestbø2023-06-264-246/+0
| | | | | | Pick-to: 6.5 6.6 Change-Id: If7482ff20079d91ddba26a1abcb06b3054cc72ad Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* permissions: Replace deprecated location permission usage keyTor Arne Vestbø2023-02-081-5/+5
| | | | | | | | | And add the macOS specific key. Pick-to: 6.5 Change-Id: I1e0446a1927ef530322388417b9300ae287752c3 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
* Add android manifest and java files to exampleDavid Schulz2023-02-071-0/+1
| | | | | | | | | | These files should not change the outcome of the build process, but are merely added to better support the CMake and Android integration in Qt Creator. Also those files were previously listed in the OTHER_FILES section of the qmake project files. Change-Id: Id3d403130ee8800ed6b0877f9f1c3dd1f28b46b7 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* permissions: Set explicit bundle identifier for permissions exampleTor Arne Vestbø2023-02-071-0/+1
| | | | | | | | | | It's needed for location permissions to work. Pick-to: 6.5 Change-Id: Iffb5d92f863ab79434b4071d5896b349010f87fb Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Juha Vuolle <juha.vuolle@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* permissions: Finalize permission example at end of CMakeLists.txtTor Arne Vestbø2023-02-011-2/+2
| | | | | | | | Otherwise the finalizers won't know which libraries we're linking to. Pick-to: 6.5 Change-Id: I886c46443b7289d6e2c7d824767ed5e34a0a1fbf Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* permissions: Improve error when building example on non-supported platformTor Arne Vestbø2023-01-101-1/+4
| | | | | | | Pick-to: 6.5 Change-Id: I02f4fc087d49d21541b1e415db411c09db981278 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Examples: Use PRIVATE CMake linkageKai Köhne2022-11-301-1/+1
| | | | | | | We (almost) only build apps, for which PRIVATE linkage makes more sense. Change-Id: I09a509c3fb33a00cdfdede687b3f95d638f42091 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Examples: Use qt_standard_project_setup()Kai Köhne2022-11-171-2/+2
| | | | | Change-Id: I0ceab08108b7e58e4e2ed25db9e3c289f5c0ddac Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Examples: Use Qt6:: to qualify Qt CMake packagesKai Köhne2022-11-171-3/+3
| | | | | | | This is what we promote also in the documentation. Change-Id: If91aebafe861b0c934acbb2c69afd182abc3345d Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add permissions feature example and manual test to the buildAssam Boudjelthia2022-11-102-2/+6
| | | | | | | | | | And add license headers and some minor fixes for warnings in the example and test. Task-number: QTBUG-90498 Change-Id: I34592f7f2844c92c25a6a676c8ac1ffca9e03c6d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Plumb public permission APIs to Android backendTor Arne Vestbø2022-11-092-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | The lock and unlock of the Android deadlock mutex is now part of the internal implementation instead of limited to the enum based permission API. It is unclear why 8bca441b6f65 added the guard only to this API and not to the string based API as well. The check for isBackgroundLocationApi29 has been removed, as the logic seemingly resulted in accepting every single permission type except location permissions if used via the enum-based API. Since Android's platform permission API doesn't have an Undetermined status, we keep a hash of the status for each permission type, and by default checkPermission() would return Undetermined, until a requestPermission() call is done which updates the internal hash, and after that checkPermission() would return properly Granted/Denied. Task-number: QTBUG-100413 Change-Id: Ia95c76af754481a281bc90198e349966c9c2da52 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add permission API backend for macOS and iOSTimur Pocheptsov2022-11-032-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When submitting applications to the iOS and macOS AppStore the application goes through static analysis, which will trigger on uses of various privacy protected APIs, unless the application has a corresponding usage description for the permission in the Info.plist file. This applies even if the application never requests the given permission, but just links to a Qt library that has the offending symbols or library dependencies. To ensure that the application does not have to add usage descriptions to their Info.plist for permissions they never plan to use we split up the various permission implementations into small static libraries that register with the Qt plugin mechanism as permission backends. We can then inspect the application's Info.plist at configure time and only add the relevant static permission libraries. Furthermore, since some permissions can be checked without any usage description, we allow the implementation to be split up into two separate translation units. By putting the request in its own translation unit we can selectively include it during linking by telling the linker to look for a special symbol. This is useful for libraries such as Qt Multimedia who would like to check the current permission status, but without needing to request any permission of its own. Done-with: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Change-Id: Ic2a43e1a0c45a91df6101020639f473ffd9454cc Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Long live QPermissions!Tor Arne Vestbø2022-11-012-0/+111
Many features of today's devices and operating systems can have significant privacy, security, and performance implications if misused. It's therefore increasingly common for platforms to require explicit consent from the user before accessing these features. The Qt permission APIs allow the application to check or request permission for such features in a cross platform manner. The check is always synchronous, and can be used in both library and application code, from any thread. The request is asynchronous, and should be initiated from application code on the main thread. The result of the request can be delivered to lambdas, standalone functions, or regular member functions such as slots, with an optional context parameter to manage the lifetime of the request. Individual permissions are distinct types, not enum values, and can be added and extended at a later point. Task-number: QTBUG-90498 Done-with: Timur Pocheptsov <timur.pocheptsov@qt.io> Done-with: Volker Hilsheimer <volker.hilsheimer@qt.io> Done-with: Mårten Nordheim <marten.nordheim@qt.io> Change-Id: I821380bbe56bbc0178cb43e6cabbc99fdbd1235e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>