Check if AOD is enabled / Screen is off.

Is there a way to check if AOD mode is enabled on the watch in a watch face?

What I've done / want to do:

Made a variable that I set when onEnterSleep triggers. E.g. lowPwrMode = true;
Check this variable in onUpdate.

If AOD mode is enabled, draw something simple.
If AOD is not enabled, draw nothing, since the screen is off anyway and it would just use battery.

Toybox.System.getDisplayMode() == Toybox.System.DISPLAY_MODE_OFF doesn't seem to be working as expected. I have a simple event log implemented and don't see the message for it. I'm testing on an actual device - FR165M. When testing in the sim onUpdate doesn't seem to get called at all when I change the display to be off.

Does requiresBurnInProtection change depending on whether AOD is enabled?

Is there some other way to check so I can skip drawing anything in the scenario I mentioned?

Thanks Slight smile

  • You can have this effect today by just checking requiresBurnInProtectionin in low power for AMOLED devices and draw something simple.  If AOD is off with an amoled display, the screen will stay blank on the real device.

    I tend to keep AOD off as it has a very noticeable impact on battery.  See this thread for a sample that works on both MIP and AMOLED.

    https://forums.garmin.com/developer/connect-iq/f/discussion/349473/simple-example-wf-that-shows-a-bunch-of-things

  • I have a Venu3 with AOD on, it last 4-5 days. In lowpower mode I draw a very simple analog interface, the update function is only called the first whole minute and after that once a minute. During the sleeping schedule the display is always turned off on the Venu3 during lowpower mode. You can't test if it's off cause your code will not be invoked when it's off.

    Note, I don't use background services, things might be different there.

  • That's what I saw in the simulator, and it looks like that's how it works on the watch as well when AOD is off. The gap between 11:49 and 11:52 is when the screen was off and onUpdate doesn't get called. So, there isn't anything else required to optimize that part of it :) It does mean that you can't use the onUpdate as a background process to do things like log the battery level, etc.

    If AOD was enabled then onUpdate would be called once a minute.