• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Daydream After 30 Seconds Inactivity

Arcendus

Lurker
I've managed to parse together the following Profile for activating Daydream after 30 seconds of inactivity, which I plan to use (along with adjusting Display Timeout accordingly) as a clock in my car:

Event: AutoInput UI Action Reacting to clicks on the Android UI [AutoInput Plugin]

Tasks:

1. Variable Set: Name %count To 0
2. If: %SCREEN eq on, Label: Loop
3. Variable Add: Name %count Value 1
4. Wait: 1 Seconds
5. If: %count eq 30
6. Launch App: App Daydream
7. Else If: %count > 10
8. Variable Set: Name %count To 0
9. End If
10. Goto: Type Action Label Loop
11. End If

Two problems with this:
  1. This Profile never pauses the advancing of %count. It just triggers on the Event (AutoInput UI Action) and counts non-stop until 11, then resets. Well, I need % count to reset to 0 when the screen is touched at all. Theoretically this could be accomplished by having another Profile with the same Event that sets %Count to 0 (after being made into a global variable), but...

  2. I'm just now realizing that AutoInput UI Action is restricted to when something is actually pressed--so a scroll will not reset the timer. Which won't work for me, because I need this to function basically the same as display timeout, but with a Daydream instead of screen sleep.
Feel like I'm losing my mind a bit :) So any help with this, or a simpler alternative would be greatly appreciated.
 
Well, I need % count to reset to 0 when the screen is touched at all.
Set collision detection to "abort existing task". That way if you touch the screen while the task is active, the existing task gets killed and replaced with a new one that starts off setting count to 0.

But as far as your concern #2 I'm not sure.

How about this.
Use the built-in (android settings) display time out to turn off screen after 30 seconds of inactivity,
Then set up a profile to launch daydream upon screen off event​

Or maybe this app daydream can't wake the screen back? Do you have root?
 
Last edited:
Set collision detection to "abort existing task". That way if you touch the screen while the task is active, the existing task gets killed and replaced with a new one that starts off setting count to 0.

But as far as your concern #2 I'm not sure.

How about this.
Use the built-in (android settings) display time out to turn off screen after 30 seconds of inactivity,
Then set up a profile to launch daydream upon screen off event​

Or maybe this app daydream can't wake the screen back? Do you have root?

I'd love it if Daydream could launch on screen off, but sadly whenever I've tried this it's unable to wake the screen. It would certainly be a whole lot easier if this worked.

I do have root (systemless).

And thanks! Changing the collision detection did the trick for resetting %count. I'd still ideally like to find an Event trigger that contains any kind of touches at all, but in the meantime having the count reset on UI clicks is certainly better than nothing.
 
There are a lot of ways to turn the screen on, although it depends on your device or operating system.

Try a popup command with 1 second timeout. Some people says that works to turn the screen on, even without root.

Also you can emulate a keypress with root:
shell input keyevent 26 (and check "use root")
That emulates a press of the powerbutton,which should turn the screen on....
On my phone that wakes the phone to a semi-lock screen which requires me to emulate swipe up.
I can emulate swipe up with shell input swipe X1 Y1 X2 Y2
where x1 y1 and x2 y2 are beginning and end of the swipe. If you need help figuring out the cooridnate locations, go to decveloper options and temporarily enable "show x y coordinates" and tap around on your screen.​

secure settings plugin will work to turn on screen also (needs root). I'd keep this as last resort... don't want to give root access to more apps than you need to.

there may be more ways: google "how to turn on my screen with tasker"
 
Back
Top Bottom