Page 1 of 1

Stay awake while charging possible?

Posted: 27 May 2016 20:23
by dip
I would like to set my screen timeout to "never" under certain conditions (when device is charged and music is played and bluetooth is connected). While on one device the value "never" exists on another device the maximum timeout is 30 minutes. When I use Automagic to set the screen timeout to "never" it will in fact only be set to this 30 minutes maximum.

I found that in the developer options of Android you can select a checkbox "Stay awake while charging". Can this checkbox be set and unset with Automagic?

Re: Stay awake while charging possible?

Posted: 28 May 2016 13:09
by Martin
You can use action Set System Setting with category Global, name stay_on_while_plugged_in and toggle between 0 (off) and 3 (on when charging over AC and USB).
Alternatively use Execute Root Command with command svc power stayon [true|false|usb|ac|wireless].

Re: Stay awake while charging possible?

Posted: 28 May 2016 13:31
by dip
Both actions require root access (which I don't have). Manually setting the "Stay awake" option in the developer options does not require root access.
Is there a solution in Automagic which also does not require root access?

Re: Stay awake while charging possible?

Posted: 30 May 2016 18:59
by Martin
You can use action Control UI to automate pressing the buttons. The settings app of the device uses permissions that third party apps like Automagic can not receive without root.

Re: Stay awake while charging possible?

Posted: 30 May 2016 19:23
by dip
Thanks for the clarification.