aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2023-03-11 15:56:53 +0800
committerPo Lu2023-03-11 15:56:53 +0800
commit78faad633068d69dce25f246efb5374c21dae6bd (patch)
tree75aecb10e7848cef022f7c3c161f374c02ec7a36 /src
parent4a328b857812625ec82b31d8efd928f8580d9561 (diff)
downloademacs-78faad633068d69dce25f246efb5374c21dae6bd.tar.gz
emacs-78faad633068d69dce25f246efb5374c21dae6bd.zip
Update Android port
* src/android.c (android_resolve_handle) (android_resolve_handle2): Don't perform checking done by CheckJNI by default. (android_copy_area): Check for errors here because CopyArea can perform a lot of consing. (android_define_cursor): Remove redundant code.
Diffstat (limited to 'src')
-rw-r--r--src/android.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/android.c b/src/android.c
index 79598ab86df..e4f9dd0ffbe 100644
--- a/src/android.c
+++ b/src/android.c
@@ -2986,6 +2986,12 @@ android_resolve_handle (android_handle handle,
2986 /* ANDROID_NONE. */ 2986 /* ANDROID_NONE. */
2987 return NULL; 2987 return NULL;
2988 2988
2989 /* CheckJNI will normally ensure that the handle exists and is
2990 the right type, but with a less informative error message.
2991 Don't waste cycles doing our own checking here. */
2992
2993#ifdef ENABLE_CHECKING
2994
2989 if (!android_handles[handle].handle) 2995 if (!android_handles[handle].handle)
2990 { 2996 {
2991 __android_log_print (ANDROID_LOG_ERROR, __func__, 2997 __android_log_print (ANDROID_LOG_ERROR, __func__,
@@ -3000,6 +3006,8 @@ android_resolve_handle (android_handle handle,
3000 emacs_abort (); 3006 emacs_abort ();
3001 } 3007 }
3002 3008
3009#endif /* ENABLE_CHECKING */
3010
3003 return android_handles[handle].handle; 3011 return android_handles[handle].handle;
3004} 3012}
3005 3013
@@ -3011,6 +3019,12 @@ android_resolve_handle2 (android_handle handle,
3011 if (!handle) 3019 if (!handle)
3012 return NULL; 3020 return NULL;
3013 3021
3022 /* CheckJNI will normally ensure that the handle exists and is
3023 the right type, but with a less informative error message.
3024 Don't waste cycles doing our own checking here. */
3025
3026#ifdef ENABLE_CHECKING
3027
3014 if (!android_handles[handle].handle) 3028 if (!android_handles[handle].handle)
3015 { 3029 {
3016 __android_log_print (ANDROID_LOG_ERROR, __func__, 3030 __android_log_print (ANDROID_LOG_ERROR, __func__,
@@ -3026,6 +3040,8 @@ android_resolve_handle2 (android_handle handle,
3026 emacs_abort (); 3040 emacs_abort ();
3027 } 3041 }
3028 3042
3043#endif /* ENABLE_CHECKING */
3044
3029 return android_handles[handle].handle; 3045 return android_handles[handle].handle;
3030} 3046}
3031 3047
@@ -3861,6 +3877,7 @@ android_copy_area (android_drawable src, android_drawable dest,
3861 (jint) src_x, (jint) src_y, 3877 (jint) src_x, (jint) src_y,
3862 (jint) width, (jint) height, 3878 (jint) width, (jint) height,
3863 (jint) dest_x, (jint) dest_y); 3879 (jint) dest_x, (jint) dest_y);
3880 android_exception_check ();
3864} 3881}
3865 3882
3866void 3883void
@@ -6345,9 +6362,7 @@ android_define_cursor (android_window window, android_cursor cursor)
6345 jmethodID method; 6362 jmethodID method;
6346 6363
6347 window1 = android_resolve_handle (window, ANDROID_HANDLE_WINDOW); 6364 window1 = android_resolve_handle (window, ANDROID_HANDLE_WINDOW);
6348 cursor1 = (cursor 6365 cursor1 = android_resolve_handle (cursor, ANDROID_HANDLE_CURSOR);
6349 ? android_resolve_handle (cursor, ANDROID_HANDLE_CURSOR)
6350 : NULL);
6351 method = window_class.define_cursor; 6366 method = window_class.define_cursor;
6352 6367
6353 (*android_java_env)->CallNonvirtualVoidMethod (android_java_env, 6368 (*android_java_env)->CallNonvirtualVoidMethod (android_java_env,