如何选择退出打盹模式的应用程序? [英] How to opt-out an app from Doze mode?
问题描述
如何选择退出版本的Android M打盹模式我的应用程序?
有没有包括在运行时排除从打盹和自动待机选择应用程序的标准方式?
如何从版本的Android M打盹模式退出我的应用程序?
块引用>您不能由任何已知的机制。
有没有包括并有选择地在运行时排除从打盹和经销商模式的应用程序的标准方式?
块引用>在理论上,用户可以切换设置中的忽略优化选项,把应用程序上的应用程序,不应该进入应用待机模式的白名单。这不会影响打盹模式。
当设备打瞌睡,同步和作业是全局断开,把在白名单中的应用程序不改变它的行为他们。这是预期的行为,是缺乏自由使用报警管理器。 (其中的所有这些的关键方面是他们的方式来引起,导致它醒来,将有我们想要持续而打瞌睡的持续时间对电池寿命有显著影响设备唤醒,和任何东西,所以它简直是不允许的。)
在打瞌睡时,AndAllowWhileIdle API允许你唤醒设备在每15分钟最多一次。不打瞌睡,这是提高每分钟一次。当设备处于空闲维护模式下,所有的瞌睡限制被删除(因此AllowWhileIdle可以发生一次一分钟)。
块引用>需要注意的是空闲维护模式为presently无证。我的猜测是,这指的是设备处于空闲状态,但正在充电。
How to opt-out my app from android M DOZE mode ? Is there a standard way to include and exclude apps from DOZE and auto standby selectively at run time ?
解决方案How to opt-out my app from android M DOZE mode ?
You can't by any known mechanism.
Is there a standard way to include and exclude apps from DOZE and auto standby selectively at run time ?
In theory, the user can toggle an "Ignore optimizations" option in Settings, to put the app on a whitelist of apps that should not go into app standby mode. This will not affect doze mode.
Quoting somebody who I believe is Dianne Hackborn:
While the device is dozing, syncs and jobs are turned off globally, putting an app on the whitelist does not change the behavior for them. This is the intended behavior, as is the lack of free use of the alarm manager. (One of the key aspects of all of these is that they are ways to cause the device to wake up, and anything that causes it to wake up will have a significant impact on battery life in the durations we want to last while dozing, so it is simply not allowed.)
While dozing, the AndAllowWhileIdle APIs allow you to wake up the device at most once every 15 minutes; when not dozing this is raise to once every minute. When the device is in idle maintenance mode, all of the doze restrictions are removed (so AllowWhileIdle can happen once a minute).
Note that "idle maintenance mode" is presently undocumented. My guess is that this refers to a device that is idle but is charging.
这篇关于如何选择退出打盹模式的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!