diff options
author | Po Lu <luangruo@yahoo.com> | 2024-05-10 09:05:54 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2024-05-10 09:05:54 +0800 |
commit | c900c707e8f3075dfe57c39a8a6363ba4575035f (patch) | |
tree | 4d2ce9fe218b9e0158229aad1aff9140903d4db3 /java | |
parent | d335f28aa9bfb85d0e35b838ca867d97ebe5b974 (diff) |
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.
Diffstat (limited to 'java')
-rw-r--r-- | java/org/gnu/emacs/EmacsService.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/java/org/gnu/emacs/EmacsService.java b/java/org/gnu/emacs/EmacsService.java index 5548748ddfa..1e5f72eed37 100644 --- a/java/org/gnu/emacs/EmacsService.java +++ b/java/org/gnu/emacs/EmacsService.java @@ -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 (); |