summaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2020-09-21 13:57:14 +0200
committerArne Schwabe <arne@rfc2549.org>2020-09-21 13:57:14 +0200
commitd845eebc680c903e2280edc47b341cbeb095e55c (patch)
tree119ed781e1bd49c2f8ff99db8e63ff235b6761a4 /main/src
parent466a7df19b1433f37f8c5827264563dc7691ca5d (diff)
Just assume the new API is always availabe on SDK 30+
closes #1234
Diffstat (limited to 'main/src')
-rw-r--r--main/src/ui/java/de/blinkt/openvpn/fragments/Utils.java8
1 files changed, 7 insertions, 1 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 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<String> supportedMimeTypes = new TreeSet<String>();
- Vector<String> extensions = new Vector<String>();
+ Vector<String> 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;
+ }