diff options
author | Po Lu <luangruo@yahoo.com> | 2024-05-10 11:42:37 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2024-05-10 11:42:37 +0800 |
commit | ea2b251ab2b2bc9a3d6f52a22408655be20de266 (patch) | |
tree | 6e4ceb796066892f68101a45b646c9b1d8b853a3 /java | |
parent | dc5390d06a65f4d481b8bb20da4f6715c2079ea6 (diff) |
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 'java')
-rw-r--r-- | java/org/gnu/emacs/EmacsService.java | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/java/org/gnu/emacs/EmacsService.java b/java/org/gnu/emacs/EmacsService.java index 1e5f72eed37..2dcaad16e50 100644 --- a/java/org/gnu/emacs/EmacsService.java +++ b/java/org/gnu/emacs/EmacsService.java @@ -1401,22 +1401,12 @@ public final class EmacsService extends Service otherwise. */ public String[] - getDocumentTrees (byte provider[]) + getDocumentTrees (String provider) { - String providerName; List<String> treeList; List<UriPermission> permissions; Uri uri; - try - { - providerName = new String (provider, "US-ASCII"); - } - catch (UnsupportedEncodingException exception) - { - return null; - } - permissions = resolver.getPersistedUriPermissions (); treeList = new ArrayList<String> (); @@ -1425,7 +1415,7 @@ public final class EmacsService extends Service uri = permission.getUri (); if (DocumentsContract.isTreeUri (uri) - && uri.getAuthority ().equals (providerName) + && uri.getAuthority ().equals (provider) && permission.isReadPermission ()) /* Make sure the tree document ID is encoded. Refrain from encoding characters such as +:&?#, since they don't @@ -1435,6 +1425,9 @@ public final class EmacsService extends Service " +:&?#")); } + /* The empty string array that is ostensibly allocated to provide + the first argument provides just the type of the array to be + returned. */ return treeList.toArray (new String[0]); } |