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

Commit e8610792 authored by Tony Huang's avatar Tony Huang Committed by Android (Google) Code Review
Browse files

Merge "Remove directoryCopy state"

parents 6f206066 1e682c27
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
@@ -934,7 +934,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
@@ -953,15 +952,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