DocumentsUI: Filter out downloads root if the source documents include directory.

This is the short term solution for the downloads root, which does not support
directory creation. For the long term solution, we need to add a flag to Root
model to check if the root support directory creation or not.

BUG=20186663

Change-Id: I15c4795892f38e3f968776f732a6f2160ae775fc
diff --git a/src/com/android/documentsui/DirectoryFragment.java b/src/com/android/documentsui/DirectoryFragment.java
index 61fcad2..909e2e5 100644
--- a/src/com/android/documentsui/DirectoryFragment.java
+++ b/src/com/android/documentsui/DirectoryFragment.java
@@ -687,6 +687,14 @@
                 Uri.EMPTY,
                 getActivity(),
                 DocumentsActivity.class);
+        boolean directoryCopy = false;
+        for (DocumentInfo info : docs) {
+            if (Document.MIME_TYPE_DIR.equals(info.mimeType)) {
+                directoryCopy = true;
+                break;
+            }
+        }
+        intent.putExtra(BaseActivity.EXTRA_DIRECTORY_COPY, directoryCopy);
         startActivityForResult(intent, REQUEST_COPY_DESTINATION);
     }