gpt4 book ai didi

java - 以编程方式接听电话

转载 作者:行者123 更新时间:2023-12-01 04:54:57 25 4
gpt4 key购买 nike

我搜索了很多主题,我知道我的问题以前有人问过。我正在编写一个覆盖默认来电应用程序的应用程序。没有好的解决方案,但我发现最好的解决方案是使用

    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");

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");

但它并不总是有效。另一种使用电话服务的方法不适用于 Android 2.3+ 版本。我想知道像 Ultimate Call Screen 这样的应用程序如何接听电话。有什么想法吗?

最佳答案

http://code.google.com/p/auto-answer/source/browse/trunk/src/com/everysoft/autoanswer/AutoAnswerIntentService.java

他们通过调用蓝牙服务并假装有人按下手机上的接听按钮来进行欺骗。

关于java - 以编程方式接听电话,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14348933/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com