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

Commit 1199f70e authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android Git Automerger
Browse files

am 10d65592: Merge "Make directories always enabled, for realz." into klp-dev

* commit '10d65592':
  Make directories always enabled, for realz.
parents b31aea5f 10d65592
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);
    }
}