From b7e00f86fb0b925322b8f1fff127ac8d4c381581 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Thu, 24 Sep 2020 18:15:58 +0200 Subject: Request QUERY_ALL_PACKAGES permission (closes #1238) On SDK 30 or higher this permission is required to be able to list all packages on a device. This app needs that to show all installed apps in the allow/disallow Apps via VPN dialog. --- main/src/ui/java/de/blinkt/openvpn/fragments/Utils.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'main/src/ui/java/de/blinkt/openvpn/fragments') diff --git a/main/src/ui/java/de/blinkt/openvpn/fragments/Utils.java b/main/src/ui/java/de/blinkt/openvpn/fragments/Utils.java index 1813ba1d..3692624b 100644 --- a/main/src/ui/java/de/blinkt/openvpn/fragments/Utils.java +++ b/main/src/ui/java/de/blinkt/openvpn/fragments/Utils.java @@ -125,12 +125,17 @@ public class Utils { if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.N) i.setPackage("com.android.documentsui"); + + /* + * Android 11 is much stricter about allowing what to query. Since the app has the + * QUERY_ALL permission we can still check on Android 11 but otherwise we would just + * assume the documents ui to be always there: + */ + + /* if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { - /* For some reason checking if the intent is available does not work on Android 11, - * just assume the document storage is always available. - */ return i; - } + }*/ -- cgit v1.2.3