also looking at this
feat(android): the shortcut pair in Zig — ratchet 75 → 73
#171
6 files
+602
-3
| @@ -3258,6 +3258,10 @@ class CraftBridge( | ||
| 3258 | 3258 | |
| 3259 | 3259 | @JavascriptInterface |
| 3260 | 3260 | 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 | ||
| 3261 | 3265 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N_MR1) { |
| 3262 | 3266 | activity.runOnUiThread { |
| 3263 | 3267 | webView.evaluateJavascript( |
| @@ -3313,6 +3317,8 @@ class CraftBridge( | ||
| 3313 | 3317 | |
| 3314 | 3318 | @JavascriptInterface |
| 3315 | 3319 | fun clearShortcuts() { |
| 3320 | if (CraftNative.clearShortcuts(activity)) return | |
| 3321 | ||
| 3316 | 3322 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) { |
| 3317 | 3323 | try { |
| 3318 | 3324 | val shortcutManager = activity.getSystemService(android.content.pm.ShortcutManager::class.java) |