1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-13 06:50:39 -08:00

Update Android port

* java/org/gnu/emacs/EmacsSafThread.java (EmacsSafThread, getCache)
(pruneCache1, pruneCache, cacheChild, cacheDirectoryFromCursor)
(documentIdFromName1, openDocumentDirectory1): Implement the
cache referred to by the commentary.
* java/org/gnu/emacs/EmacsService.java (deleteDocument):
Invalidate the cache upon document removal.
* src/androidvfs.c (android_saf_exception_check)
(android_document_id_from_name): Correctly preserve or set errno
in error cases.
This commit is contained in:
Po Lu 2023-07-29 11:24:07 +08:00
parent 25ef0c3a89
commit 47f97b5ae4
3 changed files with 544 additions and 81 deletions

View file

@ -1680,14 +1680,18 @@ public final class EmacsService extends Service
deleteDocument (String uri, String id)
throws FileNotFoundException
{
Uri uriObject;
Uri uriObject, tree;
uriObject = Uri.parse (uri);
uriObject = DocumentsContract.buildDocumentUriUsingTree (uriObject,
id);
tree = Uri.parse (uri);
uriObject = DocumentsContract.buildDocumentUriUsingTree (tree, id);
if (DocumentsContract.deleteDocument (resolver, uriObject))
return 0;
{
if (storageThread != null)
storageThread.postInvalidateCache (tree, id);
return 0;
}
return -1;
}