Android Question PhoneStateListener vs BroadcastReceiver


Well-Known Member
Licensed User
There are two ways to wait for a phone call. One is to have a service to monitor PhoneStateChanged event of PhoneEvents and other is to have a Broadcast Receiver service for android.intent.action.PHONE_STATE.

The benefit of Broadcast Receiver is that you don't need to worry about keeping your service alive as system will wake it when an incoming call comes. But I have noticed that sometimes there is a slight delay and therefore if it is absolutely critical that you should know the moment a call comes, it is better to maintain your own service with PhoneStateChanged. But that would mean having a foreground service and a full time notification.

My question is this. Imagine I have 2 services in the same app - one for BroadcastReceiver and other for PhoneStateListener. When an incoming call comes, which of the two will be raised? Or is it both? How will the flow of execution be?

I am asking this because I am thinking of combining the two - using BroadcastReceiver to start the service that has PhoneStateListener, in case the system has killed it. That way I can avoid PhoneStateListener service from being on foreground all the time and therefore the persistent notification as well.