From d845eebc680c903e2280edc47b341cbeb095e55c Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Mon, 21 Sep 2020 13:57:14 +0200 Subject: Just assume the new API is always availabe on SDK 30+ closes #1234 --- main/src/ui/java/de/blinkt/openvpn/fragments/Utils.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 abdc45f5..1813ba1d 100644 --- a/main/src/ui/java/de/blinkt/openvpn/fragments/Utils.java +++ b/main/src/ui/java/de/blinkt/openvpn/fragments/Utils.java @@ -37,7 +37,7 @@ public class Utils { Intent i = new Intent(Intent.ACTION_GET_CONTENT); i.addCategory(Intent.CATEGORY_OPENABLE); TreeSet supportedMimeTypes = new TreeSet(); - Vector extensions = new Vector(); + Vector extensions = new Vector<>(); switch (fileType) { case PKCS12: @@ -125,6 +125,12 @@ public class Utils { if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.N) i.setPackage("com.android.documentsui"); + 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