Prevent Watch Face from going into Full Power Mode ?

Former Member
Former Member
I would like to make sure that my Vivoactive HR does not go into High Power mode ?

Is there any way I can prevent it from doing so. It is messing up my watch face.
  • You can't stop a watchface from dropping out of low power mode, but you may be able to get around that.

    using onEnterSleep() and onExitSleep() in your watchface, you can tell when you enter and leave low-power mode. Set a boolean as to your state there.

    Then in onUpdate(), you check that boolean. If you're in low-power mode, just go on and do your thing.

    if you're not in low power mode, look at the time and if seconds is not zero, return and don't do anything. (this is to handle not being in low power mode when you would normally get an onUpdate() so you still do the onUpdate() code at the "top of the minute".
  • if you're not in low power mode, look at the time and if seconds is not zero, return and don't do anything. (this is to handle not being in low power mode when you would normally get an onUpdate() so you still do the onUpdate() code at the "top of the minute".


    I'm not certain, but that seems like a very bad idea. If the user returns to the watch face, the seconds value would likely be non-zero (~98% of the time) and would not be in low power mode. If you don't take that into account, it could be up to 59 seconds before the watch face is drawn. Of course you could set a flag in onShow() to indicate that this is the first time the face is being drawn, but it still seems like you could easily get into a situation where the screen isn't redrawn for more than a minute.

    It seems that it would make more sense to do this...

    class MyWatchFace extends Ui.WatchFace
    {

    // true indicates that the watch face state has changed since the last
    // call to onUpdate. if it is true, we should redraw.
    hidden var mChanged;

    // true indicates that the watch face is in low power mode. if it is true,
    // we should redraw.
    hidden var mSleeping;

    function initialize() {
    WatchFace.initialize();
    }

    function onEnterSleep() {
    mSleeping = true;
    mChanged = true;
    Ui.requestUpdate();
    }

    function onExitSleep() {
    mSleeping = false;
    mChanged = true;
    Ui.requestUpdate();
    }

    function onShow() {
    mSleeping = false;
    mChanged = true;
    }

    function onUpdate(dc) {

    if (!mChanged && !mSleeping) {
    return;
    }

    mChanged = false;

    // draw
    }
    }


    My question is why?

    Travis
  • True Travis. I missed that one! (still on my first coffee of the day!). You also might be able to just set the value of the boolean to be "in low power mode in initialize()/onShow(), so the next onUpdate() runs with a flag for the "special case" of not being on the "0" seconds, as you also need to consider the case where you're not in low power mode and the "every minute" call to onUpdate() would occur when the wf is not in low power. (if you actually only want onUpdate() to run every minute every time but the first time after onShow())

    If I wanted something to only run once a minute, I'd probably just do it as a watch-app, and go with my own timer.
  • Former Member
    Former Member over 8 years ago
    It is not the end of the world .. I just posted a comment in my watch face download page to explain why they may see the display updating.

    I should note .. I do not mind it showing the seconds other than 00, that is not my issue. The issue is that it updates A LOT .. as it thinks I am doing a gesture and pops into high power mode. I want it only to update once a minute .. period. I know that most people want more updates .. not in this case, it pretty much looks stupid doing all the updating.



    In my case the Elapsed and Frequency keep updating at different times than the other items. It is just annoying. Oh .. the above is a simulated screen shot .. not real data as the simulator does not do well in this case.

    Thanks
  • Former Member
    Former Member over 8 years ago
    I lied .. it is still annoying. I really wish there was a way to turn off gestures in your watch face. I am going to try Travis code above to see if it works for me. ;-)

    Edit .. thank you Travis, your code is working well. :)