I have this code:
TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELPHONY_SERVICE);
Class clase = Class.forName(tm.getClass().getName());
Method m = clase.getDeclaredMethod("getITelephony");
m.setAccesible(true);
ITelephony it = (ITelephony) m.invoke(tm);
it.supplyPIN("1111");
I have a SecurityException when I try to invoke the method *supplyPIN("1111")*
.
The error message is:
java.lang.SecurityException: Neither user 10066 nor current process has android.permission.MODIFY_PHONE_STATE.
In my Manifest.xml
I have the MODIFY_PHONE_STATE
permission.
Any idea?
Thanks