From 37f4c6fbc28617fdd3343033c6f926ec2263fce2 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 8 Sep 2020 05:52:29 +0200 Subject: Android: Pass the parsed URI if it fails to get permission on 23 or less In Android API level 23 or lower it will still be able to open the file even if the permissions are not provided. If the system is not going to allow it then it will prevent it later on. So we trust the system to block access if need be. Pick-to: 5.15 Change-Id: If663e3cf0a10818931577988abdc0fb8ec2650db Reviewed-by: Assam Boudjelthia --- src/android/jar/src/org/qtproject/qt5/android/QtNative.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java index 8d0777e5bc..6fd6a9ca98 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java @@ -193,6 +193,10 @@ public class QtNative return iterUri; } + // Android 6 and earlier could still manage to open the file so we can return the + // parsed uri here + if (Build.VERSION.SDK_INT < 24) + return parsedUri; return null; } catch (SecurityException e) { e.printStackTrace(); -- cgit v1.2.3