aboutsummaryrefslogtreecommitdiffstats
path: root/src/android.h
diff options
context:
space:
mode:
authorPo Lu2024-03-11 21:40:47 +0800
committerPo Lu2024-03-11 21:41:14 +0800
commita7a37341cad230448e487d0ffa343eeeb8a66a65 (patch)
treeab06b5826c5ae7bdd5b3dcc85b3ecba8dbee8c84 /src/android.h
parent75cfc6c73faa1561018b1212156964a7919c69fe (diff)
downloademacs-a7a37341cad230448e487d0ffa343eeeb8a66a65.tar.gz
emacs-a7a37341cad230448e487d0ffa343eeeb8a66a65.zip
Implement notification callbacks on Android
* doc/lispref/os.texi (Desktop Notifications): Document that :on-cancel, :on-action and :actions are now supported on Android. * java/org/gnu/emacs/EmacsActivity.java (onNewIntent): New function. * java/org/gnu/emacs/EmacsDesktopNotification.java (NOTIFICATION_ACTION, NOTIFICATION_TAG, NOTIFICATION_DISMISSED): New constants. <actions, titles>: New fields. (insertActions): New function. (display1, display): Insert actions on Jelly Bean and up, and arrange to be notified when the notification is dismissed. (CancellationReceiver): New class. * java/org/gnu/emacs/EmacsNative.java (sendNotificationDeleted) (sendNotificationAction): New functions. * src/android.c (sendDndDrag, sendDndUri, sendDndText): Correct return types. (sendNotificationDeleted, sendNotificationAction) (android_exception_check_5, android_exception_check_6): New functions. * src/android.h: * src/androidgui.h (struct android_notification_event): New structure. (union android_event): New member for notification events. * src/androidselect.c (android_init_emacs_desktop_notification): Update JNI signatures. (android_notifications_notify_1, Fandroid_notifications_notify): New arguments ACTIONS, ACTION_CB and CANCEL_CB. Convert and record them as appropriate. (android_notification_deleted, android_notification_action): New functions. (syms_of_androidselect): Prepare a hash table of outstanding notifications. <QCactions, QCon_action, QCon_cancel> New defsyms. * src/androidterm.c (handle_one_android_event) <ANDROID_NOTIFICATION_DELETED> <ANDROID_NOTIFICATION_ACTION>: Dispatch event contents to androidselect.c for processing. * src/androidterm.h: * src/androidvfs.c (java_string_class): Export. * src/keyboard.c (kbd_buffer_get_event) <NOTIFICATION_EVENT>: Call callback specified by the event. * src/termhooks.h (enum event_kind) [HAVE_ANDROID]: New enum NOTIFICATION_EVENT.
Diffstat (limited to 'src/android.h')
-rw-r--r--src/android.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/android.h b/src/android.h
index e1834cebf68..ee634a3e76c 100644
--- a/src/android.h
+++ b/src/android.h
@@ -118,6 +118,10 @@ extern void android_exception_check_1 (jobject);
118extern void android_exception_check_2 (jobject, jobject); 118extern void android_exception_check_2 (jobject, jobject);
119extern void android_exception_check_3 (jobject, jobject, jobject); 119extern void android_exception_check_3 (jobject, jobject, jobject);
120extern void android_exception_check_4 (jobject, jobject, jobject, jobject); 120extern void android_exception_check_4 (jobject, jobject, jobject, jobject);
121extern void android_exception_check_5 (jobject, jobject, jobject, jobject,
122 jobject);
123extern void android_exception_check_6 (jobject, jobject, jobject, jobject,
124 jobject, jobject);
121extern void android_exception_check_nonnull (void *, jobject); 125extern void android_exception_check_nonnull (void *, jobject);
122extern void android_exception_check_nonnull_1 (void *, jobject, jobject); 126extern void android_exception_check_nonnull_1 (void *, jobject, jobject);
123 127
@@ -306,6 +310,9 @@ extern JNIEnv *android_java_env;
306extern JavaVM *android_jvm; 310extern JavaVM *android_jvm;
307#endif /* THREADS_ENABLED */ 311#endif /* THREADS_ENABLED */
308 312
313/* The Java String class. */
314extern jclass java_string_class;
315
309/* The EmacsService object. */ 316/* The EmacsService object. */
310extern jobject emacs_service; 317extern jobject emacs_service;
311 318