Vivoactive 5 - Simple test watch face reverted to another one overnight

Hello,

I made a simple test watch face - the stock "watch face" project with an extra field for HR and a couple of custom fonts:

import Toybox.Graphics;
import Toybox.Lang;
import Toybox.System;
import Toybox.WatchUi;
import Toybox.Activity;

(:background)
class Watchface3View extends WatchUi.WatchFace {

    protected var dimmed;
    protected var width;
    protected var height;

    function initialize() {
        WatchFace.initialize();
        self.dimmed = false;
        self.width = 0;
        self.height = 0;
    }

    // Load your resources here
    function onLayout(dc as Dc) as Void {
        setLayout(Rez.Layouts.WatchFace(dc));
        self.width = dc.getWidth();
        self.height = dc.getHeight();
        System.println("Screen size " + self.width + " x " + self.height);
    }

    function onShow() as Void { }

    // Update the view
    function onUpdate(dc as Dc) as Void {

        var timeField = View.findDrawableById("time") as Text;
        var miscField = View.findDrawableById("misc") as Text;

        //
        var time = System.getClockTime();
        var hour = time.hour;
        if (! System.getDeviceSettings().is24Hour)
        {
            hour = (hour + 23) % 12 + 1;
        }
        var timeStr = Lang.format("$1$:$2$", [ hour, time.min.format("%02d") ]);
        timeField.setText(timeStr);

        //
        var sysStats = System.getSystemStats();
        var miscStr = "";

        if (sysStats.charging)
        {
            miscStr += ";";
        }
        else
        {
            var hr = Activity.getActivityInfo().currentHeartRate;
            miscStr += hr ? hr : "-";
        }
        miscField.setText(miscStr);

        dc.setAntiAlias(true);
        View.onUpdate(dc);
    }

    function onHide() as Void { }

    function onExitSleep() as Void {
        self.dimmed = false;
        self.requestUpdate();
    }

    function onEnterSleep() as Void {
        self.dimmed = true;
        self.requestUpdate();
    }
}

Nothing complicated. layout.xml has a single <layout> with two <label>s.

Built it for Vivoactive 5, put it on the watch, confirmed it worked as expected, then went to bed. Woke up today and the face is replaced by the one I had on before.

Any ideas what happened and why ?

Thanks !

  • Oh, just realized that I also added "Sensor" (and through that "Background") permissions when I was messing with ways to get the HR data. Removed them now along with (:background) annotations for the view and the app, will rebuild and give it a run.

    If this was it though, still wondering why did it cause the face to crash (or be killed?) overnight...

  • On the watch, look in garmin/apps/logs, and if you see ciq_log files, look at them.  If your WF crashed, you'll see details there.

    Also, it could be a setting on your watch.  Check settings>system>display>during sleep.

    If it's set to "sleep", your watch face changes to a simple one during your sleep times.  If it's set to "don't change", your WF will show during that time.

  • > garmin/apps/logs

    Thanks for the pointer. There are several crashes from my earlier experiments, but none from overnight.

    > ... during sleep

    It is set to "sleep" and the problem was related to exactly that - when the watch came out of sleep mode in the morning, it reverted to the wrong watch face.

  • Can you switch back to your WF?  if not, check the ciq_log files again.

  • Yeah, I can.

    This feels like an OS bug to be honest. Something to do with a watch face having Background permission and/or its view/app being annotated with (:background). There's literally nothing else of unusual in the code, it's otherwise just dead simple.

  • If you have permissions set you don't need, turn them off.  It's really more about what shows up for permissions in the app store than anything.

    Here's one of my apps with a background service and what's shown in the app store:

    • Run in the background when it is not active (potentially affecting battery life)

    Are you able to switch back to your watch face?  On the watch, long press the lower button and you get a menu.  Select "Watch Face".  Then you can scroll through all watch faces available on your watch

    Tap the screen when you see the one you want.

  • Are you able to switch back to your watch face?

    "Yeah, I can"

  • And what happens when you do?

  • It works as expected. I also had it on for several hours yesterday, before the watch went into sleep mode, with no issues.

  • Keeps things as they are and check what you see tomorrow after your wake time.