1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-13 11:12:19 -08:00

Allow quitting from Android content provider operations

* doc/emacs/android.texi (Android Document Providers): Say that
quitting is now possible.
* java/org/gnu/emacs/EmacsNative.java (EmacsNative): New
functions `safSyncAndReadInput', `safync' and `safPostRequest'.
* java/org/gnu/emacs/EmacsSafThread.java: New file.  Move
cancel-able SAF operations here.
* java/org/gnu/emacs/EmacsService.java (EmacsService): Allow
quitting from most SAF operations.
* src/androidvfs.c (android_saf_exception_check): Return EINTR
if OperationCanceledException is received.
(android_saf_stat, android_saf_access)
(android_document_id_from_name, android_saf_tree_opendir_1)
(android_saf_file_open): Don't allow reentrant calls from async
input handlers.
(NATIVE_NAME): Implement new synchronization primitives for JNI.
(android_vfs_init): Initialize new class.

* src/dired.c (open_directory): Handle EINTR from opendir.
* src/sysdep.c: Describe which operations may return EINTR on
Android.
This commit is contained in:
Po Lu 2023-07-28 15:19:37 +08:00
parent 03cf3bbb5c
commit 0709e03f88
7 changed files with 1127 additions and 483 deletions

View file

@ -257,6 +257,23 @@ public final class EmacsNative
public static native void notifyPixelsChanged (Bitmap bitmap);
/* Functions used to synchronize document provider access with the
main thread. */
/* Wait for a call to `safPostRequest' while also reading async
input.
If asynchronous input arrives and sets Vquit_flag, return 1. */
public static native int safSyncAndReadInput ();
/* Wait for a call to `safPostRequest'. */
public static native void safSync ();
/* Post the semaphore used to await the completion of SAF
operations. */
public static native void safPostRequest ();
static
{
/* Older versions of Android cannot link correctly with shared