最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

android - Is it possible to put a native GSM call on hold from a VoIP app without being the default dialer? - Stack Overflow

programmeradmin3浏览0评论

I'm developing a VoIP application (in java) and need to suspend an ongoing native GSM call when the user answers an incoming VoIP call (similar to WhatsApp's behavior). However, my app is not set as the default dialer.

Is this functionality supported on the latest Android versions? If so, what APIs or methods can be used to achieve this? Any insights or guidance would be greatly appreciated!

so far i've tried:

  1. using inCallService, seems to require system level permission

  2. getting exclusive AUDIOFOCUS like this:

int result = audioManager.requestAudioFocus(focusRequest);
if (result == AudioManager.AUDIOFOCUS_REQUEST_GRANTED) {
    // Audio focus successfully acquired.
    // Native call audio should be interrupted or ducked.
}

always got me only AUDIOFOCUS_REQUEST_DELAYED

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论