summaryrefslogtreecommitdiff
path: root/src/androidvfs.c
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2024-05-10 11:42:37 +0800
committerPo Lu <luangruo@yahoo.com>2024-05-10 11:42:37 +0800
commitea2b251ab2b2bc9a3d6f52a22408655be20de266 (patch)
tree6e4ceb796066892f68101a45b646c9b1d8b853a3 /src/androidvfs.c
parentdc5390d06a65f4d481b8bb20da4f6715c2079ea6 (diff)
downloademacs-ea2b251ab2b2bc9a3d6f52a22408655be20de266.tar.gz
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/androidvfs.c')
-rw-r--r--src/androidvfs.c20
1 files changed, 8 insertions, 12 deletions
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)
struct android_saf_root_vnode *vp;
jobjectArray array;
jmethodID method;
- jbyteArray authority;
+ jstring authority;
struct android_saf_root_vdir *dir;
size_t length;
@@ -4043,15 +4043,10 @@ android_saf_root_opendir (struct android_vnode *vnode)
{
/* Build a string containing the authority. */
length = strlen (vp->authority);
- authority = (*android_java_env)->NewByteArray (android_java_env,
- length);
+ authority = (*android_java_env)->NewStringUTF (android_java_env,
+ vp->authority);
android_exception_check ();
- /* Copy the authority name to that byte array. */
- (*android_java_env)->SetByteArrayRegion (android_java_env,
- authority, 0, length,
- (jbyte *) vp->authority);
-
/* Acquire a list of every tree provided by this authority. */
method = service_class.get_document_trees;
@@ -6566,10 +6561,11 @@ static struct android_special_vnode special_vnodes[] =
to CODING, and return a Lisp string with the data so produced.
Calling this function creates an implicit assumption that
- file-name-coding-system is compatible with utf-8-emacs, which is not
- unacceptable as users with cause to modify file-name-coding-system
- should be aware and prepared for consequences towards files stored on
- different filesystems, including virtual ones. */
+ `file-name-coding-system' is compatible with `utf-8-emacs', which is
+ not unacceptable as users with cause to modify
+ file-name-coding-system should be aware and prepared for adverse
+ consequences affecting files stored on different filesystems,
+ including virtual ones. */
static Lisp_Object
android_vfs_convert_name (const char *name, Lisp_Object coding)