I created an application that monitors calls (incoming and outgoing), and during the phone call shows detailed information about the number. everything is fine with incoming calls , but when the user makes an outgoing call application this error fails:
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)
here is the detailed information about the sdk version that I am using:
minSdkVersion 14 targetSdkVersion 22 versionCode 1 versionName "1.0"
permissions granted by me:
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" /> <uses-permission android:name="android.permission.READ_CALL_LOG" /> <uses-permission android:name="android.permission.CALL_PHONE" />
I also checked the runtime if permissions were granted. and it returns 0, then yes. but still the same mistake. also please review the broadcast receiver declaration in the manifest:
<receiver android:name=".CallReceiver" android:enabled="true" android:exported="true"> <intent-filter> <action android:name="android.intent.action.PHONE_STATE" /> </intent-filter> </receiver>
any help is appreciated.
source share