【发布时间】:2012-03-16 07:16:27
【问题描述】:
这是我的链接源代码,我想在特定时间结束外出通话。在某个限制时间后,另一个外出通话将继续。
【问题讨论】:
标签: android
这是我的链接源代码,我想在特定时间结束外出通话。在某个限制时间后,另一个外出通话将继续。
【问题讨论】:
标签: android
要在 android 中结束通话,请在您的项目中添加 ITelephony.aidl 并调用 endCall() 方法,如下所示:
private void endCall() {
//iTelephony
Class<TelephonyManager> c = TelephonyManager.class;
Method getITelephonyMethod = null;
try {
getITelephonyMethod = c.getDeclaredMethod("getITelephony",(Class[]) null);
getITelephonyMethod.setAccessible(true);
ITelephony iTelephony = (ITelephony) getITelephonyMethod.invoke(mTelephonyManager, (Object[]) null);
iTelephony.endCall();
Log.v(this.getClass().getName(), "endCall......");
} catch (Exception e) {
Log.e(this.getClass().getName(), "endCallError", e);
}
}
【讨论】:
package com.android.internal.telephony;
interface ITelephony {
boolean endCall();
void answerRingingCall();
void silenceRinger();
}
创建一个包装保存它
【讨论】: