1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-29 19:25:34 +00:00

Debug: file selectors

This commit is contained in:
M66B 2024-08-11 19:58:41 +02:00
parent 7ccf489f22
commit cebf58962d

View file

@ -1619,6 +1619,28 @@ public class DebugHelper {
} }
size += write(os, "\r\n"); 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<ResolveInfo> 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 { try {
Intent intent = new Intent(Intent.ACTION_VIEW) Intent intent = new Intent(Intent.ACTION_VIEW)
//.addCategory(Intent.CATEGORY_BROWSABLE) //.addCategory(Intent.CATEGORY_BROWSABLE)