Need Help: Turn screen off

Post your questions and help other users.

Moderator: Martin

Post Reply
Seeking_Alpha
Posts: 11
Joined: 21 Jun 2013 13:15

Need Help: Turn screen off

Post by Seeking_Alpha » 13 Sep 2018 11:14

I want to create a shortcut to turn screen off. Using the Lock Device action requires me to input Password/PIN due to my security policies, so I can't unlock using just my fingerprint like I do normally. I am using a Samsung J7 Pro

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

Re: Need Help: Turn screen off

Post by Martin » 14 Sep 2018 08:40

Hi,

Unfortunately there's no good way to achieve this. One option is to set the screen timeout to a very short duration like 5 seconds (with action Set System Setting, category System, name screen_off_timeout, value 5000).
Maybe try to show a black overlay over the entire screen to pretend that it works faster.

On Android 9 and Automagic 1.36 (currently available in the EAP forum) you could use the function lockScreen() in action Control UI to turn the screen off without disabling the fingerprint feature.

Regards,
Martin

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Need Help: Turn screen off

Post by Desmanto » 14 Sep 2018 16:54

If you have root, you can use execute root command

Code: Select all

input keyevent power
or

Code: Select all

input keyevent 26
to emulate the power button.

Without root, you can only grant automagic write secure setting permission and use the method explained by Martin, or can be see here : viewtopic.php?f=6&t=6986
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply