Debug: file selectors

pull/215/head
M66B 5 months ago
parent 7ccf489f22
commit cebf58962d

@ -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<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 {
Intent intent = new Intent(Intent.ACTION_VIEW)
//.addCategory(Intent.CATEGORY_BROWSABLE)

Loading…
Cancel
Save