summaryrefslogtreecommitdiff
path: root/main/src/ui/java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2020-09-24 18:15:58 +0200
committerArne Schwabe <arne@rfc2549.org>2020-09-24 19:10:53 +0200
commitb7e00f86fb0b925322b8f1fff127ac8d4c381581 (patch)
tree14bb7ac00fd7d9be8707b448ab5dab663459c31b /main/src/ui/java
parent23714a6640f6dabaa35728805dc978399e50415b (diff)
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.
Diffstat (limited to 'main/src/ui/java')
-rw-r--r--main/src/ui/java/de/blinkt/openvpn/fragments/Utils.java13
1 files changed, 9 insertions, 4 deletions
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;
- }
+ }*/