Stopping/detecting daydream

Post your questions and help other users.

Moderator: Martin

Post Reply
Etchings13
Posts: 2
Joined: 10 Mar 2015 14:42

Stopping/detecting daydream

Post by Etchings13 » 10 Mar 2015 14:47

I know we can automagically start the daydream service, but is there a way to end it or at least detect when it is running? For example I would like the phone to do certain tasks but only when daydream is active.

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

Re: Stopping/detecting daydream

Post by Martin » 10 Mar 2015 18:47

Hi,

You can use trigger General Broadcast with field ACTION set to android.intent.action.DREAMING_STARTED resp. android.intent.action.DREAMING_STOPPED to detect the daydream. The two actions are also listed when using the [...]-button so you don't have to type it manually.
You could set a global variable to true/false when you need to check if the device is currently dreaming in another flow.

Action Turn Screen On should wake the device from dreaming.

Regards,
Martin

Etchings13
Posts: 2
Joined: 10 Mar 2015 14:42

Re: Stopping/detecting daydream

Post by Etchings13 » 11 Mar 2015 01:09

Thank you! Exactly what I was looking for.

Post Reply