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

Commit 42f3fca4 authored by Tomasz Mikolajewski's avatar Tomasz Mikolajewski Committed by Android (Google) Code Review
Browse files

Merge "Fix breadcrumbs for archives."

parents 91ce97ac 99fb548d
Loading
Loading
Loading
Loading
+21 −8
Original line number Diff line number Diff line
@@ -149,15 +149,28 @@ public class ArchivesProvider extends DocumentsProvider implements Closeable {
            throws FileNotFoundException {
        final ArchiveId archiveId = ArchiveId.fromDocumentId(documentId);
        if (archiveId.mPath.equals("/")) {
            try (final Cursor archiveCursor = getContext().getContentResolver().query(
                    archiveId.mArchiveUri,
                    new String[] { Document.COLUMN_DISPLAY_NAME },
                    null, null, null, null)) {
                if (archiveCursor == null) {
                    throw new FileNotFoundException(
                            "Cannot resolve display name of the archive.");
                }
                archiveCursor.moveToFirst();
                final String displayName = archiveCursor.getString(
                        archiveCursor.getColumnIndex(Document.COLUMN_DISPLAY_NAME));

                final MatrixCursor cursor = new MatrixCursor(
                        projection != null ? projection : Archive.DEFAULT_PROJECTION);
                final RowBuilder row = cursor.newRow();
                row.add(Document.COLUMN_DOCUMENT_ID, documentId);
            row.add(Document.COLUMN_DISPLAY_NAME, "Archive");  // TODO: Translate.
                row.add(Document.COLUMN_DISPLAY_NAME, displayName);
                row.add(Document.COLUMN_SIZE, 0);
                row.add(Document.COLUMN_MIME_TYPE, Document.MIME_TYPE_DIR);
                return cursor;
            }
        }

        Loader loader = null;
        try {