Debug: URI info

pull/213/head
M66B 1 year ago
parent 7e4c9731b2
commit d26f444281

@ -7891,12 +7891,15 @@ public class FragmentCompose extends FragmentBase {
@NonNull @NonNull
private static UriInfo getInfo(Uri uri, Context context) { private static UriInfo getInfo(Uri uri, Context context) {
UriInfo result = new UriInfo(); UriInfo result = new UriInfo();
DocumentFile dfile = null;
try { try {
DocumentFile dfile = DocumentFile.fromSingleUri(context, uri); dfile = DocumentFile.fromSingleUri(context, uri);
if (dfile != null) { if (dfile != null) {
result.name = dfile.getName(); result.name = dfile.getName();
result.type = dfile.getType(); result.type = dfile.getType();
result.size = dfile.length(); result.size = dfile.length();
EntityLog.log(context, "UriInfo dfile " + result + " uri=" + uri);
} }
} catch (Throwable ex) { } catch (Throwable ex) {
Log.e(ex); Log.e(ex);
@ -7924,6 +7927,8 @@ public class FragmentCompose extends FragmentBase {
if (result.size != null && result.size <= 0) if (result.size != null && result.size <= 0)
result.size = null; result.size = null;
EntityLog.log(context, "UriInfo result " + result + " uri=" + uri);
return result; return result;
} }
@ -7935,6 +7940,12 @@ public class FragmentCompose extends FragmentBase {
boolean isImage() { boolean isImage() {
return ImageHelper.isImage(type); return ImageHelper.isImage(type);
} }
@NonNull
@Override
public String toString() {
return "name=" + name + " type=" + type + " size=" + size;
}
} }
private static class DraftData { private static class DraftData {

Loading…
Cancel
Save