From d26f4442812e0b73435dd58de9928e5f0cb47f60 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 14 Aug 2023 20:55:31 +0200 Subject: [PATCH] Debug: URI info --- .../java/eu/faircode/email/FragmentCompose.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 971723ee99..e51b9b39d8 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -7891,12 +7891,15 @@ public class FragmentCompose extends FragmentBase { @NonNull private static UriInfo getInfo(Uri uri, Context context) { UriInfo result = new UriInfo(); + + DocumentFile dfile = null; try { - DocumentFile dfile = DocumentFile.fromSingleUri(context, uri); + dfile = DocumentFile.fromSingleUri(context, uri); if (dfile != null) { result.name = dfile.getName(); result.type = dfile.getType(); result.size = dfile.length(); + EntityLog.log(context, "UriInfo dfile " + result + " uri=" + uri); } } catch (Throwable ex) { Log.e(ex); @@ -7924,6 +7927,8 @@ public class FragmentCompose extends FragmentBase { if (result.size != null && result.size <= 0) result.size = null; + EntityLog.log(context, "UriInfo result " + result + " uri=" + uri); + return result; } @@ -7935,6 +7940,12 @@ public class FragmentCompose extends FragmentBase { boolean isImage() { return ImageHelper.isImage(type); } + + @NonNull + @Override + public String toString() { + return "name=" + name + " type=" + type + " size=" + size; + } } private static class DraftData {