I noticed that on some devices, Epix Pro, and other devices that have flashlight or have models with flashlight, onUpdate is called 10 times when going from sleep to regular mode.
This is causing lag when trying to use the button to activate flashlight, or when switching from the menu and back, especially when the watchface is quite heavy.
This only happens on real devices and not in the simulator.
To reproduce, use the "simple" watchface from the examples, and replace the onUpdate() function with this:
var count = 0 function onUpdate(dc as Dc) as Void { count++; dc.setColor(Graphics.COLOR_BLUE, Graphics.COLOR_BLACK); dc.drawText(120,120, Graphics.FONT_LARGE, count, Graphics.TEXT_JUSTIFY_CENTER); dc.drawText(120,200, Graphics.FONT_LARGE, count2, Graphics.TEXT_JUSTIFY_CENTER); }
Load it on a real device, and switch from regular mode to AOD and back. You can see the number going up by 8-10 every time you switch from AOD to full power, and it goes up by 3 when going from Full power to AOD. Expected would be the number going up by 1 or 2.
Here a video with the above code running on my Epix:
https://photos.google.com/share/AF1QipPhsObcQB6onVA4MWeK9XaVHdWCxFTOXXU-apyMg46oU5blzzfMNyp1Bary9MEPrA?key=aERCVXVaMVNuYS0xOUQ3T0VPQ0dST25hVFdHbUZn
I tested this on 3 devices:
Epix Pro 47mm: Issue happens (8-10x aod -> full, 3x full -> aod)
Quatix 7: Issue Happens (4x always on -> full, 2x full -> aod)
Fr165: No issue here.
In the docs it says "More than one call to onUpdate() may occur during View transitions", but 10x is quite excessive and causing issues.