diff options
-rw-r--r-- | src/com/android/providers/downloads/DownloadStorageProvider.java | 17 | ||||
-rw-r--r-- | tests/Android.mk | 1 |
2 files changed, 18 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. diff --git a/tests/Android.mk b/tests/Android.mk index 6e015c0a..b654e12c 100644 --- a/tests/Android.mk +++ b/tests/Android.mk @@ -13,6 +13,7 @@ LOCAL_STATIC_JAVA_LIBRARIES := \ mockito-target \ legacy-android-test LOCAL_PACKAGE_NAME := DownloadProviderTests +LOCAL_COMPATIBILITY_SUITE := device-tests LOCAL_CERTIFICATE := media include $(BUILD_PACKAGE) |