实际上我有两个应用受到影响。一种使用手机作为视频服务器。另一个允许用户下载大文件。我很确定这两者都会受到打瞌睡模式的影响,因为这些操作可能需要几个小时。谷歌似乎正在删除请求列入白名单的应用程序。
那么我的选择是什么?
最佳答案
您可以选择显示一个对话框,引导用户完成禁用打盹模式的步骤。
仅供引用:对于特定的应用程序,可以在设置菜单中简单地禁用打瞌睡模式:
Go to phone Settings. Press Battery. press the Options menu button (in the upper right corner, then press Battery optimization. Press the selector, then press All apps . Battery optimization list appears. After this, press the name of the app for which you want to switch off Doze mode, and in the box that appears, press "Don’t optimize". Once you’re done, select Done.
编辑: 试试这个让用户进入手机的电池设置:
Intent newIntent = new Intent(Intent.ACTION_POWER_USAGE_SUMMARY);
startActivity(newIntent);
关于android - 我的应用程序使用手机作为服务器,我应该如何处理打瞌睡模式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33764024/