Fix earlier change to content URI resolution on Android

* java/org/gnu/emacs/EmacsService.java (openContentUri): Return
-1 if fd be NULL.

* src/androidvfs.c (android_authority_open): Detect
SecurityException and suchlike.
(android_vfs_init): Initialize exception classes on Android 4.4.
This commit is contained in:
Po Lu
2024-05-10 09:05:54 +08:00
parent d335f28aa9
commit c900c707e8
2 changed files with 116 additions and 110 deletions

View File

@@ -968,7 +968,7 @@ public final class EmacsService extends Service
string; make it writable if WRITABLE, and readable if READABLE.
Truncate the file if TRUNCATE.
Value is the resulting file descriptor or an exception will be
Value is the resulting file descriptor, -1, or an exception will be
raised. */
public int
@@ -999,6 +999,9 @@ public final class EmacsService extends Service
minimum requirement for access to /content/by-authority. */
fd = resolver.openFileDescriptor (Uri.parse (uri), mode);
if (fd == null)
return -1;
i = fd.detachFd ();
fd.close ();