在三星上以编程方式禁用应用程序省电模式 [英] Programmatically disable app power saving mode on Samsung
问题描述
我是消息传递应用程序的开发人员.我的应用程序进入了自动节能模式,该模式可以防止消息通过.
I am the developer of a messaging application. My application get put on an automatic power save mode which prevents messages from getting through.
当我转到三星手机上的应用程序节电"选项(设置"->电池"->应用程序节电"选项)时,可以看到对于某些应用程序(如WhatsApp和Facebook Messenger),此选项为禁用".
When I go to the App Power Saving option on a Samsung phone (Settings->Battery->App Power Saving option), I can see that this option is "Disabled" for certain apps (like WhatsApp and Facebook messenger).
当我全新安装WhatsApp应用程序时,默认情况下,甚至在打开应用程序之前,省电模式都会被禁用.
When I do a clean install of the WhatsApp application, the power saving mode gets disabled by default before I even open the app.
这似乎特定于三星设备Android 6.0.1及更高版本.
This seems to be specific to Samsung devices Android version 6.0.1 and higher.
是否可以默认禁用我的应用程序的省电功能?
Is it possible to disable power saving by default for my application?
推荐答案
You can ask user to ignore battery optimizations: https://developer.android.com/training/monitoring-device-state/doze-standby.html#support_for_other_use_cases
但是您的用例需要接受Google Play验证: https://developer.android.com/training/monitoring-device-state/doze-standby.html#whitelisting-cases
But your use case needs to be acceptable for Google Play validation: https://developer.android.com/training/monitoring-device-state/doze-standby.html#whitelisting-cases
这篇关于在三星上以编程方式禁用应用程序省电模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!