该ITelephony接口是内部接口,因此您无法获得对其的标准引用。您可以一直使用反射,即
TelephonyManager tm = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);Method m1 = tm.getClass().getDeclaredMethod("getITelephony");m1.setAccessible(true);Object iTelephony = m1.invoke(tm);Method m2 = iTelephony.getClass().getDeclaredMethod("silenceRinger"); Method m3 = iTelephony.getClass().getDeclaredMethod("endCall"); m2.invoke(iTelephony);m3.invoke(iTelephony);但是,无论哪种方式,这些方法都需要MODIFY_PHONE_STATE权限,而该权限只能授予系统应用程序。因此,恐怕它还是不管用。



