mirror of https://github.com/M66B/FairEmail.git
Small improvements
This commit is contained in:
parent
1efe675abd
commit
b2e445c04b
|
@ -19,6 +19,7 @@ package eu.faircode.email;
|
|||
Copyright 2018-2019 by Marcel Bokhorst (M66B)
|
||||
*/
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.res.AssetFileDescriptor;
|
||||
|
@ -71,8 +72,11 @@ public class ActivityDSN extends ActivityBase {
|
|||
protected Result onExecute(Context context, Bundle args) throws Throwable {
|
||||
Uri uri = args.getParcelable("uri");
|
||||
|
||||
if ("file".equals(uri.getScheme()))
|
||||
if ("file".equals(uri.getScheme()) &&
|
||||
!Helper.hasPermission(context, Manifest.permission.READ_EXTERNAL_STORAGE)) {
|
||||
Log.w("DSN uri=" + uri);
|
||||
throw new IllegalArgumentException(context.getString(R.string.title_no_stream));
|
||||
}
|
||||
|
||||
Result result = new Result();
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ package eu.faircode.email;
|
|||
Copyright 2018-2019 by Marcel Bokhorst (M66B)
|
||||
*/
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.res.AssetFileDescriptor;
|
||||
|
@ -85,8 +86,11 @@ public class ActivityEml extends ActivityBase {
|
|||
protected Result onExecute(Context context, Bundle args) throws Throwable {
|
||||
Uri uri = args.getParcelable("uri");
|
||||
|
||||
if ("file".equals(uri.getScheme()))
|
||||
if ("file".equals(uri.getScheme()) &&
|
||||
!Helper.hasPermission(context, Manifest.permission.READ_EXTERNAL_STORAGE)) {
|
||||
Log.w("EML uri=" + uri);
|
||||
throw new IllegalArgumentException(context.getString(R.string.title_no_stream));
|
||||
}
|
||||
|
||||
Result result = new Result();
|
||||
|
||||
|
|
|
@ -1744,8 +1744,10 @@ public class FragmentCompose extends FragmentBase {
|
|||
Log.w("Add attachment uri=" + uri);
|
||||
|
||||
if ("file".equals(uri.getScheme()) &&
|
||||
!Helper.hasPermission(context, Manifest.permission.READ_EXTERNAL_STORAGE))
|
||||
!Helper.hasPermission(context, Manifest.permission.READ_EXTERNAL_STORAGE)) {
|
||||
Log.w("Add attachment uri=" + uri);
|
||||
throw new SecurityException();
|
||||
}
|
||||
|
||||
EntityAttachment attachment = new EntityAttachment();
|
||||
|
||||
|
|
Loading…
Reference in New Issue