`
kkcheng
  • 浏览: 39884 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类

android autoanswer

 
阅读更多
http://code.google.com/p/auto-answer/

Here is a code snippet to trigger an answer for the incoming call:

private void answerPhoneAidl(Context context) throws Exception {
// Set up communication with the telephony service (thanks to Tedd's Droid Tools!)
TelephonyManager tm = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
Class c = Class.forName(tm.getClass().getName());
Method m = c.getDeclaredMethod("getITelephony");
m.setAccessible(true);
ITelephony telephonyService;
telephonyService = (ITelephony)m.invoke(tm);
// Silence the ringer and answer the call!
telephonyService.silenceRinger();
telephonyService.answerRingingCall();
}


http://davidtpate.com/2014/02/23/auto-answering-calls-on-android/
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics