Hi:

I tried to place a call from my application, but it always crashes
after the following section of code:

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

(number is a type of string, where I put a valid phone number in)

When I step through with debugger, I got a "SecurityException" from
Parcel.readException(int, String) line: 1066

The exception reads:

Permission Denial: starting Intent
{ action=android.intent.action.CALL_PRIVILEGED data=tel:12
flags=0x10000000 comp={com.android.phone/
com.android.phone.PrivilegedOutgoingCallBroadcaster} } from
ProcessRecord{43679c98 6472:com.xyz.test/10029} (pid=6472, uid=10029)
requires android.permission.CALL_PRIVILEGED

However, I have already added this to my AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android";
        package="com.xyz.test" android:versionCode="1"
        android:versionName="0.1.0">
        <uses-permission android:name="android.permission.CALL_PRIVILEGED" />
        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.READ_CONTACTS" />
        <uses-permission android:name="android.permission.WRITE_CONTACTS" />
    ...

This is the same way I added other permissions such as READ_CONTACTS,
where the permission was granted after I added it to the manifest
file.

Any suggestions? Is CALL_PRIVILEGED locked down somehow and can only
be accessed by apps from Google?

Mobi

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to