ReviewOS

also looking at this

craft-native/craft

feat(android): deleteCalendarEvent — the first action to answer through the channel

#155
Merged glennmichael123 wants to merge feat/android-delete-calendar-event into main
7 files +288 -3
packages/android/templates/CraftNative.kt.templatemodified+17-0
Changes to packages/android/templates/CraftNative.kt.template
@@ -107,6 +107,7 @@ object CraftNative {
107107 private external fun nativeVibrate(activity: Activity, patternJson: String): Boolean
108108 private external fun nativeCancelNotification(activity: Activity, id: String): Boolean
109109 private external fun nativeCancelAllNotifications(activity: Activity): Boolean
110 private external fun nativeDeleteCalendarEvent(activity: Activity, eventId: String): Boolean
110111
111112 /**
112113 * `getDeviceInfo`, or null to use the Kotlin implementation.
@@ -333,4 +334,20 @@ object CraftNative {
333334 false
334335 }
335336 }
337
338 /**
339 * Returns whether Zig *took* the action, not whether the delete worked.
340 *
341 * The first native here that answers asynchronously: the outcome reaches
342 * the page through the reply channel, so true means "do not also run the
343 * Kotlin" and nothing more. Running both would settle the promise twice.
344 */
345 fun deleteCalendarEvent(activity: Activity, eventId: String): Boolean {
346 if (!isAvailable) return false
347 return try {
348 nativeDeleteCalendarEvent(activity, eventId)
349 } catch (e: UnsatisfiedLinkError) {
350 false
351 }
352 }
336353}