aboutsummaryrefslogtreecommitdiffstats
path: root/src/androidselect.c
diff options
context:
space:
mode:
authorPo Lu2023-02-25 19:11:07 +0800
committerPo Lu2023-02-25 19:11:07 +0800
commit8e4c5db193dc7baee5846520fe8b63d8bea99148 (patch)
tree595eb65601d38b7895ae1d00ec9a71a947cd1af7 /src/androidselect.c
parentd5cccfdc564f1486431f9674503c794df33d7fbc (diff)
downloademacs-8e4c5db193dc7baee5846520fe8b63d8bea99148.tar.gz
emacs-8e4c5db193dc7baee5846520fe8b63d8bea99148.zip
Update Android port
* doc/emacs/android.texi (Android Startup, Android File System) (Android Environment, Android Windowing, Android Troubleshooting): Improve documentation; fix typos. * doc/lispref/commands.texi (Misc Events): Likewise. * java/org/gnu/emacs/EmacsService.java (queryBattery): New function. * lisp/battery.el (battery-status-function): Set appropriately for Android. (battery-android): New function. * src/android.c (struct android_emacs_service): New method `query_battery'. (android_check_content_access): Improve exception checking. (android_init_emacs_service): Look up new method. (android_destroy_handle, android_create_window) (android_init_android_rect_class, android_init_emacs_gc_class) (android_set_clip_rectangles) (android_create_pixmap_from_bitmap_data, android_fill_polygon) (android_get_image, android_put_image, android_bell) (android_set_input_focus, android_raise_window) (android_lower_window, android_query_tree, android_get_geometry) (android_translate_coordinates, android_wc_lookup_string) (android_damage_window, android_build_string) (android_build_jstring, android_exception_check_1) (android_exception_check_2): New functions. (android_browse_url): Improve exception handling. Always use android_exception_check and don't leak local refs. (android_query_battery): New function. * src/android.h (struct android_battery_state): New struct. * src/androidfns.c (Fandroid_query_battery, syms_of_androidfns): New function. * src/androidfont.c (androidfont_from_lisp, DO_SYMBOL_FIELD) (DO_CARDINAL_FIELD, androidfont_list, androidfont_match) (androidfont_draw, androidfont_open_font) (androidfont_close_font): * src/androidselect.c (Fandroid_set_clipboard) (Fandroid_get_clipboard): * src/sfnt.c (sfnt_map_glyf_table): * src/sfntfont.c (sfntfont_free_outline_cache) (sfntfont_free_raster_cache, sfntfont_close): Allow font close functions to be called twice.
Diffstat (limited to 'src/androidselect.c')
-rw-r--r--src/androidselect.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/androidselect.c b/src/androidselect.c
index 4585d64b7e8..2d8f14bb90d 100644
--- a/src/androidselect.c
+++ b/src/androidselect.c
@@ -147,7 +147,7 @@ DEFUN ("android-set-clipboard", Fandroid_set_clipboard,
147 clipboard, 147 clipboard,
148 clipboard_class.set_clipboard, 148 clipboard_class.set_clipboard,
149 bytes); 149 bytes);
150 android_exception_check (); 150 android_exception_check_1 (bytes);
151 151
152 ANDROID_DELETE_LOCAL_REF (bytes); 152 ANDROID_DELETE_LOCAL_REF (bytes);
153 return Qnil; 153 return Qnil;
@@ -172,18 +172,13 @@ Alternatively, return nil if the clipboard is empty. */)
172 = (*android_java_env)->CallObjectMethod (android_java_env, 172 = (*android_java_env)->CallObjectMethod (android_java_env,
173 clipboard, 173 clipboard,
174 method); 174 method);
175 175 android_exception_check ();
176 if (!bytes)
177 {
178 android_exception_check ();
179 return Qnil;
180 }
181 176
182 length = (*android_java_env)->GetArrayLength (android_java_env, 177 length = (*android_java_env)->GetArrayLength (android_java_env,
183 bytes); 178 bytes);
184 data = (*android_java_env)->GetByteArrayElements (android_java_env, 179 data = (*android_java_env)->GetByteArrayElements (android_java_env,
185 bytes, NULL); 180 bytes, NULL);
186 android_exception_check (); 181 android_exception_check_1 (bytes);
187 182
188 string = make_unibyte_string ((char *) data, length); 183 string = make_unibyte_string ((char *) data, length);
189 184