Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid SecurityException CALL_PHONE eventhough I declare it in Manifest file
    primarykey
    data
    text
    <p>In my app I need in some situation to launch a call programmatically.</p> <p>It works most of the time, but I can see that sometime it doesn't, <strong>specially on 2.3.7 version</strong>. Maybe that specific permission removed and is illegal at that version? I can't find a clue about the origin of the exception.</p> <p>I have the permission in the Manifest:</p> <pre><code>&lt;uses-permission android:name="android.permission.CALL_PHONE" /&gt; </code></pre> <p>The java code:</p> <pre><code>private void launchCall(String number, int calltype) { Intent callIntent = new Intent(); callIntent.setAction(Intent.ACTION_CALL); callIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); callIntent.setData(Uri.parse("tel:"+ number)); if (calltype == CALL_TYPE_VIDEO) { callIntent.setAction(ACTION_VIDEO_CALL); callIntent.putExtra("videocall", true); } context.startActivity(callIntent); } </code></pre> <p>The exception trace:</p> <pre><code>java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL dat=tel:xxx-xxx-xxxx flg=0x10000000 cmp=com.android.phone/.OutgoingCallBroadcaster } from ProcessRecord{415f7158 4016:com.tawkon/10092} (pid=4016, uid=10092) requires android.permission.CALL_PHONE at android.os.Parcel.readException(Parcel.java:1322) at android.os.Parcel.readException(Parcel.java:1276) at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1359) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1374) at android.app.ContextImpl.startActivity(ContextImpl.java:640) at android.content.ContextWrapper.startActivity(ContextWrapper.java:258) at com.tawkon.Service.PrecallSuggestionManager.launchCall(PrecallSuggestionManager.java:305) at com.tawkon.Service.PrecallSuggestionManager.access$12(PrecallSuggestionManager.java:291) at com.tawkon.Service.PrecallSuggestionManager$6.run(PrecallSuggestionManager.java:215) at android.os.Handler.handleCallback(Handler.java:587) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:130) at android.app.ActivityThread.main(ActivityThread.java:3703) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599) at dalvik.system.NativeStart.main(Native Method) </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload