Android VOIP applications behavior in Doze mode

懵懂的女人 提交于 2019-12-07 02:52:06

问题


I'm working on legacy VOIP application on Android. It doesn't use Google Cloud Messaging technology right now, but just keeping its own TCP connection forever.

Recently Google has introduced its Android M preview release with Doze mode

So the question: is there any workaround how the app can receive incoming calls/messages in Doze mode without redesigning the whole system to use GCM?


回答1:


You may use ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS to ask the user permission to be ignored by battery optimization. However, double check Optimizing for Doze and App Standby, it seems to be allowed only for enterprise VoIP/IM (see questions #33114063 and #31154128)




回答2:


No, GCM seems to be the only way. See a great analysis of the problems with doze mode including network and GCM here: https://commonsware.com/blog/2015/06/03/random-musing-m-developer-preview-ugly-part-one.html



来源:https://stackoverflow.com/questions/31604093/android-voip-applications-behavior-in-doze-mode

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