diff options
| author | Po Lu | 2024-05-10 09:05:54 +0800 |
|---|---|---|
| committer | Po Lu | 2024-05-10 09:05:54 +0800 |
| commit | c900c707e8f3075dfe57c39a8a6363ba4575035f (patch) | |
| tree | 4d2ce9fe218b9e0158229aad1aff9140903d4db3 /java | |
| parent | d335f28aa9bfb85d0e35b838ca867d97ebe5b974 (diff) | |
| download | emacs-c900c707e8f3075dfe57c39a8a6363ba4575035f.tar.gz emacs-c900c707e8f3075dfe57c39a8a6363ba4575035f.zip | |
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 | |||
| 968 | string; make it writable if WRITABLE, and readable if READABLE. | 968 | string; make it writable if WRITABLE, and readable if READABLE. |
| 969 | Truncate the file if TRUNCATE. | 969 | Truncate the file if TRUNCATE. |
| 970 | 970 | ||
| 971 | Value is the resulting file descriptor or an exception will be | 971 | Value is the resulting file descriptor, -1, or an exception will be |
| 972 | raised. */ | 972 | raised. */ |
| 973 | 973 | ||
| 974 | public int | 974 | public int |
| @@ -999,6 +999,9 @@ public final class EmacsService extends Service | |||
| 999 | minimum requirement for access to /content/by-authority. */ | 999 | minimum requirement for access to /content/by-authority. */ |
| 1000 | 1000 | ||
| 1001 | fd = resolver.openFileDescriptor (Uri.parse (uri), mode); | 1001 | fd = resolver.openFileDescriptor (Uri.parse (uri), mode); |
| 1002 | if (fd == null) | ||
| 1003 | return -1; | ||
| 1004 | |||
| 1002 | i = fd.detachFd (); | 1005 | i = fd.detachFd (); |
| 1003 | fd.close (); | 1006 | fd.close (); |
| 1004 | 1007 | ||