onSleep getting missed by WatchFace

I have a epix (gen 2) with the AMOLED display, not using the wrist gesture option, and I'm having issues getting my watch face code to properly determine the sleep status in certain situations.

I'm using a variable that is set / cleared on the onEnterSleep() and onExitSleep() functions.  Based on the forums that seems to be the usual method.  This is then used to manage the display between the standard and low power faces.

On this watch, I've noticed a scenario where the the watch face app exits the sleep mode (and calls the onExitSleep() properly) and re-enters the sleep mode without calling noEnterSleep();

It seems to happen when the watch face loses focus.  For example... watch face is in sleep mode as normal.  The watch receives a notification from a phone via BTE, which "wakes' the watch.  onExitSleep() is called, but the display moves to the notification focus.  The low power timeout is only 8 seconds, and while the notification message is still on display, the backlight reduces AS IF the watch is going to sleep mode.  After the 30 sec timeout for the notification, the display changes back to the watch face but the watch face app never received a call to the onEnterSleep() so it displays the standard face with the lower backlight.  It will stay in this indefinitely or until something else happens.

I've seen this on multiple watch face apps, including the one I'm writing myself.  Since the isSleepMode property was phased out, there doesn't seem to be a way in the APIs to verify whether the watch is in sleep mode through code.  So the app can't verify it's in the right mode.

Has anyone else seen this?  Or possibly have any ideas on what could be causing this?  I'm not extremely good at debugging directly on the watch (I'm still very new to Garmin and MonkeyC) and the CIQ simulator doesn't seem to simulate these activities that take focus on the screen.

I would be very interested in anyone else's opinion...

  • Native watch faces are not written in CIQ.  They are written in native code and function differently than CIQ and can do a number of things you can't do in CIQ

  • I can't see your code but in my case isLowPower is not enough I have to use second flag isAOD but maybe because I'd like to not duplicate code.

  • Jim - makes sense.  Especially if the native faces are reading the low power setting directly from the OS or even the hardware.  Then you'd never be off cycle.

    _psx_ - how are you using the isAOD?  Right now my code is reliant only on teh onEnterSleep and onExitSleep calls to track the low power mode.  Are you monitoring some other properties / function calls to track the status of the power?  And wouldn't this method still suffer the same problem... the ONLY way in CIQ to track sleep events in through those two function calls?

  • Install my WF PSX-6 and there is low power indicator   when it lights in means there was no onEnterSleep if greyed was onEnterSleep. You can check how it run during notification/etc.

    Maybe your code doesn't need isAOD because you use "dimming" according to isLowPower - my code need it because the same code drawing mips and amoleds (and in low power user can see AOS).

  • The PSX-6 (which is a really nice WF by the way, very well done!) behaves the same way.  On low power WF view... receive notification, 8 sec later the screen dims to low power, 30 sec later the notification goes away... and the WF that is displayed is the full version with all the detail but at the dimmer light setting.  The low power indicator is lit.

    Pressing the backlight button increases the display brightness to normal, then 8 sec later it goes full into low power by dimming the light intensity and moving to the limited, moving low power display.

  • Probably there is a difference between

    mips

    - high power about 10s

    - low power

    amoled

    - high power about 10s

    - still high power about next XXs but with dimming  screen

    - low power AOD or black screen

    And thx for review Slight smile

  • When I made tests with one of my user to check pairs exit/enter sleep not always was ok. So probably it was that case.

    Have you already install beta?

  • I installed alpha 9.22.  Even though I signed up for beta files, I wasn't getting any pushed beta updates on my device.

    The alpha 9.14 had the same behavior (I installed this one first because I didn't see the newer versions).

    The alpha 9.22 version works correctly!!
    So whatever the issue, the newer versions seem to fix it.

    Thank you to the team here for working with me on this!  I know we didn't exactly find the issue, but certainly apprecaite the opportunity to learn from others about a number of things related to this!