【问题标题】:Ending the Out going call结束外出通话
【发布时间】:2012-03-16 07:16:27
【问题描述】:

OutGoingCallEnding

这是我的链接源代码,我想在特定时间结束外出通话。在某个限制时间后,另一个外出通话将继续。

【问题讨论】:

标签: android


【解决方案1】:

要在 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);
  } 
 }

【讨论】:

  • “mTelephonyManager”从哪里来?
【解决方案2】:
package com.android.internal.telephony;

 interface ITelephony {


  boolean endCall();


   void answerRingingCall();


   void silenceRinger();

}

创建一个包装保存它

【讨论】:

    猜你喜欢
    • 2013-11-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多