diff options
| author | Po Lu | 2024-03-13 10:59:39 +0800 |
|---|---|---|
| committer | Po Lu | 2024-03-13 11:01:39 +0800 |
| commit | 6b40d557c4a9a4152565c1a1b0da49a1aaaec84f (patch) | |
| tree | ac82dd76319ccc7df22a9d70923ec28f97c4f41a /java | |
| parent | 4afafa03704aab0c21e4cb4f028256ecead5f795 (diff) | |
| download | emacs-6b40d557c4a9a4152565c1a1b0da49a1aaaec84f.tar.gz emacs-6b40d557c4a9a4152565c1a1b0da49a1aaaec84f.zip | |
Port more notification senders to non-XDG systems
* doc/lispref/os.texi (Desktop Notifications): Document that
`:timeout' is now implemented.
* java/org/gnu/emacs/EmacsDesktopNotification.java
(EmacsDesktopNotification): New field delay.
(display1): Set delay on Android 8.0 and up.
* lisp/erc/erc-desktop-notifications.el
(erc-notifications-notify): Call Android or Haiku notification
functions on those systems.
* lisp/gnus/gnus-notifications.el (gnus-notifications-action)
(gnus-notification-close): Remove dismissed notifications from
the notification to message map.
(gnus-notifications-notify): Call android-notifications-notify
if possible.
* src/androidselect.c (android_init_emacs_desktop_notification):
Update accordingly.
(android_notifications_notify_1): New argument TIMEOUT.
(Fandroid_notifications_notify): New argument QCtimeout.
(syms_of_androidselect) <QCtimeout>: New symbol.
Diffstat (limited to 'java')
| -rw-r--r-- | java/org/gnu/emacs/EmacsDesktopNotification.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/java/org/gnu/emacs/EmacsDesktopNotification.java b/java/org/gnu/emacs/EmacsDesktopNotification.java index d05ed2e6203..d00b9f2ea22 100644 --- a/java/org/gnu/emacs/EmacsDesktopNotification.java +++ b/java/org/gnu/emacs/EmacsDesktopNotification.java | |||
| @@ -83,11 +83,16 @@ public final class EmacsDesktopNotification | |||
| 83 | notification. */ | 83 | notification. */ |
| 84 | public final String[] actions, titles; | 84 | public final String[] actions, titles; |
| 85 | 85 | ||
| 86 | /* Delay in miliseconds after which this notification should be | ||
| 87 | automatically dismissed. */ | ||
| 88 | public final long delay; | ||
| 89 | |||
| 86 | public | 90 | public |
| 87 | EmacsDesktopNotification (String title, String content, | 91 | EmacsDesktopNotification (String title, String content, |
| 88 | String group, String tag, int icon, | 92 | String group, String tag, int icon, |
| 89 | int importance, | 93 | int importance, |
| 90 | String[] actions, String[] titles) | 94 | String[] actions, String[] titles, |
| 95 | long delay) | ||
| 91 | { | 96 | { |
| 92 | this.content = content; | 97 | this.content = content; |
| 93 | this.title = title; | 98 | this.title = title; |
| @@ -97,6 +102,7 @@ public final class EmacsDesktopNotification | |||
| 97 | this.importance = importance; | 102 | this.importance = importance; |
| 98 | this.actions = actions; | 103 | this.actions = actions; |
| 99 | this.titles = titles; | 104 | this.titles = titles; |
| 105 | this.delay = delay; | ||
| 100 | } | 106 | } |
| 101 | 107 | ||
| 102 | 108 | ||
| @@ -191,6 +197,8 @@ public final class EmacsDesktopNotification | |||
| 191 | builder.setContentTitle (title); | 197 | builder.setContentTitle (title); |
| 192 | builder.setContentText (content); | 198 | builder.setContentText (content); |
| 193 | builder.setSmallIcon (icon); | 199 | builder.setSmallIcon (icon); |
| 200 | builder.setTimeoutAfter (delay); | ||
| 201 | |||
| 194 | insertActions (context, builder); | 202 | insertActions (context, builder); |
| 195 | notification = builder.build (); | 203 | notification = builder.build (); |
| 196 | } | 204 | } |