Stay awake while charging possible?

Post your questions and help other users.

Moderator: Martin

Post Reply
dip
Posts: 10
Joined: 22 May 2016 16:47

Stay awake while charging possible?

Post by dip » 27 May 2016 20:23

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?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Stay awake while charging possible?

Post by Martin » 28 May 2016 13:09

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].

dip
Posts: 10
Joined: 22 May 2016 16:47

Re: Stay awake while charging possible?

Post by dip » 28 May 2016 13:31

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?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Stay awake while charging possible?

Post by Martin » 30 May 2016 18:59

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.

dip
Posts: 10
Joined: 22 May 2016 16:47

Re: Stay awake while charging possible?

Post by dip » 30 May 2016 19:23

Thanks for the clarification.

Post Reply