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

Commit 10d65592 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Make directories always enabled, for realz." into klp-dev

parents 25b0151a 3d52dc9c
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -1060,16 +1060,16 @@ public class DirectoryFragment extends Fragment {
    private boolean isDocumentEnabled(String docMimeType, int docFlags) {
        final State state = getDisplayState(DirectoryFragment.this);

        // Read-only files are disabled when creating
        if (state.action == ACTION_CREATE && (docFlags & Document.FLAG_SUPPORTS_WRITE) == 0) {
            return false;
        }

        // Directories are always enabled
        if (Document.MIME_TYPE_DIR.equals(docMimeType)) {
            return true;
        }

        // Read-only files are disabled when creating
        if (state.action == ACTION_CREATE && (docFlags & Document.FLAG_SUPPORTS_WRITE) == 0) {
            return false;
        }

        return MimePredicate.mimeMatches(state.acceptMimes, docMimeType);
    }
}