Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect if Daydream is on?

Is it possible to detect if Daydream is on or off? If so, how?

Edit: To clarify, I looking to read the system setting for DayDream (much like you can for airplane mode and other settings). You can infer that from Intent.ACTION_DREAMING_STARTED and Intent.ACTION_DREAMING_STOPPED, but it's not the same thing.

like image 606
christoff Avatar asked Aug 14 '13 18:08

christoff


2 Answers

This answer says you can use:

Intent.ACTION_DREAMING_STARTED and Intent.ACTION_DREAMING_STOPPED

for broadcast events.

Here is documentation

like image 58
Adam Johns Avatar answered Oct 20 '22 09:10

Adam Johns


I've written a little utility class to get some Daydream settings:

  • Get if Daydream is enabled in the settings
  • Get which Daydream is selected in settings
  • (get if Daydream is possible on this device)

You can find it here: https://github.com/PieterAelse/blendle/blob/master/mobile/src/main/java/com/piotapps/blendle/utils/DayDreamUtils.java

Hope this helps you out.

like image 37
PieterAelse Avatar answered Oct 20 '22 08:10

PieterAelse