Hi, My phone often does not turn off the screen when I don't use it.
I still have the screen on and consumes battery. Is There a trigger that can sense when phone is not used even with the screen on? Thanks
Trigger when idle
Moderator: Martin
Re: Trigger when idle
Depends how you define "idle".
- Is, say, watching a video and not touching the phone, etc. 'idle''? I would say not
- Is it being on the home screen and not touching it 'idel'? Maybe
- etc.
If the normal screen timeout is not working, you need to investigate why?
- Is, say, watching a video and not touching the phone, etc. 'idle''? I would say not
- Is it being on the home screen and not touching it 'idel'? Maybe
- etc.
If the normal screen timeout is not working, you need to investigate why?
Re: Trigger when idle
the normal screen timeout not works everytime, sometimes the screen doesn't go off.
as you say watching videos is not idle, the trigger must act when phone is not used by any apps on screen
as you say watching videos is not idle, the trigger must act when phone is not used by any apps on screen
Re: Trigger when idle
You can try creating a flow with ui event trigger. Set multiple triggers of ui event. Like Component clicked, component long clicked, focused etc. Set flow execution policy to "Stop the currently executing instance and then execute the newer instance". Add a script to set a global_variable to 30sec after trigger.
Create another flow with global_variable (created from previous flow) as trigger. Use whatever method available for turning screen off.
Create another flow with global_variable (created from previous flow) as trigger. Use whatever method available for turning screen off.
Re: Trigger when idle
I think this won't work if you are, say, watching a video. Maybe you have to have a condition that it's on the home screen too?anuraag wrote: ↑09 Jul 2019 14:35You can try creating a flow with ui event trigger. Set multiple triggers of ui event. Like Component clicked, component long clicked, focused etc. Set flow execution policy to "Stop the currently executing instance and then execute the newer instance". Add a script to set a global_variable to 30sec after trigger.
Create another flow with global_variable (created from previous flow) as trigger. Use whatever method available for turning screen off.
@holymoz: But as I said, I would first get to the bottom of why "the normal screen timeout not works everytime, sometimes the screen doesn't go off". It sounds like a bad app is making this happen (keeping the screen on). Or maybe you have another flow that has left the screen to a very long timeout?
Maybe use a ui event trigger flow as suggested by @anuraag with the action to just explicitly set (i.e. reset) the screen timeout to a low value, but this is putting a plaster over why it's not turning off when it should anyway, not fixing the root problem.
Re: Trigger when idle
Here an extra flow will be need with trigger "app task started" which will disable ui event and global_variable trigger. And "app task ended" will enable them.
Re: Trigger when idle
@holymoz : I agree with Wibbly, you should find the root cause, instead of using Automagic to solve the bad outcome.
But if you still need to have trigger on idle, you can take a look at my screen saver flow : viewtopic.php?f=3&t=6963
This will trigger when you don't touch the screen for some period. But you will have a flow always running background (the sleep action), so it is not feasible to save your battery. I can modify it to glovardt version if you need a longer period, but I think it doesn't worth it. You should investigate the root instead, rather than creating flow for alternative solution.
As pointed by anuraag, you can use app task started/ended to disable/enable the always running flow when opening certain apps.
But if you still need to have trigger on idle, you can take a look at my screen saver flow : viewtopic.php?f=3&t=6963
This will trigger when you don't touch the screen for some period. But you will have a flow always running background (the sleep action), so it is not feasible to save your battery. I can modify it to glovardt version if you need a longer period, but I think it doesn't worth it. You should investigate the root instead, rather than creating flow for alternative solution.
As pointed by anuraag, you can use app task started/ended to disable/enable the always running flow when opening certain apps.
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: Trigger when idle
Thanks to all, will try something and search for the cause