- I have not seen this specific request.
- Screen Timeout Condition
- I am looking for a condition that will pair well with the Set Screen Timeout Action. I would like to ask the current state of the screen time out setting (Never, 30s, 10s, Is not #s, Is #s, etc).
Here is an example of the flow I would like to create.
Quick Settings tile ->
-------------Is Screen Timeout "Never"? ->
--------------------------------Yes -> Set Screen Timeout to "30s"
--------------------------------No -> Set Screen Timeout to "Never"
Screen Timeout Condition
Moderator: Martin
- digitalstone
- Posts: 342
- Joined: 21 Oct 2017 12:36
- Location: The Netherlands
Re: Screen Timeout Condition
My guess is:
That the Android api only is able to receive a number and then set that number as the timeout.
Getting back a value from, what has been set inside the system, is not what the api is capable of.
That the Android api only is able to receive a number and then set that number as the timeout.
Getting back a value from, what has been set inside the system, is not what the api is capable of.
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)
Re: Screen Timeout Condition
Ahhh, ok. That sounds logical.digitalstone wrote:My guess is:
That the Android api only is able to receive a number and then set that number as the timeout.
Getting back a value from, what has been set inside the system, is not what the api is capable of.
I don't want to derail this feature request, but I am looking for a way to make my example flow a reality even if it isn't identical.
- digitalstone
- Posts: 342
- Joined: 21 Oct 2017 12:36
- Location: The Netherlands
Re: Screen Timeout Condition
You could always make use of a global variable.
After each screen timeout action, just set a global variable with a script to match the number you just set.
Then whenever you need to know the timeout value, from any flow at all, you can just request that global variable instead.
This would be my alternative method.
Although i need to say that i'm still not sure about the api limitation i mentioned earlier.
Martin would definately know and most probably Desmanto as well.
After each screen timeout action, just set a global variable with a script to match the number you just set.
Then whenever you need to know the timeout value, from any flow at all, you can just request that global variable instead.
This would be my alternative method.
Although i need to say that i'm still not sure about the api limitation i mentioned earlier.
Martin would definately know and most probably Desmanto as well.
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)
Re: Screen Timeout Condition
digitalstone wrote:You could always make use of a global variable.
After each screen timeout action, just set a global variable with a script to match the number you just set.
Then whenever you need to know the timeout value, from any flow at all, you can just request that global variable instead.
This would be my alternative method.
Although i need to say that i'm still not sure about the api limitation i mentioned earlier.
Martin would definately know and most probably Desmanto as well.
Excellent. Thank you for that. I will look into your suggestion as a solution while I wait for a definitive answer on the original request.
Re: Screen Timeout Condition
You want to check the current screen timeout setting? Use action Init Variable System Setting, Category : System, Name : screen_off_timeout (just search "timeout" in the ellipsis), save to variabel setting. Evaluate this setting using expression and branch the flow accordingly.
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: Screen Timeout Condition
I actually used the global variable method and it works great!
At least I have options now.
Thank you for all your guidance!
At least I have options now.
Thank you for all your guidance!
- Attachments
-
- Screenshot_20180427-134852.png (181.16 KiB) Viewed 16096 times