Prevent background service from being killed due to “detect excessive cpu on forked process”

北城余情 提交于 2019-12-05 03:18:41

Unfortunately, this is a OnePlus / OxygenOS feature that will kill any background process based on who-knows what rules in order to give the appearance of a better battery life.

For now, I found a non-code workaround in a GitHub issue that seems to help, but is far from ideal: pin/lock the application on the recents screen.

Was testing my foreground service and realized it was a performance issue mainly CPU. So I enforced performance with the profiler and added to the white list.

Reduced the consumption cpu, ram and battery and its done.

Foreground notification service not working in one plus devices

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