Optionally allow read storage

This commit is contained in:
M66B
2019-02-07 09:25:11 +00:00
parent adbfa01b41
commit 795f9a729d
3 changed files with 6 additions and 2 deletions

View File

@@ -1327,14 +1327,15 @@ public class FragmentCompose extends FragmentBase {
private static EntityAttachment addAttachment(Context context, long id, Uri uri,
boolean image) throws IOException {
if ("file".equals(uri.getScheme())) {
if ("file".equals(uri.getScheme()) &&
!Helper.hasPermission(context, Manifest.permission.READ_EXTERNAL_STORAGE)) {
Log.w("Add attachment uri=" + uri);
throw new IllegalArgumentException(context.getString(R.string.title_no_stream));
}
EntityAttachment attachment = new EntityAttachment();
String name = null;
String name = uri.getLastPathSegment();
String s = null;
Cursor cursor = null;