Android 如何以编程方式接听电话
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2765980/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to programmatically answer a call
提问by Gonzalo Perr
I know this has been asked before, but at this time the answer of the post is not true. Vringo and other apps does answer the phone by pressing a button on their app, so there must be a way to do it.
我知道以前有人问过这个问题,但此时帖子的答案是不正确的。Vringo 和其他应用程序确实通过按下其应用程序上的按钮来接听电话,因此必须有办法做到这一点。
Anyone has a suggestion?
有人有建议吗?
回答by Dobromir
Check out this source:
看看这个来源:
They send a Bluetooth "keydown" event to answer the call!
他们发送一个蓝牙“keydown”事件来接听电话!
回答by user1770426
This solution is 'funny', it 'almost' works on my HUAWEI Y300 (4.1.1) but on my LG E410 Swift L1 (4.1.2) not.
这个解决方案很“有趣”,它“几乎”适用于我的 HUAWEI Y300 (4.1.1),但不适用于我的 LG E410 Swift L1 (4.1.2)。
On HUAWEI it works with KeyEvent.ACTION_UP, when on LG there is no reaction for ACTION_UP event. From other side, on HUAWEI the ACTION_DOWN event does not answer a call, but on LG it rejects it.
在华为上,它与 KeyEvent.ACTION_UP 一起工作,在 LG 上时,对 ACTION_UP 事件没有反应。另一方面,在华为上,ACTION_DOWN 事件不接听电话,但在 LG 上,它拒绝接听电话。
So different models of a devices have different reactions.
所以不同型号的设备会有不同的反应。
Someone has some updates in this issue ? Is there an another working solution, which behaves in same way for all mobile phones, and does not require from a device to be rooted ?
有人在这个问题上有一些更新吗?是否有另一种可行的解决方案,它对所有手机的行为方式都相同,并且不需要从设备获得 root 权限?