Remove directoryCopy state

This state was used for Downloads cannot create folder before,
we will this state to hide Downloads root when copy folder.
It support creadte folder now so this state is useless.

Fix: 147859534
Test: manaul
Test: atest DocumentsUIGoogleTests
Change-Id: Id743e19771ac11af0da5f64bca43506f8bebd92a
diff --git a/src/com/android/documentsui/base/Shared.java b/src/com/android/documentsui/base/Shared.java
index 427e6a5..1ac4b32 100644
--- a/src/com/android/documentsui/base/Shared.java
+++ b/src/com/android/documentsui/base/Shared.java
@@ -66,12 +66,6 @@
     public static final String METADATA_VIDEO_LONGITUTE = "android.media.metadata.video:longitude";
 
     /**
-     * Extra boolean flag for {@link #ACTION_PICK_COPY_DESTINATION}, which
-     * specifies if the destination directory needs to create new directory or not.
-     */
-    public static final String EXTRA_DIRECTORY_COPY = "com.android.documentsui.DIRECTORY_COPY";
-
-    /**
      * Extra flag used to store the current stack so user opens in right spot.
      */
     public static final String EXTRA_STACK = "com.android.documentsui.STACK";
diff --git a/src/com/android/documentsui/base/State.java b/src/com/android/documentsui/base/State.java
index 1584631..0a57579 100644
--- a/src/com/android/documentsui/base/State.java
+++ b/src/com/android/documentsui/base/State.java
@@ -84,10 +84,6 @@
     public boolean showDeviceStorageOption;
     public boolean showAdvanced;
 
-    // Indicates that a copy operation (or move) includes a directory.
-    // Why? Directory creation isn't supported by some roots (like Downloads).
-    // This allows us to restrict available roots to just those with support.
-    public boolean directoryCopy;
     public boolean openableOnly;
 
     /**
diff --git a/src/com/android/documentsui/dirlist/DirectoryFragment.java b/src/com/android/documentsui/dirlist/DirectoryFragment.java
index 2f2c6a8..ee8c3a8 100644
--- a/src/com/android/documentsui/dirlist/DirectoryFragment.java
+++ b/src/com/android/documentsui/dirlist/DirectoryFragment.java
@@ -932,7 +932,6 @@
         // to be copied? Why? Directory creation isn't supported by some roots
         // (like Downloads). This informs DocumentsActivity (the "picker")
         // to restrict available roots to just those with support.
-        intent.putExtra(Shared.EXTRA_DIRECTORY_COPY, hasDirectory(docs));
         intent.putExtra(FileOperationService.EXTRA_OPERATION_TYPE, mode);
 
         // This just identifies the type of request...we'll check it
@@ -951,15 +950,6 @@
         }
     }
 
-    private static boolean hasDirectory(List<DocumentInfo> docs) {
-        for (DocumentInfo info : docs) {
-            if (Document.MIME_TYPE_DIR.equals(info.mimeType)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
     private void renameDocuments(Selection selected) {
         Metrics.logUserAction(MetricConsts.USER_ACTION_RENAME);
 
diff --git a/src/com/android/documentsui/picker/PickActivity.java b/src/com/android/documentsui/picker/PickActivity.java
index 9530ae8..f7f2ebe 100644
--- a/src/com/android/documentsui/picker/PickActivity.java
+++ b/src/com/android/documentsui/picker/PickActivity.java
@@ -246,11 +246,6 @@
         }
 
         if (state.action == ACTION_PICK_COPY_DESTINATION) {
-            // Indicates that a copy operation (or move) includes a directory.
-            // Why? Directory creation isn't supported by some roots (like Downloads).
-            // This allows us to restrict available roots to just those with support.
-            state.directoryCopy = intent.getBooleanExtra(
-                    Shared.EXTRA_DIRECTORY_COPY, false);
             state.copyOperationSubType = intent.getIntExtra(
                     FileOperationService.EXTRA_OPERATION_TYPE,
                     FileOperationService.OPERATION_COPY);
diff --git a/src/com/android/documentsui/roots/ProvidersAccess.java b/src/com/android/documentsui/roots/ProvidersAccess.java
index 1b075e8..a6deb20 100644
--- a/src/com/android/documentsui/roots/ProvidersAccess.java
+++ b/src/com/android/documentsui/roots/ProvidersAccess.java
@@ -107,12 +107,6 @@
                 continue;
             }
 
-            if (state.directoryCopy && root.isDownloads()) {
-                if (VERBOSE) Log.v(
-                        tag, "Excluding downloads root because: unsupported directory copy.");
-                continue;
-            }
-
             if (state.action == State.ACTION_OPEN && root.isEmpty()) {
                 if (VERBOSE) Log.v(tag, "Excluding empty root because: ACTION_OPEN.");
                 continue;
diff --git a/tests/unit/com/android/documentsui/roots/ProvidersAccessTest.java b/tests/unit/com/android/documentsui/roots/ProvidersAccessTest.java
index daf3892..a52f2b6 100644
--- a/tests/unit/com/android/documentsui/roots/ProvidersAccessTest.java
+++ b/tests/unit/com/android/documentsui/roots/ProvidersAccessTest.java
@@ -68,20 +68,6 @@
                 ProvidersAccess.getMatchingRoots(mRoots, mState));
     }
 
-    public void testMatchingRoots_DirectoryCopy() throws Exception {
-        RootInfo downloads = buildForMimeTypes("*/*");
-        downloads.authority = Providers.AUTHORITY_DOWNLOADS;
-        mRoots.add(downloads);
-
-        mState.acceptMimes = new String[] { "*/*" };
-        mState.directoryCopy = true;
-
-        // basically we're asserting that the results don't contain downloads
-        assertContainsExactly(
-                newArrayList(mNull, mWild, mImages, mAudio, mDocs, mMalformed1, mMalformed2),
-                ProvidersAccess.getMatchingRoots(mRoots, mState));
-    }
-
     public void testMatchingRoots_PngOrWild() throws Exception {
         mState.acceptMimes = new String[] { "image/png", "*/*" };
         assertContainsExactly(