From ef935f6e37a24f52255e6696b85a0fa9aaa7361a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 6 May 2022 17:00:51 +0200 Subject: Plumb public permission APIs to Android backend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø --- tests/manual/permissions/CMakeLists.txt | 6 ++- .../manual/permissions/android/AndroidManifest.xml | 53 ++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 tests/manual/permissions/android/AndroidManifest.xml (limited to 'tests') diff --git a/tests/manual/permissions/CMakeLists.txt b/tests/manual/permissions/CMakeLists.txt index 50ec89665f..cac8716129 100644 --- a/tests/manual/permissions/CMakeLists.txt +++ b/tests/manual/permissions/CMakeLists.txt @@ -6,7 +6,11 @@ qt_internal_add_test(tst_qpermissions Qt::CorePrivate ) -if (APPLE) +if(ANDROID) + set_property(TARGET tst_qpermissions + PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android") + qt_android_generate_deployment_settings(tst_qpermissions) +elseif(APPLE) # Test an app bundle, but without any usage descriptions qt_internal_add_test(tst_qpermissions_app diff --git a/tests/manual/permissions/android/AndroidManifest.xml b/tests/manual/permissions/android/AndroidManifest.xml new file mode 100644 index 0000000000..557ec8007e --- /dev/null +++ b/tests/manual/permissions/android/AndroidManifest.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3