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> ();
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
" +:&?#"));
}
+ /* 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]);
}
FIND_METHOD (request_directory_access, "requestDirectoryAccess",
"()I");
FIND_METHOD (get_document_trees, "getDocumentTrees",
- "([B)[Ljava/lang/String;");
+ "(Ljava/lang/String;)[Ljava/lang/String;");
FIND_METHOD (document_id_from_name, "documentIdFromName",
"(Ljava/lang/String;Ljava/lang/String;"
"[Ljava/lang/String;)I");
struct android_saf_root_vnode *vp;
jobjectArray array;
jmethodID method;
- jbyteArray authority;
+ jstring authority;
struct android_saf_root_vdir *dir;
size_t length;
{
/* 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;
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)