How to detect System settings changes on device?

My WF is not behaving the same way on a device as it does in the simulator when System Settings (time format, language, units, etc) are changed.

In the simulator the WF gets called in onLayout which allows it to refresh using the new System Settings.  But on the device, onLayout is not called.

It seems that onSettingsChanged is called only if the WF settings changed but not when System Settings changed.

Is there another way to detect System Settings changes?  What am I missing?

Thanks,

Pete

  • Sim or real device?

    On my f6p runs as I've described.

    On device rather impossible, system reload all strings for system and apps.

  • My WF is not behaving the same way on a device as it does in the simulator when System Settings (time format, language, units, etc) are changed.

    You would have to constantly read any of those things which you are interested in (time format,  language, units), by calling getDeviceSettings() (for example) in onUpdate(). I don't know what the battery impact would be for this.

  • You can call getDeviceSettings() and save it in a variable at the start of onUpdate.  Then you can use reference it throughout the screen update.  That will have less of an impact on battery life but you will still be able to reflect the system level changes whenever the screen gets refreshed.

    onSettingsChanged only applies to the app settings in GCM, not system settings as the system already keeps the getDeviceSettings updated in the background.  To get the latest settings you need to call getDeviceSettings again.

  • You can call getDeviceSettings() and save it in a variable at the start of onUpdate.  Then you can use reference it throughout the screen update.  That will have less of an impact on battery life but you will still be able to reflect the system level changes whenever the screen gets refreshed.

    Good point. I wasn't actually suggesting calling getDeviceSettings() throughout onUpdate(), but just once per onUpdate(), as you outlined.

  • I suggesting to call getDeviceSettings only this moment you can expect that member can change during wf lifetime e.g.

    phoneConnected

    But caching everything what is const (like screenXXX) is wasting of time/processor/battery.

  • I think something to take in account here is how often a user will change one of these settings.  Once something like 12/24 hour is set for a device, it may never change again,  And if it is changed, it could very well be done on the device itself, and not by way of GCM (then the watch face gets restarted in most cases, but onShow should run every time this happens)  So if you save the results of getDeviceStatus() in onShow it should work in many cases of something that doesn't happen that often to begin with.  Worst case the new setting would be used by just moving to a glance/widget and back to the watch face or even when the next notification occurs.  Doing the call even once each time onUpdate is called is 1400 (or more) unneeded calls every day

    If you are displaying something that does change often, like phoneConnected, this clearly won't work but would if you only care about things like 21/24hr and temperatureUnits it would..

  • I've confirmed this, like the unstall/update crashes due to resources, is what is causing my issues.

    I mis-spoke early, changing the language works fine on the Sq and Fenix6 and it works as you describe.  The app is terminated and restarted.

    However, on the Epix, when the app is restarted, it fails, but the old instance is also not terminated.  This is why I see the old language displayed!  If I re-select the WF it works fine; showing the correct language.

    So, yet another Epix FW bug...  Wasted 2+ hours chasing this down Disappointed

  • unfortunately it crushes also sometimes after exitsleep 

  • The lifecycle of a watch faces is different on some, if not all CIQ 4 devices.  They don't start up and end in the same way as earlier devices do,  That's why I mentioned reading the device settings in onShow.

    What you are seeing on the Epix2 you'll also see on other devices like the f7, and if I recall, the fr255 and 955.

    It's not really an epix2 bug but "by design".