How to make a VOIP app use a carkit like the native call app?

走远了吗. 提交于 2019-12-11 04:15:48

问题


I've been searching for over a week now with no clear solutions.

We are building an ap that can make VOIP calls. The current implementation uses AudioManager.requestAudioFocus to tunnel a voice call over a bluetooth headset or carkit, and can uses the AudioManager state to accept incomming calls or hangup ongoing calls when the accept/hangup button on a headset is pressed. This all works fine.

However, when connected with a carkit that has both an accept and hangup button, the current implementation does nothing when the accept button on the carkit is pressed for an incoming voip call and accepts the call when the reject button is pressed. The carkit display also shows no incoming call.

I want to make the carkit react to our voip app identical as how it reacts to an incoming native call but I can't find anywhere how to do that. From what I've found I believe I need to implement a Bluetooth HFP server on the phone side, and use reflection to access hidden Android API's for that.

Can anyone point me to an example of how to do that? All implementations I can find already do what we do or even less (I looked at the Signal code).

来源:https://stackoverflow.com/questions/47354818/how-to-make-a-voip-app-use-a-carkit-like-the-native-call-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!