哪个活动处理Intent.ACTION_CALL_PRIVILEGED?

时间:2010-02-19 14:19:33

标签: android android-activity android-intent

我一直在挖掘Android上Contacts app的来源,找出哪个Activity处理Intent.ACTION_CALL_PRIVILEGED。不幸的是,我找不到它的源代码。有谁知道它是如何调用的,甚至更好的地方我能找到它的来源?谢谢!

1 个答案:

答案 0 :(得分:11)

奇怪的是,Phone application处理与呼叫相关的事件。 ;)

您可以在logcat中查看ActivityManager输出,以查看哪个组件处理特定Intent

来自联系人源代码:

Intent intent = new Intent(Intent.ACTION_CALL_PRIVILEGED,
    Uri.fromParts("tel", number, null));
startActivity(intent);

您可以在命令行上重现此Intent
adb -e shell am start -a android.intent.action.CALL_PRIVILEGED -d tel:12345

这导致以下(格式良好的)logcat输出:

Starting activity: Intent { 
    act=android.intent.action.CALL_PRIVILEGED 
    dat=tel:12345
    flg=0x10000000
    cmp=com.android.phone/.PrivilegedOutgoingCallBroadcaster
}

这表明com.android.phone应用程序处理此特定Intent