monika
monika

Reputation: 195

intercept the Android's OS incoming call screen and replace

I would like to intercept the Android's OS incoming call screen and replace it with my app's incoming call screen. However, there is no API to do so, but I know for sure it is possible as 4 different companies implemented this; The companies I'm talking about are: Adaffix (Yellix), Vringo, WhitePages Caller ID and more. They are all cleanly replaces the OS incoming call screen with their app's incoming call screen as the call arrives (no delay, no glitches, it is always working).

I was able to find a partial solution but this solution is not stable, as sometimes it is showing my app incoming call screen and sometimes the OS incoming call screen. each call it reacts differently.

Do you have any Idea?

Upvotes: 17

Views: 11436

Answers (3)

Vikas Singh
Vikas Singh

Reputation: 1791

I guess you might have done 95% of the work. The problem of your screen not showing up but the system incoming call could be solved like this :

Can an activity receive an unordered broadcast(incoming call) intent before system's default receiver?

Upvotes: 2

Barmaley
Barmaley

Reputation: 16363

You need to intercept broadcast android.intent.action.PHONE_STATE with highest possible priority, then if in your BroadcastReceiver.onReceive() you will cancel broadcast through BroadcastReceiver.abortBroadcast() you will be able to stop default incoming call screen to be shown, since default application won't receive incoming call broadcast. After that you're free to show your own Activity.

At least the same strategy works with incoming SMS' - I used to do as described above.

Upvotes: 2

LordKakarot
LordKakarot

Reputation: 108

You will have to overlay the native screen with a control(maybe a dialog box) when you get android.intent.action.PHONE_STATE as ringing.

You have to register a BroadcastReceiver for the action android.intent.action.PHONE_STATE.

The receiving intent will have a variable TelephonyManager.EXTRA_STATE_RINGING which will have the current state.

Let me know!

Upvotes: 6

Related Questions