i am developing SIP application and it running successfully but getting a security Permission Denial Exception of PHONE_STATE only on KitKat Android version. Do anyone know what is the reason, Please help me to find a solution.
Here is some part of code:-
Intent intent = new Intent(ACTION_PHONE_STATE_CHANGED);
intent.putExtra("state",state);
if (number != null)
intent.putExtra("incoming_number", number);
intent.putExtra(mContext.getString(R.string.app_name), true);
mContext.sendBroadcast(intent, android.Manifest.permission.READ_PHONE_STATE);
LogCat :-
05-28 01:48:52.556: E/AndroidRuntime(2860): FATAL EXCEPTION: main
05-28 01:48:52.556: E/AndroidRuntime(2860): Process: org.sipdroid.sipua, PID: 2860
05-28 01:48:52.556: E/AndroidRuntime(2860): java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.PHONE_STATE from pid=2860, uid=10051
05-28 01:48:52.556: E/AndroidRuntime(2860): at android.os.Parcel.readException(Parcel.java:1461)
05-28 01:48:52.556: E/AndroidRuntime(2860): at android.os.Parcel.readException(Parcel.java:1415)
05-28 01:48:52.556: E/AndroidRuntime(2860): at android.app.ActivityManagerProxy.broadcastIntent(ActivityManagerNative.java:2373)
05-28 01:48:52.556: E/AndroidRuntime(2860): at android.app.ContextImpl.sendBroadcast(ContextImpl.java:1141)
05-28 01:48:52.556: E/AndroidRuntime(2860): at android.content.ContextWrapper.sendBroadcast(ContextWrapper.java:370)
05-28 01:48:52.556: E/AndroidRuntime(2860): at org.sipdroid.sipua.ui.Receiver.broadcastCallStateChanged(Receiver.java:496)