mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-24 22:40:51 -08:00
Update Android port
* doc/emacs/android.texi (Android File System): Describe how to access real files named /assets or /contents if so required. * java/org/gnu/emacs/EmacsService.java (validAuthority): * src/android.c (android_init_emacs_service): * src/android.h: New function. * src/androidvfs.c (android_saf_valid_authority_p): New function. Wrap the Java function. (android_saf_root_stat, android_saf_root_access): Don't return success if no authority by vp->authority's name exists. (android_saf_tree_from_name): Check validity of string data before giving it to JNI.
This commit is contained in:
parent
b022398b8f
commit
e41349dd93
5 changed files with 123 additions and 11 deletions
|
|
@ -1769,4 +1769,29 @@ public final class EmacsService extends Service
|
|||
? DocumentsContract.getDocumentId (name)
|
||||
: null);
|
||||
}
|
||||
|
||||
/* Return if there is a content provider by the name of AUTHORITY
|
||||
supplying at least one tree URI Emacs retains persistent rights
|
||||
to access. */
|
||||
|
||||
public boolean
|
||||
validAuthority (String authority)
|
||||
{
|
||||
List<UriPermission> permissions;
|
||||
Uri uri;
|
||||
|
||||
permissions = resolver.getPersistedUriPermissions ();
|
||||
|
||||
for (UriPermission permission : permissions)
|
||||
{
|
||||
uri = permission.getUri ();
|
||||
|
||||
if (DocumentsContract.isTreeUri (uri)
|
||||
&& permission.isReadPermission ()
|
||||
&& uri.getAuthority ().equals (authority))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue