Android如何保持和取消挂起活动电话
有人能告诉我如何保持和取消挂起活动电话吗? 我正在尝试使用ITelephony.aidl执行此操作,但无法保持通话。这是我试图保持通话状态的代码Android如何保持和取消挂起活动电话,android,phone-call,telephonymanager,Android,Phone Call,Telephonymanager,有人能告诉我如何保持和取消挂起活动电话吗? 我正在尝试使用ITelephony.aidl执行此操作,但无法保持通话。这是我试图保持通话状态的代码 TelephonyManager tm = (TelephonyManager) CallholdddActivity.this.getSystemService(Context.TELEPHONY_SERVICE); try{ Class<?> c = Class.forN
TelephonyManager tm = (TelephonyManager) CallholdddActivity.this.getSystemService(Context.TELEPHONY_SERVICE);
try{
Class<?> c = Class.forName(tm.getClass().getName());
Method m = c.getDeclaredMethod("getITelephony");
m.setAccessible(true);
com.android.internal.telephony.ITelephony telephonyService = (ITelephony) m.invoke(tm);
telephonyService = (ITelephony) m.invoke(tm);
//telephonyService.silenceRinger();
// here what should i write , i dont know
//System.out.println(a);
}
catch (Exception e) {
// TODO: handle exception
}
}
使用ITelephony.aidl很难获得持有期权,因为没有这样的方法。 最好使用任何使用音频管理器的方法来查找调用是否处于活动状态。但缺点是音频管理器也可以被其他应用程序使用。因此,在了解模式时会遇到一个难题