From cebf58962dda2b31d18143d9e4dda282f4622183 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 11 Aug 2024 19:58:41 +0200 Subject: [PATCH] Debug: file selectors --- .../java/eu/faircode/email/DebugHelper.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/DebugHelper.java b/app/src/main/java/eu/faircode/email/DebugHelper.java index 8a84023f35..379d394c5e 100644 --- a/app/src/main/java/eu/faircode/email/DebugHelper.java +++ b/app/src/main/java/eu/faircode/email/DebugHelper.java @@ -1619,6 +1619,28 @@ public class DebugHelper { } size += write(os, "\r\n"); + try { + Intent open = new Intent(Intent.ACTION_GET_CONTENT); + open.addCategory(Intent.CATEGORY_OPENABLE); + open.setType("*/*"); + + ResolveInfo main = pm.resolveActivity(open, 0); + + List ris = pm.queryIntentActivities(open, flags); + size += write(os, "File selectors=" + (ris == null ? null : ris.size()) + "\r\n"); + if (ris != null) + for (ResolveInfo ri : ris) { + boolean p = Objects.equals(main == null ? null : main.activityInfo.packageName, ri.activityInfo.packageName); + CharSequence label = pm.getApplicationLabel(ri.activityInfo.applicationInfo); + size += write(os, String.format("File selector %s%s (%s)\r\n", + ri.activityInfo.packageName, p ? "*" : "", label == null ? null : label.toString())); + } + + } catch (Throwable ex) { + size += write(os, "\r\n"); + } + size += write(os, "\r\n"); + try { Intent intent = new Intent(Intent.ACTION_VIEW) //.addCategory(Intent.CATEGORY_BROWSABLE)