Page 1 of 1

Doze timer

Posted: 04 Feb 2016 11:42
by Wibbly
The latest version of the Greenify app claims to be able to change the Android 6 timer that triggers Doze mode on an unrooted device. Is this something that can be added to Automagic?

Would be good for all those battery-optimization flows we all like to write :-)

Re: Doze timer

Posted: 05 Feb 2016 20:07
by Martin
It sounds like this might be done using an unofficial method. I assume that this is a 'security' issue and will be fixed in an updated Android ROM so I'm not going to invest much time into this.
I'll let you know if I stumble about a way to do this from Automagic.

Re: Doze timer

Posted: 05 Feb 2016 20:12
by Wibbly
OK I understand, thanks. The suggestion is it's some kind of 'internal' API - I don't know it that helps you...

Re: Doze timer

Posted: 07 Feb 2016 20:12
by Martin
Maybe I've found something that could help:
Action Send Broadcast with action set to com.android.server.device_idle.STEP_IDLE_STATE seems to bring the Doze state-machine to the next state. Execute the action about four times when the screen is off and the device is not charging to start Doze mode immediately (steps from ACTIVE->IDLE_PENDING->SENSING->LOCATING->IDLE).
I highly assume that Google missed to protect this broadcast so any app can send it for now but it's likely going to be fixed in an update.

Also check the source for the DeviceIdleController.java if you're interested to know what's going to happen:
https://android.googlesource.com/platfo ... oller.java

Re: Doze timer

Posted: 07 Feb 2016 20:33
by Wibbly
Thanks for investigating Martin :-)