androidkotlinandroid-servicewear-oswatchface

How to restart Watch Face service programmatically in WearOS?


My WearOS application contains CanvasWatchFaceService, which doesn't restart after, for example, changing permission settings or after I rebuild and reinstalled and launched the app. Unfortunately I can restart it only manually (by long press on a watch face stub then select any other watch face then long press and select my watch face again).

How to recreate watch face service programmatically? Because it looks strange if a user installs the app once again and sees a stub instead of original watch face.

[update] I have three required permissions (by app): Phone, Physical Activity and Sensors, so I conducted experiments and got this:

Watch Face behavior when changing permissions:

  1. Watch face works well without any permissions (since the app is installed for the first time)
  2. Watch face is crashed when all permissions were turned off
  3. Watch face is restarted and works well when phone permission was turned off (all other permissions are granted)
  4. Watch face is restarted and works well when physical activity permission was turned off (all other permissions are granted)
  5. Watch face is restarted and works well when sensors permission was turned off (all other permissions are granted)
  6. Watch face is restarted (3 times after each permissions turning off) and works well: Turned off first permission, opened watch face, turned off second and opened watch face, tuned off third and opened watch face (so all permissions are turned off but watch face works well)
  7. Case: turn off #1 permission then wait 15 sec and turn off #2 permission and wait 15 sec and turn off #3 permission and wait 15 sec then open Watch Face: it works well

Solution

  • On Dec 17 2021 Samsung developers team (after a corresponding ticket to Google) answered that this is a normal platform behavior, and won't be fixed soon