READ_PRIVILEGED_PHONE_STATE permission error : <p>I have created an app that monitors calls (incoming and outgoing) and during the time that phone is ringing , it shows details about the number.
<strong>everything is fine in incoming calls</strong> , but when user make an outgoing call app crashes with this error :</p>

<pre><code>05-14 23:14:36.376 1427-1475/? W/BroadcastQueue: Permission Denial: receiving Intent { act=android.intent.action.PHONE_STATE flg=0x10 (has extras) } to ir.apptune.antispam/.CallReceiver requires android.permission.READ_PRIVILEGED_PHONE_STATE due to sender android (uid 1000)
</code></pre>

<p>here is the details about sdk version that i use :</p>

<pre><code>minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
</code></pre>

<p>permissions that i granted :</p>

<pre><code>&lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt;
&lt;uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" /&gt;
&lt;uses-permission android:name="android.permission.READ_CALL_LOG" /&gt;
&lt;uses-permission android:name="android.permission.CALL_PHONE" /&gt;
</code></pre>

<p>Also i have checked in run time if permissions are granted. and it returns 0 means yes. but still same error.
also please consider the Broadcast receiver declaration in manifest:</p>

<pre><code>&lt;receiver
    android:name=".CallReceiver"
    android:enabled="true"
    android:exported="true"&gt;
    &lt;intent-filter&gt;
        &lt;action android:name="android.intent.action.PHONE_STATE" /&gt;
    &lt;/intent-filter&gt;
&lt;/receiver&gt;
</code></pre>

<p>any help is appreciated.</p>
