ITeye博客

android autoanswer

kkcheng · 2014-08-29 14:51 · 移动开发 · Markdown

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/

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。