2

Yesterday Samsung published an update for the Galaxy Watch4. Since then I am being flooded by users' emails saying that my watch face is crashing and is unusable. The crash happens when the watch switches between normal and ambient mode.

According to some articles published today (https://www.xda-developers.com/galaxy-watch-4-update-breaking-watch-faces) the WatchFaceService.Engine is not supported any longer or broken in the new update.

What is confusing, is that while my watch face crashes, other watch faces simply don't get updated in ambient mode, because apparently onTimeTick() is not being called. But I still cannot figure out how to avoid the crash. The debug information only says "java.lang.RuntimeException: eglCreateWindowSurface failed", but does not point to any line in my code:

2022-02-11 11:21:55.612 4652-4652/com.xxxx.mywatchface E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.xxxx.mywatchface, PID: 4652
java.lang.RuntimeException: eglCreateWindowSurface failed
    at android.support.wearable.watchface.Gles2WatchFaceService$Engine.createWindowSurface(Gles2WatchFaceService.java:202)
    at android.support.wearable.watchface.Gles2WatchFaceService$Engine.onSurfaceChanged(Gles2WatchFaceService.java:300)
    at android.service.wallpaper.WallpaperService$Engine.updateSurface(WallpaperService.java:1082)
    at android.service.wallpaper.WallpaperService$Engine.reportVisibility(WallpaperService.java:1296)
    at android.service.wallpaper.WallpaperService$Engine$3.onDisplayChanged(WallpaperService.java:1439)
    at android.hardware.display.DisplayManagerGlobal$DisplayListenerDelegate.handleMessage(DisplayManagerGlobal.java:767)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:246)
    at android.app.ActivityThread.main(ActivityThread.java:7690)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:995)

Does any body know more about this? Should WatchFaceService not longer be supported, what is the alternative to it?

go3d
  • 443
  • 3
  • 11

1 Answers1

1

That's a broken release of a firmware update by Samsung.
I performed a few tests regarding this issue.
My conclusion is that they "blocked" on the firmware layer, the lock request of the CPU - now, a process that requests a CPU lock is ignored.
I am not familiar with the onTimeTick() method of the watch face API, but I guess it requests CPU lock to update the GUI.
According to the documentation, This is how a process claims a CPU lock, and now, after this update, those lines of code gets ignored:

Kotlin Code:

val pm = getSystemService(POWER_SERVICE) as PowerManager
wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "awake")
wl.acquire(
    MainActivityModel.convertDegreesToMilliseconds(rotationValue)
        .toLong()
)

Maybe you can find more information or an update about a hotfix here:

https://forum.developer.samsung.com/c/watch-face-studio/49

Jonathan Applebaum
  • 5,738
  • 4
  • 33
  • 52
  • 1
    Thanks Jonathan! Interesting findings! The forum has indeed some further information. This seems to be a known problem. Hopefully Samsung fixes this very soon! – go3d Feb 16 '22 at 04:12
  • 1
    Hopefully they will fix it soon, I have already been late today because `onTimeTick()` is not beeng called ): – Jonathan Applebaum Feb 16 '22 at 07:47
  • Any ideas of how I could at least avoid the watch face crashing when returning from ambient or screen-off mode? – go3d Feb 19 '22 at 17:05
  • 1
    Maybe ask this question here: https://forum.developer.samsung.com/t/bug-long-text-complication-next-event-aod-with-latest-gw4-update/18797/51 or here: https://forum.developer.samsung.com/t/what-the-why-aod/18814/21 I wish I could help you but I am not familiar with the watch face API (I am developing apps). I hope you will find a solution as soon as possible, good luck. – Jonathan Applebaum Feb 19 '22 at 17:31