[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/android 78faad63306 1/4: Update Android port
From: |
Po Lu |
Subject: |
feature/android 78faad63306 1/4: Update Android port |
Date: |
Sat, 11 Mar 2023 06:01:57 -0500 (EST) |
branch: feature/android
commit 78faad633068d69dce25f246efb5374c21dae6bd
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
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.
---
src/android.c | 21 ++++++++++++++++++---
1 file 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,
/* ANDROID_NONE. */
return NULL;
+ /* CheckJNI will normally ensure that the handle exists and is
+ the right type, but with a less informative error message.
+ Don't waste cycles doing our own checking here. */
+
+#ifdef ENABLE_CHECKING
+
if (!android_handles[handle].handle)
{
__android_log_print (ANDROID_LOG_ERROR, __func__,
@@ -3000,6 +3006,8 @@ android_resolve_handle (android_handle handle,
emacs_abort ();
}
+#endif /* ENABLE_CHECKING */
+
return android_handles[handle].handle;
}
@@ -3011,6 +3019,12 @@ android_resolve_handle2 (android_handle handle,
if (!handle)
return NULL;
+ /* CheckJNI will normally ensure that the handle exists and is
+ the right type, but with a less informative error message.
+ Don't waste cycles doing our own checking here. */
+
+#ifdef ENABLE_CHECKING
+
if (!android_handles[handle].handle)
{
__android_log_print (ANDROID_LOG_ERROR, __func__,
@@ -3026,6 +3040,8 @@ android_resolve_handle2 (android_handle handle,
emacs_abort ();
}
+#endif /* ENABLE_CHECKING */
+
return android_handles[handle].handle;
}
@@ -3861,6 +3877,7 @@ android_copy_area (android_drawable src, android_drawable
dest,
(jint) src_x, (jint) src_y,
(jint) width, (jint) height,
(jint) dest_x, (jint) dest_y);
+ android_exception_check ();
}
void
@@ -6345,9 +6362,7 @@ android_define_cursor (android_window window,
android_cursor cursor)
jmethodID method;
window1 = android_resolve_handle (window, ANDROID_HANDLE_WINDOW);
- cursor1 = (cursor
- ? android_resolve_handle (cursor, ANDROID_HANDLE_CURSOR)
- : NULL);
+ cursor1 = android_resolve_handle (cursor, ANDROID_HANDLE_CURSOR);
method = window_class.define_cursor;
(*android_java_env)->CallNonvirtualVoidMethod (android_java_env,