aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/org/gnu/emacs/EmacsService.java17
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
1401 otherwise. */ 1401 otherwise. */
1402 1402
1403 public String[] 1403 public String[]
1404 getDocumentTrees (byte provider[]) 1404 getDocumentTrees (String provider)
1405 { 1405 {
1406 String providerName;
1407 List<String> treeList; 1406 List<String> treeList;
1408 List<UriPermission> permissions; 1407 List<UriPermission> permissions;
1409 Uri uri; 1408 Uri uri;
1410 1409
1411 try
1412 {
1413 providerName = new String (provider, "US-ASCII");
1414 }
1415 catch (UnsupportedEncodingException exception)
1416 {
1417 return null;
1418 }
1419
1420 permissions = resolver.getPersistedUriPermissions (); 1410 permissions = resolver.getPersistedUriPermissions ();
1421 treeList = new ArrayList<String> (); 1411 treeList = new ArrayList<String> ();
1422 1412
@@ -1425,7 +1415,7 @@ public final class EmacsService extends Service
1425 uri = permission.getUri (); 1415 uri = permission.getUri ();
1426 1416
1427 if (DocumentsContract.isTreeUri (uri) 1417 if (DocumentsContract.isTreeUri (uri)
1428 && uri.getAuthority ().equals (providerName) 1418 && uri.getAuthority ().equals (provider)
1429 && permission.isReadPermission ()) 1419 && permission.isReadPermission ())
1430 /* Make sure the tree document ID is encoded. Refrain from 1420 /* Make sure the tree document ID is encoded. Refrain from
1431 encoding characters such as +:&?#, since they don't 1421 encoding characters such as +:&?#, since they don't
@@ -1435,6 +1425,9 @@ public final class EmacsService extends Service
1435 " +:&?#")); 1425 " +:&?#"));
1436 } 1426 }
1437 1427
1428 /* The empty string array that is ostensibly allocated to provide
1429 the first argument provides just the type of the array to be
1430 returned. */
1438 return treeList.toArray (new String[0]); 1431 return treeList.toArray (new String[0]);
1439 } 1432 }
1440 1433