I've been digging for awhile into the source of the Contacts app on Android to find out which Activity handles Intent.ACTION_CALL_PRIVILEGED
. Unfortunately, I couldn't find its source code. Does anyone know how it's called, or even better where I can find it's source? Thank you!
views:
468answers:
1
+3
A:
Oddly enough, the Phone application handles call-related events. ;)
You can watch ActivityManager
output in logcat to see which component handles a particular Intent
.
From the Contacts source code:
Intent intent = new Intent(Intent.ACTION_CALL_PRIVILEGED,
Uri.fromParts("tel", number, null));
startActivity(intent);
You can reproduce this Intent
on the command line:
adb -e shell am start -a android.intent.action.CALL_PRIVILEGED -d tel:12345
Which results in the following (nicely-formatted) logcat output:
Starting activity: Intent { act=android.intent.action.CALL_PRIVILEGED dat=tel:12345 flg=0x10000000 cmp=com.android.phone/.PrivilegedOutgoingCallBroadcaster }
This shows you that the com.android.phone
application handles this particular Intent
.
Christopher
2010-02-19 14:53:26
Huh nice one! It seems that what I'm after is called OutgoingCallBroadcaster. :)
mobilekid
2010-02-19 15:10:11
Great answer, thank you!
mobilekid
2010-02-19 17:38:04
can you tell me in which SDK version you find Intent.ACTION_CALL_PRIVILEGED? I cannot find it, even with syntax doesn't show it. Only see Intent.ACTION_CALL (sdk 2.1). thanks
Mathias Lin
2010-08-11 09:57:57
It's a hidden API constant (using the @hide annotation).
Christopher
2010-08-11 10:59:05