2
내 전화가 전화에 자동으로 응답 것을 만들려고 노력하지만, 구글은이 방법에 대한 사용 권한을 제거 모양입니다 :Android : 전화에 자동으로 응답하는 방법?
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);
telephonyService.silenceRinger();
telephonyService.answerRingingCall();
그래서 내가 여기에 다른 방법을 찾을 : http://code.google.com/p/auto-answer/source/browse/trunk/src/com/everysoft/autoanswer/AutoAnswerIntentService.java
// Simulate a press of the headset button to pick up the call
Intent buttonDown = new Intent(Intent.ACTION_MEDIA_BUTTON);
buttonDown.putExtra(Intent.EXTRA_KEY_EVENT, new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_HEADSETHOOK));
context.sendOrderedBroadcast(buttonDown, "android.permission.CALL_PRIVILEGED");
// froyo and beyond trigger on buttonUp instead of buttonDown
Intent buttonUp = new Intent(Intent.ACTION_MEDIA_BUTTON);
buttonUp.putExtra(Intent.EXTRA_KEY_EVENT, new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_HEADSETHOOK));
context.sendOrderedBroadcast(buttonUp, "android.permission.CALL_PRIVILEGED");
그러나 아무튼 너무 일하지 마라. 내가 놓친 것은 무엇입니까?
[Manifest에 적절한 권한을 추가 했습니까?] (http://code.google.com/p/auto-answer/source/browse/trunk/AndroidManifest.xml) – adneal
예, 물론 그랬습니다. 심지어 내 휴대 전화에 그 응용 프로그램을로드하지만 너무 작동하지 않습니다. – user758030
2.3.3에서도 작동합니까? – user1163234