Search code examples
androidbroadcastreceiver

How to get list of all BroadcastReceiver(s) registered for a specific intent?


I am developing an android service at OS level. ( not from SDK, its from android source code. It will be part of my custom ROM. I can tun myself as root)

I am going to give an interface to apps to do something using my custom intent. At the end I want to know who all are listening for this intent.

Is there any way to get list of all BroadcastReceiver(s) registered for a specific intent?

Thanks for help!


Solution

  • From a program you can use PackageManager and queryBroadcastReceivers().

    From the 'adb shell', try the command: dumpsys activity

    the Activity Resolver Table lists all the things that broadcast receivers are looking for.