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

Commit fc3fc0df authored by François Degros's avatar François Degros
Browse files

Ignore conflicting entries in archive

Simply ignore the conflicting entries instead of failing to open the
archive altogether.

Flag: EXEMPT bug fix
Bug: 385237180
Test: atest DocumentsUIGoogleTests:com.android.documentsui.archives
Change-Id: I356705c65359190c7e913052b6bb31c186dd4642
parent 520cba01
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -105,10 +105,10 @@ public class ReadableArchive extends Archive {
                continue;
            }
            entryPath = getEntryPath(entry);
            if (mEntries.containsKey(entryPath)) {
                throw new IOException("Multiple entries with the same name are not supported.");
            if (mEntries.putIfAbsent(entryPath, entry) != null) {
                if (DEBUG) Log.d(TAG, "Ignored conflicting entry for '" + entryPath + "'");
                continue;
            }
            mEntries.put(entryPath, entry);
            if (entry.isDirectory()) {
                mTree.put(entryPath, new ArrayList<ArchiveEntry>());
            }