Make a call from ADB shell

2,489 views
Skip to first unread message

Naseer

unread,
Sep 8, 2009, 2:48:27 PM9/8/09
to android-platform
This used to work -

adb shell am start -a android.intent.action.CALL tel:1234

However, now I get this error -



09-08 14:35:57.821 W/dalvikvm( 1107): threadid=3: thread exiting with
uncaught exception (group=0x4001b200)
09-08 14:35:57.841 E/AndroidRuntime( 1107): Uncaught handler: thread
main exiting due to uncaught exception
09-08 14:35:57.841 E/AndroidRuntime( 1107): *** EXCEPTION IN SYSTEM
PROCESS. System will crash.
09-08 14:35:57.871 E/AndroidRuntime( 1107):
java.lang.SecurityException: Permission Denial: starting Intent
{ act=android.intent.action.CALL dat=tel:1234 flg=0x10000000
cmp=com.android.phone/.OutgoingCallBroadcaster } from null (pid=-1,
uid=-1) requires android.permission.CALL_PHONE
09-08 14:35:57.871 E/AndroidRuntime( 1107): at
android.os.Parcel.readException(Parcel.java:1218)
09-08 14:35:57.871 E/AndroidRuntime( 1107): at
android.os.Parcel.readException(Parcel.java:1206)
09-08 14:35:57.871 E/AndroidRuntime( 1107): at
android.app.ActivityManagerProxy.startActivity
(ActivityManagerNative.java:1149)
09-08 14:35:57.871 E/AndroidRuntime( 1107): at
com.android.commands.am.Am.runStart(Am.java:202)
09-08 14:35:57.871 E/AndroidRuntime( 1107): at
com.android.commands.am.Am.run(Am.java:76)
09-08 14:35:57.871 E/AndroidRuntime( 1107): at
com.android.commands.am.Am.main(Am.java:54)
09-08 14:35:57.871 E/AndroidRuntime( 1107): at
com.android.internal.os.RuntimeInit.finishInit(Native Method)
09-08 14:35:57.871 E/AndroidRuntime( 1107): at
com.android.internal.os.RuntimeInit.main(RuntimeInit.java:186)
09-08 14:35:57.871 E/AndroidRuntime( 1107): at
dalvik.system.NativeStart.main(Native Method)
09-08 14:35:57.911 E/JavaBinder( 1107): Unknown binder error code.
0xfffffff7
09-08 14:35:57.921 E/AndroidRuntime( 1107): Crash logging skipped, no
checkin service
09-08 14:35:57.921 I/Process ( 1107): Sending signal. PID: 1107 SIG: 9

Is there a workaround for this ?

Chris Stratton

unread,
Sep 9, 2009, 5:30:01 PM9/9/09
to android-platform
On Sep 8, 2:48 pm, Naseer <naseer.ah...@gmail.com> wrote:

> This used to work -
> adb shell am start -a android.intent.action.CALL tel:1234
> However, now I get this error -

> cmp=com.android.phone/.OutgoingCallBroadcaster } from null (pid=-1,
> uid=-1) requires android.permission.CALL_PHONE

> Is there a workaround for this ?

I would guess that if you made an application with this permission,
that installed a command line executable that was setuid to itself
somewhere where the adb shell could execute it, you could delegate the
task to it. The more android-style way to do it would probably be to
make an app with this permission containing an activity that would
launch on a custom intent and send that intent from the command line?

Naseer Ahmed

unread,
Sep 9, 2009, 7:43:47 PM9/9/09
to android-...@googlegroups.com
For my purposes I got around this by using the adb shell service
command instead of going to all that trouble :)

However, I still feel that a root user should have some way to use all
permissions from the command line.

Chris Stratton

unread,
Sep 9, 2009, 8:20:22 PM9/9/09
to android-platform
On Sep 9, 7:43 pm, Naseer Ahmed <naseer.ah...@gmail.com> wrote:
> For my purposes I got around this by using the adb shell service
> command instead of going to all that trouble :)
>
> However, I still feel that a root user should have some way to use all
> permissions from the command line.>

Adb shell does not get you root on retail phones.

Naseer Ahmed

unread,
Sep 10, 2009, 3:44:42 AM9/10/09
to android-...@googlegroups.com
Not trying on a retail phone - This is on a custom board where adb has root permissions.

Jean-Baptiste Queru

unread,
Sep 10, 2009, 9:28:51 AM9/10/09
to android-...@googlegroups.com
It sounds like your question really belongs in android-porting.

Thanks,
JBQ
--
Jean-Baptiste M. "JBQ" Queru
Software Engineer, Android Open-Source Project, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

Chen Yang

unread,
Sep 10, 2009, 9:40:32 AM9/10/09
to android-...@googlegroups.com
It seems one bug in current android framework, in startActivity, it passes the pid and uid as -1  and -1 to check permission, which won't pass the permission check.  Correct me if I am wrong. Thanks.
--
Chen
Reply all
Reply to author
Forward
0 new messages