Replacing standard Android Dialer - dog chasing its tail
The issue seems simple enough - provide your own app that intercepts dial commands, and then dials them itself (imagine a VoIP application that if connected places a VoIP call, and if not connected, uses the phone's cellular capabilities to make the call).
this thread provides all the information you'd ever need - except there's a bit of a glitch:
Not every application seems to be using the same intents. I figure Intent.ACTION_DIAL must be the recommended standard option, and sure enough, most apps do that. Then there's Intent.ACTION_CALL_BUTTON, which seems to be of an oddity (my S3 tells me it has no application handling this action in the first place) and finally Intent.ACTION_CALL_PRIVILEGED.
Doing a little trial and error I figured that "native" apps (I'd call the native call log and contact application native) seem to be using Intent.ACTION_CALL_PRIVILEGED, whereas the rest uses INTENT_ACTION_CALL. And there lies the rub... if you register for both actions, then sure enough you can catch every dial command, but then what do you do with it? You can't fire off an intent with either of these actions since that'll just get you an infinite loop, there's no lower level action, and TelephonyManager conspicuously misses a makeCall method. Since you cannot dynamically register and unregister intent filters, is there a solution for this dog chasing its tail?