Skip to content

Commit

Permalink
Add isChild support to FileSystemProvider
Browse files Browse the repository at this point in the history
Issue #24
  • Loading branch information
2bllw8 committed May 3, 2022
1 parent 1c16ae0 commit 6c16bdc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public Cursor queryRoots(String[] projection) {

int flags = Root.FLAG_LOCAL_ONLY;
flags |= Root.FLAG_SUPPORTS_CREATE;
flags |= Root.FLAG_SUPPORTS_IS_CHILD;
flags |= DocumentsContract.Root.FLAG_SUPPORTS_EJECT;
if (Build.VERSION.SDK_INT >= 29) {
flags |= Root.FLAG_SUPPORTS_SEARCH;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,11 @@ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs)
return result;
}

@Override
public boolean isChildDocument(String parentDocumentId, String documentId) {
return documentId.contains(parentDocumentId);
}

/**
* Callback indicating that the given document has been modified. This gives the provider a hook
* to invalidate cached data, such as {@code sdcardfs}.
Expand Down

0 comments on commit 6c16bdc

Please sign in to comment.