ReviewOS

also looking at this

craft-native/craft

feat(android): the shortcut pair in Zig — ratchet 75 → 73

#171
Merged chris wants to merge feat/android-shortcuts into main
6 files +602 -3
packages/android/templates/CraftBridge.kt.templatemodified+6-0
Changes to packages/android/templates/CraftBridge.kt.template
@@ -3258,6 +3258,10 @@ class CraftBridge(
32583258
32593259 @JavascriptInterface
32603260 fun setShortcuts(shortcutsJson: String) {
3261 // Zig answers through the reply channel, so returning here is what
3262 // stops the promise being settled twice.
3263 if (CraftNative.setShortcuts(activity, shortcutsJson)) return
3264
32613265 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N_MR1) {
32623266 activity.runOnUiThread {
32633267 webView.evaluateJavascript(
@@ -3313,6 +3317,8 @@ class CraftBridge(
33133317
33143318 @JavascriptInterface
33153319 fun clearShortcuts() {
3320 if (CraftNative.clearShortcuts(activity)) return
3321
33163322 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
33173323 try {
33183324 val shortcutManager = activity.getSystemService(android.content.pm.ShortcutManager::class.java)