简体   繁体   中英

java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.NEW_OUTGOING_CALL on android 7 (N OS)

I want to make outgoing call using adb connection on Nexus 5x(N OS) device.

I am sending out a broadcast intent and observed error:

Broadcasting: Intent { act=android.intent.action.NEW_OUTGOING_CALL (has extras) } java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.NEW_OUTGOING_CALL from pid=5569, uid=2000 at android.os.Parcel.readException(Parcel.java:1683) at android.os.Parcel.readException(Parcel.java:1636) at android.app.ActivityManagerProxy.broadcastIntent(ActivityManagerNative.java:3507) at com.android.commands.am.Am.sendBroadcast(Am.java:772) at com.android.commands.am.Am.onRun(Am.java:404) at com.android.internal.os.BaseCommand.run(BaseCommand.java:51) at com.android.commands.am.Am.main(Am.java:121) at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:262)

Quoting the documentation :

This is a protected intent that can only be sent by the system.

Hence, you cannot use it for your own broadcast Intent .

使用此命令可以正常工作:

adb shell su 0 am broadcast -a android.intent.action.NEW_OUTGOING_CALL -e android.intent.extra.PHONE_NUMBER 'xxxxxxxxx'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM