Which activity handles Intent.ACTION_CALL_PRIVILEGED?

前端 未结 1 881
天涯浪人
天涯浪人 2020-12-30 15:05

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

相关标签:
1条回答
  • 2020-12-30 15:43

    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.

    0 讨论(0)
提交回复
热议问题