Action: turn off screen (not lock device)

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Locked
Daisy666
Posts: 10
Joined: 13 Sep 2016 02:38

Action: turn off screen (not lock device)

Post by Daisy666 » 15 Oct 2016 17:33

Hi Martin and everyone,

I wonder if action "screen off" can be made available. To be clear, what I want is simply turning off thr screen but not NECESSARILY also lock the device (they are two different things).

I know action "Lock Device" has been suggested to support this type of request before, but there is one major disadvantage: after action "lock device", the phone cannot be turned back on using fingerprint recognition. It prompts "Locked by System Administrator" and asked for PIN or pattern to unlock, which is really inconvenient.

Thanks for reading! Please advise.

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Action: turn off screen (not lock device)

Post by MURTUMA » 15 Oct 2016 18:07

Generally it is impossible to actively turn screean off on Android without locking it. This is due to how roms itself works and can't be affected by third party apps. If your device is rooted, it might be possible to create some workaround by disabling lockscreen security but I have not yet found any feasible solution.

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

Re: Action: turn off screen (not lock device)

Post by Martin » 16 Oct 2016 18:15

On a rooted device, you can try to turn the screen off with Execute Root Command: input keyevent POWER to simulate pressing the power button.

Regards,
Martin

Daisy666
Posts: 10
Joined: 13 Sep 2016 02:38

Re: Action: turn off screen (not lock device)

Post by Daisy666 » 30 Oct 2016 12:33

Thanks Martin!

User avatar
heilong
Posts: 77
Joined: 18 Oct 2016 15:20

Re: Action: turn off screen (not lock device)

Post by heilong » 12 Nov 2016 11:55

Martin wrote:On a rooted device, you can try to turn the screen off with Execute Root Command: input keyevent POWER to simulate pressing the power button.
Like they say, everything genius is simple. I've found this approach works quite well in many programs that support macros (e.g. Far file manager for Windows). Doing something by simulating what the user would do is sometimes much simpler than programming scripts using the provided macro API.

Tom
Posts: 1
Joined: 04 Sep 2017 12:08

Re: Action: turn off screen (not lock device)

Post by Tom » 05 Sep 2017 21:12

The "screen off" action is actually implemented in Nova launcher. It has two options for lock screen action:

1) device administrator (no fingerprint unlock possible)
2) delayed lock (shows black screen for 5s) - fingerprint reader can unlock device.

The second option works well (no need for root) and it would be nice to have "delayed lock" in Automagic!

Regards,
Tom

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

Re: Action: turn off screen (not lock device)

Post by Martin » 06 Sep 2017 20:01

I'm not sure how the feature works in Nova but you could achieve something similar by setting the screen off timeout temporarily to a very short duration. The action allows to go down to 15s. Alternatively you could use an action Set System Setting with category System, Name screen_off_timeout and a value like 5000 (five seconds in milliseconds).

Regards,
Martin

Locked