Small improvement

pull/164/head
M66B 5 years ago
parent 84e105a96c
commit fc53f9b449

@ -73,7 +73,7 @@ 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 (!"content".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));

@ -96,7 +96,7 @@ 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 (!"content".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));

@ -463,7 +463,7 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
Uri uri = args.getParcelable("uri");
String password = args.getString("password");
if ("file".equals(uri.getScheme())) {
if (!"content".equals(uri.getScheme())) {
Log.w("Export uri=" + uri);
throw new IllegalArgumentException(context.getString(R.string.title_no_stream));
}
@ -642,7 +642,7 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
Uri uri = args.getParcelable("uri");
String password = args.getString("password");
if ("file".equals(uri.getScheme())) {
if (!"content".equals(uri.getScheme())) {
Log.w("Import uri=" + uri);
throw new IllegalArgumentException(context.getString(R.string.title_no_stream));
}

@ -3169,7 +3169,7 @@ class Core {
}
Uri uri = (sound == null ? null : Uri.parse(sound));
if (uri == null || "file".equals(uri.getScheme()))
if (uri == null || !"content".equals(uri.getScheme()))
uri = null;
Log.i("Notify sound=" + uri);

@ -320,7 +320,7 @@ public class FragmentBase extends Fragment {
long id = args.getLong("id");
Uri uri = args.getParcelable("uri");
if ("file".equals(uri.getScheme())) {
if (!"content".equals(uri.getScheme())) {
Log.w("Save attachment uri=" + uri);
throw new IllegalArgumentException(context.getString(R.string.title_no_stream));
}

@ -1962,7 +1962,7 @@ public class FragmentCompose extends FragmentBase {
boolean image) throws IOException {
Log.w("Add attachment uri=" + uri);
if ("file".equals(uri.getScheme()) &&
if (!"content".equals(uri.getScheme()) &&
!Helper.hasPermission(context, Manifest.permission.READ_EXTERNAL_STORAGE)) {
Log.w("Add attachment uri=" + uri);
throw new SecurityException("Add attachment with file scheme");

@ -3867,7 +3867,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
long id = args.getLong("id");
Uri uri = args.getParcelable("uri");
if ("file".equals(uri.getScheme())) {
if (!"content".equals(uri.getScheme())) {
Log.w("Save raw uri=" + uri);
throw new IllegalArgumentException(context.getString(R.string.title_no_stream));
}

@ -430,7 +430,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
private void onSelectSound(Uri uri) {
Log.i("Selected ringtone=" + uri);
if (uri != null && "file".equals(uri.getScheme()))
if (uri != null && !"content".equals(uri.getScheme()))
uri = null;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());

Loading…
Cancel
Save