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

Commit 16455790 authored by Ivan Chiang's avatar Ivan Chiang Committed by Android (Google) Code Review
Browse files

Merge "Support block directoy in ACTION_OPEN_DOCUMENT_TREE"

parents a00f324b 06198b12
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -98,6 +98,8 @@
    <string name="debug_raw_mimetype" translatable="false">Raw mimetype</string>
    <!-- String label for developer/debug file details, specifying that a file is an archive. -->
    <string name="debug_is_archive" translatable="false">Is archive</string>
    <!-- String label for developer/debug file details, specifying that a directory is blocked from tree. -->
    <string name="debug_is_blocked_from_tree" translatable="false">Is blocked from tree</string>
    <!-- String label for developer/debug file details, specifying that a file is a container (like a folder or an archive). -->
    <string name="debug_is_container" translatable="false">Is container</string>
    <!-- String label for developer/debug file details, specifying that a file is partial (being downloaded). -->
+5 −0
Original line number Diff line number Diff line
@@ -229,6 +229,7 @@ public class DocumentInfo implements Durable, Parcelable {
                + ", isMoveSupported=" + isMoveSupported()
                + ", isRenameSupported=" + isRenameSupported()
                + ", isMetadataSupported=" + isMetadataSupported()
                + ", isBlockedFromTree=" + isBlockedFromTree()
                + "} @ "
                + derivedUri;
    }
@@ -289,6 +290,10 @@ public class DocumentInfo implements Durable, Parcelable {
        return (flags & Document.FLAG_PARTIAL) != 0;
    }

    public boolean isBlockedFromTree() {
        return (flags & Document.FLAG_DIR_BLOCKS_TREE) != 0;
    }

    // Containers are documents which can be opened in DocumentsUI as folders.
    public boolean isContainer() {
        return isDirectory() || (isArchive() && !isInArchive() && !isPartial());
+1 −0
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ public class DebugView extends TableView implements DebugDisplay {
        put(R.string.debug_stream_types, "-");
        put(R.string.debug_raw_size, NumberFormat.getInstance().format(info.size));
        put(R.string.debug_is_archive, info.isArchive());
        put(R.string.debug_is_blocked_from_tree, info.isBlockedFromTree());
        put(R.string.debug_is_container, info.isContainer());
        put(R.string.debug_is_partial, info.isPartial());
        put(R.string.debug_is_virtual, info.isVirtual());
+3 −2
Original line number Diff line number Diff line
@@ -16,9 +16,9 @@

package com.android.documentsui.picker;

import static com.android.documentsui.services.FileOperationService.OPERATION_DELETE;
import static com.android.documentsui.services.FileOperationService.OPERATION_COPY;
import static com.android.documentsui.services.FileOperationService.OPERATION_COMPRESS;
import static com.android.documentsui.services.FileOperationService.OPERATION_COPY;
import static com.android.documentsui.services.FileOperationService.OPERATION_DELETE;
import static com.android.documentsui.services.FileOperationService.OPERATION_EXTRACT;
import static com.android.documentsui.services.FileOperationService.OPERATION_MOVE;
import static com.android.documentsui.services.FileOperationService.OPERATION_UNKNOWN;
@@ -172,6 +172,7 @@ public class PickFragment extends Fragment {
                mPick.setText(text);
                mPick.setWidth(Integer.MAX_VALUE);
                mCancel.setVisibility(View.GONE);
                mPick.setEnabled(!mPickTarget.isBlockedFromTree());
                break;
            case State.ACTION_PICK_COPY_DESTINATION:
                int titleId;