aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-11-21 19:48:49 +0100
committerChristian Schneppe <christian@pix-art.de>2017-11-21 19:55:17 +0100
commit49cea4f6f4d1f35a6afb51c5a4bb76a50cef3495 (patch)
treeaef0b12a8c69ccdc38aa37ec9a03e0efe59cb783 /src/main/java/de
parentf99bc5ede6876f2be3071205950e4251995ac3d9 (diff)
FileProvider: attempt to work with sd cards
Diffstat (limited to 'src/main/java/de')
-rw-r--r--src/main/java/de/pixart/messenger/persistance/FileBackend.java2
-rw-r--r--src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/persistance/FileBackend.java b/src/main/java/de/pixart/messenger/persistance/FileBackend.java
index 43f362993..17a90c84a 100644
--- a/src/main/java/de/pixart/messenger/persistance/FileBackend.java
+++ b/src/main/java/de/pixart/messenger/persistance/FileBackend.java
@@ -554,7 +554,7 @@ public class FileBackend {
return FileProvider.getUriForFile(context, packageId + FILE_PROVIDER, file);
} catch (IllegalArgumentException e) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
- throw new SecurityException();
+ throw new SecurityException(e);
} else {
return Uri.fromFile(file);
}
diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
index fdb57e692..48f971ac9 100644
--- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
+++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
@@ -1096,6 +1096,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
try {
uri = FileBackend.getUriForFile(activity, file);
} catch (SecurityException e) {
+ Log.d(Config.LOGTAG, "No permission to access " + file.getAbsolutePath(), e);
Toast.makeText(activity, activity.getString(R.string.no_permission_to_access_x, file.getAbsolutePath()), Toast.LENGTH_SHORT).show();
return;
}