diff options
-rw-r--r-- | src/com/android/providers/downloads/DownloadStorageProvider.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/providers/downloads/DownloadStorageProvider.java b/src/com/android/providers/downloads/DownloadStorageProvider.java index 8e4d7900..ee963623 100644 --- a/src/com/android/providers/downloads/DownloadStorageProvider.java +++ b/src/com/android/providers/downloads/DownloadStorageProvider.java @@ -34,6 +34,7 @@ import android.os.FileUtils; import android.os.ParcelFileDescriptor; import android.provider.DocumentsContract; import android.provider.DocumentsContract.Document; +import android.provider.DocumentsContract.Path; import android.provider.DocumentsContract.Root; import android.provider.Downloads; import android.text.TextUtils; @@ -123,6 +124,22 @@ public class DownloadStorageProvider extends FileSystemProvider { return result; } + @Override + public Path findDocumentPath(String parentDocId, String docId) throws FileNotFoundException { + + if (parentDocId == null) { + parentDocId = DOC_ID_ROOT; + } + + final File parent = getFileForDocId(parentDocId); + + final File doc = getFileForDocId(docId); + + final String rootId = (parentDocId == null) ? DOC_ID_ROOT : null; + + return new Path(rootId, findDocumentPath(parent, doc)); + } + /** * Calls on {@link FileSystemProvider#createDocument(String, String, String)}, and then creates * a new database entry in {@link DownloadManager} if it is not a raw file and not a folder. |