How to know if doze mode is running?

1,876 views
Skip to first unread message

axzx...@gmail.com

unread,
May 12, 2016, 11:30:27 PM5/12/16
to Automate
I have automate in the whitelist, but I don't know how to detect doze mode is enabled or not.

Henrik "The Developer" Lindqvist

unread,
May 13, 2016, 2:28:19 PM5/13/16
to Automate, axzx...@gmail.com
Doze is always enabled, it can't be disabled. The "Not optimized" in battery settings controls "app standby", which is another feature.

There's no block to detect if the device is currently "dozing". I can add a block for it, until then use the Broadcast receive block with action="android.os.action.DEVICE_IDLE_MODE_CHANGED"
https://developer.android.com/reference/android/os/PowerManager.html#ACTION_DEVICE_IDLE_MODE_CHANGED

For "app standby" use action="android.os.action.POWER_SAVE_MODE_CHANGED"
https://developer.android.com/reference/android/os/PowerManager.html#ACTION_POWER_SAVE_MODE_CHANGED
Reply all
Reply to author
Forward
0 new messages