I need to open android device's data connection in my app. My phone is rooted, and its system is android 2.3.5. Unfortunately, the following fails:
// open data connection
Class telephonyManagerClz=TelephonyManager.class;
Method mGetITelephony=telephonyManagerClz
.getDeclaredMethod("getITelephony");
mGetITelephony.setAccessible(true);
Object iTelephony = mGetITelephony.invoke(tm);
Method mEnableDataConn=iTelephony.getClass()
.getDeclaredMethod("enableDataConnectivity");
mEnableDataConn.setAccessible(true);
mEnableDataConn.invoke(iTelephony);
This is the exception displayed in logcat:
It seems that I don't have the MODIFY_PHONE_STATE permission, but I've added it into Manifest.xml yet. What could be the problem?