diff --git a/app/src/main/java/eu/faircode/email/ActivityEML.java b/app/src/main/java/eu/faircode/email/ActivityEML.java index e3d4a90750..099dc31992 100644 --- a/app/src/main/java/eu/faircode/email/ActivityEML.java +++ b/app/src/main/java/eu/faircode/email/ActivityEML.java @@ -167,6 +167,7 @@ public class ActivityEML extends ActivityBase { create.setType(apart.attachment.getMimeType()); if (!TextUtils.isEmpty(apart.attachment.name)) create.putExtra(Intent.EXTRA_TITLE, apart.attachment.name); + Helper.openAdvanced(create); if (create.resolveActivity(getPackageManager()) == null) ToastEx.makeText(ActivityEML.this, R.string.title_no_saf, Toast.LENGTH_LONG).show(); else diff --git a/app/src/main/java/eu/faircode/email/ActivitySetup.java b/app/src/main/java/eu/faircode/email/ActivitySetup.java index 1767ee4a85..933e7c564a 100644 --- a/app/src/main/java/eu/faircode/email/ActivitySetup.java +++ b/app/src/main/java/eu/faircode/email/ActivitySetup.java @@ -1306,6 +1306,7 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac intent.setType("*/*"); intent.putExtra(Intent.EXTRA_TITLE, "fairemail_" + new SimpleDateFormat("yyyyMMdd").format(new Date().getTime()) + ".backup"); + Helper.openAdvanced(intent); return intent; } @@ -1313,6 +1314,7 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); intent.addCategory(Intent.CATEGORY_OPENABLE); intent.setType("*/*"); + Helper.openAdvanced(intent); return intent; } diff --git a/app/src/main/java/eu/faircode/email/FragmentBase.java b/app/src/main/java/eu/faircode/email/FragmentBase.java index e82c0d8754..4d484cbf16 100644 --- a/app/src/main/java/eu/faircode/email/FragmentBase.java +++ b/app/src/main/java/eu/faircode/email/FragmentBase.java @@ -293,6 +293,7 @@ public class FragmentBase extends Fragment { create.addCategory(Intent.CATEGORY_OPENABLE); create.setType(intent.getStringExtra("type")); create.putExtra(Intent.EXTRA_TITLE, intent.getStringExtra("name")); + Helper.openAdvanced(create); if (create.resolveActivity(getContext().getPackageManager()) == null) ToastEx.makeText(getContext(), R.string.title_no_saf, Toast.LENGTH_LONG).show(); else @@ -302,7 +303,7 @@ public class FragmentBase extends Fragment { private void onStoreAttachments(Intent intent) { message = intent.getLongExtra("id", -1); Intent tree = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE); - //tree.putExtra("android.content.extra.SHOW_ADVANCED", true); + Helper.openAdvanced(tree); if (tree.resolveActivity(getContext().getPackageManager()) == null) ToastEx.makeText(getContext(), R.string.title_no_saf, Toast.LENGTH_LONG).show(); else diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index d1af42f8f9..c4031fd19c 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -1129,6 +1129,7 @@ public class FragmentCompose extends FragmentBase { Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); intent.addCategory(Intent.CATEGORY_OPENABLE); intent.setType("image/*"); + Helper.openAdvanced(intent); PackageManager pm = getContext().getPackageManager(); if (intent.resolveActivity(pm) == null) Snackbar.make(view, R.string.title_no_saf, Snackbar.LENGTH_LONG).show(); @@ -1141,6 +1142,7 @@ public class FragmentCompose extends FragmentBase { intent.addCategory(Intent.CATEGORY_OPENABLE); intent.setType("*/*"); intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); + Helper.openAdvanced(intent); PackageManager pm = getContext().getPackageManager(); if (intent.resolveActivity(pm) == null) Snackbar.make(view, R.string.title_no_saf, Snackbar.LENGTH_LONG).show(); diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index c43eaad16a..4b0ab32f47 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -3883,6 +3883,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. create.addCategory(Intent.CATEGORY_OPENABLE); create.setType("*/*"); create.putExtra(Intent.EXTRA_TITLE, "email.eml"); + Helper.openAdvanced(create); if (create.resolveActivity(getContext().getPackageManager()) == null) Snackbar.make(view, R.string.title_no_saf, Snackbar.LENGTH_LONG).show(); else diff --git a/app/src/main/java/eu/faircode/email/Helper.java b/app/src/main/java/eu/faircode/email/Helper.java index 97d6c7f596..9e8698114a 100644 --- a/app/src/main/java/eu/faircode/email/Helper.java +++ b/app/src/main/java/eu/faircode/email/Helper.java @@ -736,6 +736,14 @@ public class Helper { return stats.getAvailableBlocksLong() * stats.getBlockSizeLong(); } + static void openAdvanced(Intent intent) { + // https://issuetracker.google.com/issues/72053350 + intent.putExtra("android.content.extra.SHOW_ADVANCED", true); + intent.putExtra("android.content.extra.FANCY", true); + intent.putExtra("android.content.extra.SHOW_FILESIZE", true); + intent.putExtra("android.provider.extra.SHOW_ADVANCED", true); + } + // Cryptography static String sha256(String data) throws NoSuchAlgorithmException {