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

Commit 3d52dc9c authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Make directories always enabled, for realz.

Bug: 10946731
Change-Id: I3eb132c53e47f31d1d1723ed2262823b54b1fce0
parent ee2f7df9
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);
    }
}