ReviewOS

also looking at this

craft-native/craft

feat(android): the widget pair in Zig — ratchet 77 → 75

#167
Merged chris wants to merge feat/android-widgets into main
6 files +456 -3
packages/android/templates/CraftBridge.kt.templatemodified+7-0
Changes to packages/android/templates/CraftBridge.kt.template
@@ -3740,6 +3740,11 @@ class CraftBridge(
37403740
37413741 @JavascriptInterface
37423742 fun updateWidget(dataJson: String) {
3743 // Zig answers through the reply channel, so returning here is what
3744 // stops the promise being settled twice. The action is passed across
3745 // rather than rebuilt there — see CraftNative.updateWidget.
3746 if (CraftNative.updateWidget(activity, ".WIDGET_UPDATE", dataJson)) return
3747
37433748 try {
37443749 val data = JSONObject(dataJson)
37453750 val editor = widgetPrefs.edit()
@@ -3782,6 +3787,8 @@ class CraftBridge(
37823787
37833788 @JavascriptInterface
37843789 fun reloadWidgets() {
3790 if (CraftNative.reloadWidgets(activity, ".WIDGET_UPDATE")) return
3791
37853792 val intent = Intent(".WIDGET_UPDATE")
37863793 intent.setPackage(activity.packageName)
37873794 activity.sendBroadcast(intent)