Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e682c27 authored by Tony Huang's avatar Tony Huang
Browse files

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
parent c037b0d0
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -65,12 +65,6 @@ public final class Shared {
    public static final String METADATA_VIDEO_LATITUDE = "android.media.metadata.video:latitude";
    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.
     */
+0 −4
Original line number Diff line number Diff line
@@ -84,10 +84,6 @@ public class State implements android.os.Parcelable {
    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;

    /**
+0 −10
Original line number Diff line number Diff line
@@ -932,7 +932,6 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On
        // 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 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On
        }
    }

    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);

+0 −5
Original line number Diff line number Diff line
@@ -246,11 +246,6 @@ public class PickActivity extends BaseActivity implements ActionHandler.Addons {
        }

        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);
+0 −6
Original line number Diff line number Diff line
@@ -107,12 +107,6 @@ public interface ProvidersAccess {
                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;
Loading