From 60b7ef78b75de21c021a8befb87b23c381ffdf42 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 21 Aug 2023 18:11:06 +0200 Subject: [PATCH] Force file picker --- app/src/main/java/eu/faircode/email/ApplicationEx.java | 3 --- app/src/main/java/eu/faircode/email/FragmentCompose.java | 4 ++-- .../main/java/eu/faircode/email/FragmentOptionsBehavior.java | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ApplicationEx.java b/app/src/main/java/eu/faircode/email/ApplicationEx.java index fc9ba60d83..3a8d9d55a1 100644 --- a/app/src/main/java/eu/faircode/email/ApplicationEx.java +++ b/app/src/main/java/eu/faircode/email/ApplicationEx.java @@ -375,9 +375,6 @@ public class ApplicationEx extends Application if (version < BuildConfig.VERSION_CODE) editor.remove("crash_report_count"); - if (!BuildConfig.DEBUG) - editor.remove("photo_picker"); - if (!BuildConfig.TEST_RELEASE) editor.remove("test1").remove("test2").remove("test3").remove("test4").remove("test5"); diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index c228fb64f0..d61df57867 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -3525,7 +3525,7 @@ public class FragmentCompose extends FragmentBase { Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.addCategory(Intent.CATEGORY_OPENABLE); intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); - intent.setType("image/*"); + intent.setType("*/*"); intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); if (intent.resolveActivity(pm) == null) // GET_CONTENT whitelisted noStorageAccessFramework(); @@ -3584,7 +3584,7 @@ public class FragmentCompose extends FragmentBase { EntityAttachment attachment = addAttachment(context, id, uri, type, image, resize, privacy); if (attachment == null) continue; - if (!image) + if (!image || !attachment.isImage()) continue; File file = attachment.getFile(context); diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsBehavior.java b/app/src/main/java/eu/faircode/email/FragmentOptionsBehavior.java index 434a27226a..9efb716e71 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsBehavior.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsBehavior.java @@ -519,7 +519,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe } }); - swPhotoPicker.setVisibility(Helper.hasPhotoPicker() && BuildConfig.DEBUG ? View.VISIBLE : View.GONE); + swPhotoPicker.setVisibility(Helper.hasPhotoPicker() ? View.VISIBLE : View.GONE); swPhotoPicker.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {