No directories in Downloads.
Jeff Sharkey [Thu, 10 Oct 2013 21:56:07 +0000 (14:56 -0700)]
Bug: 11166290
Change-Id: I29c9cf53c77d03d1bcf408edd693b9c24d5665b6

src/com/android/providers/downloads/DownloadStorageProvider.java

index d9a0aa6..ecef54e 100644 (file)
@@ -104,6 +104,10 @@ public class DownloadStorageProvider extends DocumentsProvider {
     @Override
     public String createDocument(String docId, String mimeType, String displayName)
             throws FileNotFoundException {
+        if (Document.MIME_TYPE_DIR.equals(mimeType)) {
+            throw new FileNotFoundException("Directory creation not supported");
+        }
+
         final File parent = Environment.getExternalStoragePublicDirectory(
                 Environment.DIRECTORY_DOWNLOADS);
         parent.mkdirs();