问题
Can anybody let me know how to hold and unhold active phone call?
I am trying to do it using ITelephony.aidl
but unable to hold the call. Here is the code I tried to hold an active call
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
}
}
回答1:
It's quite not possible to attain the holding options with ITelephony.aidl, since there is no such method. It's better to use any methods using the Audio manager to find whether the call is active or not. But the drawback there is that Audio Manager could be used by other applications too. So, there will be a dilemma in knowing the Mode!!
来源:https://stackoverflow.com/questions/11846518/android-how-to-hold-and-unhold-active-phone-call