diff options
| author | Po Lu | 2024-05-10 11:42:37 +0800 |
|---|---|---|
| committer | Po Lu | 2024-05-10 11:42:37 +0800 |
| commit | ea2b251ab2b2bc9a3d6f52a22408655be20de266 (patch) | |
| tree | 6e4ceb796066892f68101a45b646c9b1d8b853a3 /src | |
| parent | dc5390d06a65f4d481b8bb20da4f6715c2079ea6 (diff) | |
| download | emacs-ea2b251ab2b2bc9a3d6f52a22408655be20de266.tar.gz emacs-ea2b251ab2b2bc9a3d6f52a22408655be20de266.zip | |
Remove redundant encoding of strings in androidvfs.c
* java/org/gnu/emacs/EmacsService.java (getDocumentTrees):
Accept PROVIDER as a String.
* src/android.c (android_init_emacs_service):
* src/androidvfs.c (android_saf_root_opendir): Adjust to match.
Diffstat (limited to 'src')
| -rw-r--r-- | src/android.c | 2 | ||||
| -rw-r--r-- | src/androidvfs.c | 20 |
2 files changed, 9 insertions, 13 deletions
diff --git a/src/android.c b/src/android.c index 0dd7702b301..d3b0bc21478 100644 --- a/src/android.c +++ b/src/android.c | |||
| @@ -1659,7 +1659,7 @@ android_init_emacs_service (void) | |||
| 1659 | FIND_METHOD (request_directory_access, "requestDirectoryAccess", | 1659 | FIND_METHOD (request_directory_access, "requestDirectoryAccess", |
| 1660 | "()I"); | 1660 | "()I"); |
| 1661 | FIND_METHOD (get_document_trees, "getDocumentTrees", | 1661 | FIND_METHOD (get_document_trees, "getDocumentTrees", |
| 1662 | "([B)[Ljava/lang/String;"); | 1662 | "(Ljava/lang/String;)[Ljava/lang/String;"); |
| 1663 | FIND_METHOD (document_id_from_name, "documentIdFromName", | 1663 | FIND_METHOD (document_id_from_name, "documentIdFromName", |
| 1664 | "(Ljava/lang/String;Ljava/lang/String;" | 1664 | "(Ljava/lang/String;Ljava/lang/String;" |
| 1665 | "[Ljava/lang/String;)I"); | 1665 | "[Ljava/lang/String;)I"); |
diff --git a/src/androidvfs.c b/src/androidvfs.c index 284b1370549..004abd62518 100644 --- a/src/androidvfs.c +++ b/src/androidvfs.c | |||
| @@ -4033,7 +4033,7 @@ android_saf_root_opendir (struct android_vnode *vnode) | |||
| 4033 | struct android_saf_root_vnode *vp; | 4033 | struct android_saf_root_vnode *vp; |
| 4034 | jobjectArray array; | 4034 | jobjectArray array; |
| 4035 | jmethodID method; | 4035 | jmethodID method; |
| 4036 | jbyteArray authority; | 4036 | jstring authority; |
| 4037 | struct android_saf_root_vdir *dir; | 4037 | struct android_saf_root_vdir *dir; |
| 4038 | size_t length; | 4038 | size_t length; |
| 4039 | 4039 | ||
| @@ -4043,15 +4043,10 @@ android_saf_root_opendir (struct android_vnode *vnode) | |||
| 4043 | { | 4043 | { |
| 4044 | /* Build a string containing the authority. */ | 4044 | /* Build a string containing the authority. */ |
| 4045 | length = strlen (vp->authority); | 4045 | length = strlen (vp->authority); |
| 4046 | authority = (*android_java_env)->NewByteArray (android_java_env, | 4046 | authority = (*android_java_env)->NewStringUTF (android_java_env, |
| 4047 | length); | 4047 | vp->authority); |
| 4048 | android_exception_check (); | 4048 | android_exception_check (); |
| 4049 | 4049 | ||
| 4050 | /* Copy the authority name to that byte array. */ | ||
| 4051 | (*android_java_env)->SetByteArrayRegion (android_java_env, | ||
| 4052 | authority, 0, length, | ||
| 4053 | (jbyte *) vp->authority); | ||
| 4054 | |||
| 4055 | /* Acquire a list of every tree provided by this authority. */ | 4050 | /* Acquire a list of every tree provided by this authority. */ |
| 4056 | 4051 | ||
| 4057 | method = service_class.get_document_trees; | 4052 | method = service_class.get_document_trees; |
| @@ -6566,10 +6561,11 @@ static struct android_special_vnode special_vnodes[] = | |||
| 6566 | to CODING, and return a Lisp string with the data so produced. | 6561 | to CODING, and return a Lisp string with the data so produced. |
| 6567 | 6562 | ||
| 6568 | Calling this function creates an implicit assumption that | 6563 | Calling this function creates an implicit assumption that |
| 6569 | file-name-coding-system is compatible with utf-8-emacs, which is not | 6564 | `file-name-coding-system' is compatible with `utf-8-emacs', which is |
| 6570 | unacceptable as users with cause to modify file-name-coding-system | 6565 | not unacceptable as users with cause to modify |
| 6571 | should be aware and prepared for consequences towards files stored on | 6566 | file-name-coding-system should be aware and prepared for adverse |
| 6572 | different filesystems, including virtual ones. */ | 6567 | consequences affecting files stored on different filesystems, |
| 6568 | including virtual ones. */ | ||
| 6573 | 6569 | ||
| 6574 | static Lisp_Object | 6570 | static Lisp_Object |
| 6575 | android_vfs_convert_name (const char *name, Lisp_Object coding) | 6571 | android_vfs_convert_name (const char *name, Lisp_Object coding) |