I am trying to get a list of receivers that handle android.intent.action.BOOT_COMPLETED
for other applications.
I can get only the apps with that action with this:
final PackageManager pm = getPackageManager();
final Intent intent = new Intent("android.intent.action.BOOT_COMPLETED");
final List<ResolveInfo> activities = pm.queryBroadcastReceivers(intent, 0);
for (ResolveInfo ri : activities) {
Log.i(TAG, "app name: " + ri.loadLabel(pm));
}
I can get a list of receivers with this code:
final List<PackageInfo> packs = pm.getInstalledPackages(PackageManager.GET_RECEIVERS);
for (final PackageInfo p : packs) {
ActivityInfo[] receivers = p.receivers;
if (receivers != null) {
for (ActivityInfo ai : receivers) {
Log.i(TAG, "receiver: " + ai.name);
}
}
}
After I get the receivers I cannot tell what the intent-filter/action is. If an app has two receivers I need to know which one handles android.intent.action.BOOT_COMPLETED
. Is there a way I can get this info?