diff options
| author | Po Lu | 2023-03-02 09:27:37 +0800 |
|---|---|---|
| committer | Po Lu | 2023-03-02 09:27:37 +0800 |
| commit | 7fb3c0d0397096f643f6239d50cf52eaf96e7b07 (patch) | |
| tree | 53619775d86261a8210630f344c6eae8bbdd6aa9 /src/androidselect.c | |
| parent | 5e416d02c59e356e6f7677a9132896d824bcb337 (diff) | |
| download | emacs-7fb3c0d0397096f643f6239d50cf52eaf96e7b07.tar.gz emacs-7fb3c0d0397096f643f6239d50cf52eaf96e7b07.zip | |
Update Android port
* doc/emacs/android.texi (Android Windowing): Reword
documentation.
* java/org/gnu/emacs/EmacsActivity.java (EmacsActivity):
* java/org/gnu/emacs/EmacsContextMenu.java (EmacsContextMenu):
* java/org/gnu/emacs/EmacsFontDriver.java (EmacsFontDriver):
* java/org/gnu/emacs/EmacsSdk7FontDriver.java
(EmacsSdk7FontDriver):
* java/org/gnu/emacs/EmacsService.java (queryBattery):
* java/org/gnu/emacs/EmacsWindow.java (EmacsWindow): Make
functions final and classes static where necessary.
* src/android.c (struct android_emacs_service): New method
`display_toast'.
(android_init_emacs_service): Load new method.
(android_display_toast): New function.
* src/android.h: Export.
* src/androidfns.c (Fandroid_detect_mouse):
* src/androidselect.c (Fandroid_clipboard_owner_p)
(Fandroid_set_clipboard, Fandroid_get_clipboard)
(Fandroid_browse_url): Prevent crashes when called from
libandroid-emacs.so.
* src/androidterm.c (handle_one_android_event): Fix out of date
commentary.
Diffstat (limited to 'src/androidselect.c')
| -rw-r--r-- | src/androidselect.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/androidselect.c b/src/androidselect.c index 3947ab99166..f54a6d6f52c 100644 --- a/src/androidselect.c +++ b/src/androidselect.c | |||
| @@ -110,6 +110,9 @@ determined. */) | |||
| 110 | { | 110 | { |
| 111 | jint rc; | 111 | jint rc; |
| 112 | 112 | ||
| 113 | if (!android_init_gui) | ||
| 114 | error ("Accessing clipboard without display connection"); | ||
| 115 | |||
| 113 | block_input (); | 116 | block_input (); |
| 114 | rc = (*android_java_env)->CallIntMethod (android_java_env, | 117 | rc = (*android_java_env)->CallIntMethod (android_java_env, |
| 115 | clipboard, | 118 | clipboard, |
| @@ -133,6 +136,9 @@ DEFUN ("android-set-clipboard", Fandroid_set_clipboard, | |||
| 133 | { | 136 | { |
| 134 | jarray bytes; | 137 | jarray bytes; |
| 135 | 138 | ||
| 139 | if (!android_init_gui) | ||
| 140 | error ("Accessing clipboard without display connection"); | ||
| 141 | |||
| 136 | CHECK_STRING (string); | 142 | CHECK_STRING (string); |
| 137 | string = ENCODE_UTF_8 (string); | 143 | string = ENCODE_UTF_8 (string); |
| 138 | 144 | ||
| @@ -167,6 +173,9 @@ Alternatively, return nil if the clipboard is empty. */) | |||
| 167 | size_t length; | 173 | size_t length; |
| 168 | jbyte *data; | 174 | jbyte *data; |
| 169 | 175 | ||
| 176 | if (!android_init_gui) | ||
| 177 | error ("No Android display connection!"); | ||
| 178 | |||
| 170 | method = clipboard_class.get_clipboard; | 179 | method = clipboard_class.get_clipboard; |
| 171 | bytes | 180 | bytes |
| 172 | = (*android_java_env)->CallObjectMethod (android_java_env, | 181 | = (*android_java_env)->CallObjectMethod (android_java_env, |
| @@ -217,6 +226,9 @@ URL with a scheme specified. Signal an error upon failure. */) | |||
| 217 | { | 226 | { |
| 218 | Lisp_Object value; | 227 | Lisp_Object value; |
| 219 | 228 | ||
| 229 | if (!android_init_gui) | ||
| 230 | error ("No Android display connection!"); | ||
| 231 | |||
| 220 | CHECK_STRING (url); | 232 | CHECK_STRING (url); |
| 221 | value = android_browse_url (url); | 233 | value = android_browse_url (url); |
| 222 | 234 | ||