Hi guys,
I switched phones and decided to go this time without root. However, that gives me issues with my AM flows. E.g. what is the action to turn the screen off?
How to turn the screen off (no root)
Moderator: Martin
Re: How to turn the screen off (no root)
Hi,
Either use action Lock Device or turn the screen timeout temporarily to a short value with action Set Screen Timeout or use action Control UI: lockScreen() (Android 9+).
Regards,
Martin
Either use action Lock Device or turn the screen timeout temporarily to a short value with action Set Screen Timeout or use action Control UI: lockScreen() (Android 9+).
Regards,
Martin
Re: How to turn the screen off (no root)
I almost forgot about the lockScreen() feature in Control UI. Yeah, that works fine in Android Pie 9.0, lock the screen and still can unlock using fingerprint
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.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: How to turn the screen off (no root)
Hi again,
Controul UI / lockScreen() is a brilliant idea. Danke!
Only issue with that is, it triggers a Samsung bug in my S10e. If face recognition is turned on as unlock method, calling this function will turn off the device, but it comes back on half a second later on the lock screen. As I am still looking at it, the phone immediately unlocks again and I'm back where I started.
With face recognition completely disabled, this does not happen and the phone stays off after calling lockScreen().
IDK what I will do now. Has anybody an idea how I could fight the bug and suppress the immediate re-turn-on by any Automagic magic?
Controul UI / lockScreen() is a brilliant idea. Danke!
Only issue with that is, it triggers a Samsung bug in my S10e. If face recognition is turned on as unlock method, calling this function will turn off the device, but it comes back on half a second later on the lock screen. As I am still looking at it, the phone immediately unlocks again and I'm back where I started.
With face recognition completely disabled, this does not happen and the phone stays off after calling lockScreen().
IDK what I will do now. Has anybody an idea how I could fight the bug and suppress the immediate re-turn-on by any Automagic magic?
Re: How to turn the screen off (no root)
Do the face unlock count in as Trust Agents feature from play service? If yes, you can disable the face unlock before lockScreen(), enable it shortly after, maybe 3 seconds later. This will ensure the face unlock feature won't triggered immediately after the lockScreen(). Use action Set Disable Keyguard Features, Trust Agents. Try other option too if trust agents doesn't work.
So the flow should do something like this
- Set Disabled Keyguard Features - Trust Agents
- Control UI - lockScreen()
- Sleep 3 seconds
- Set Disabled Keyguard Features - all unchecked. (enable back the face unlock)
So the flow should do something like this
- Set Disabled Keyguard Features - Trust Agents
- Control UI - lockScreen()
- Sleep 3 seconds
- Set Disabled Keyguard Features - all unchecked. (enable back the face unlock)
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.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: How to turn the screen off (no root)
Another good concept. However, it didn't work for me. Tried also to manipulate this in secure settings, but that didn't do the trick either.
For future reference, here is the workaround now working for me:
Installed the Samsung app "One Handed Operation +" which seems to be the only piece of software capable to switch off the device into the exact state I want to have via a swiping gesture. This gesture I can replay in AM with action "Control UI / touchGesture" and it actually does what I want.
For future reference, here is the workaround now working for me:
Installed the Samsung app "One Handed Operation +" which seems to be the only piece of software capable to switch off the device into the exact state I want to have via a swiping gesture. This gesture I can replay in AM with action "Control UI / touchGesture" and it actually does what I want.