问题描述
我开发的自定义语音应用,它能够接听电话。使用这个code处理来电<一href="https://$c$c.google.com/p/auto-answer/source/browse/trunk/src/com/everysoft/autoanswer/AutoAnswerIntentService.java">https://$c$c.google.com/p/auto-answer/source/browse/trunk/src/com/everysoft/autoanswer/AutoAnswerIntentService.java
I am developing a custom telephony application that is able to receive calls.Using this code for handling the incoming callhttps://code.google.com/p/auto-answer/source/browse/trunk/src/com/everysoft/autoanswer/AutoAnswerIntentService.java
不幸的是我的应用程序失去焦点的来电。
Unfortunately my app loses focus on the incoming call.
这是拨出电话的部分解决方案Android-电话应用程序,一直专注于传出和放大器;传入phoneCall
THIS was a partial solution for outgoing callsAndroid- Telephone app that keeps focus on outgoing & incoming phoneCall
怎么样来电?如何保持专注在我的自定义应用程序?
What about incoming calls? How do I keep focus in my custom app?
我猜测这可能涉及到下载和修改源$ C $ C作为简单的访问SDK提供了几乎无法控制内置的手机应用程序。
I am guessing this might involve downloading and modifying the source code as simply accessing the SDK gives little control over the built-in phone application.
推荐答案
既然你作出有关呼出电话的参考是可以接受的,那么你可以把在来电屏幕将显示后不久,前面的活动。在这样困难的是,呼叫状态将变为振铃,然后又摘机,但电话始终无法显示InCallScreen当这些被广播。
Since the reference you made about outgoing calls is acceptable, then you can place an activity in front of the incoming call screen shortly after it displays. The difficulty in doing this is that the call state will change to "RINGING" and then also "OFFHOOK" but the phone has not displayed the InCallScreen when these are broadcast.
就像你提到的岗位,这种解决方案实际上并不嵌入手机功能到应用程序(如web视图进行网页浏览),而是放置在InCallScreen前它显示后不久的活动。
Like the post you referenced, this solution does not actually embed the phone feature into the app (like a webview for web browsing) but rather places an activity in front of the InCallScreen shortly after it displays.
有关来电,你需要推迟发布您的活动,就像这篇文章:
For incoming calls, you need to delay the launch of your activity, like in this post:
Android - 专项新的来电屏幕
您可以在点放任何东西在屏幕上,最困难的部分是确定的延迟时间,以使其满足您的需求(足够慢,从而使InCallScreen有机会推出,但足够快以最小的破坏性)。
You can put anything on the screen at the point, the hard part is determining the lag time so that it meets your needs (slow enough so that the InCallScreen has a chance to launch but fast enough to be minimally disruptive).
除此之外,即使延长AOSP不会帮助,除非你有机会到那里,这将被用来铲除他们或把一个自定义的基础上加以每个物理设备。访问PhoneApp特征不能访问非系统的应用程序(所述com.android.phone包)。
Beyond that, even extending AOSP will not help unless you have access to each physical device where this will be used to root them or put a custom build on them. Access to the PhoneApp features is not accessible to non-system apps (the com.android.phone package).
这篇关于Android的语音应用,它一直专注于来电的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!