Add more MIME types to the documents-archive support library.
Some providers, such as DownloadStorageProvider may return such
unofficial ZIP MIME types.
Bug: 20176812
Change-Id: I11a364845db4e8345fc7c53ac586be70eab1a7b6
diff --git a/documents-archive/src/android/support/provider/DocumentArchiveHelper.java b/documents-archive/src/android/support/provider/DocumentArchiveHelper.java
index 1e84215..387104a 100644
--- a/documents-archive/src/android/support/provider/DocumentArchiveHelper.java
+++ b/documents-archive/src/android/support/provider/DocumentArchiveHelper.java
@@ -61,7 +61,9 @@
private static final String TAG = "DocumentArchiveHelper";
private static final int OPENED_ARCHIVES_CACHE_SIZE = 4;
- private static final String ZIP_MIME_TYPE = "application/zip";
+ private static final String[] ZIP_MIME_TYPES = {
+ "application/zip", "application/x-zip", "application/x-zip-compressed"
+ };
private final DocumentsProvider mProvider;
private final char mIdDelimiter;
@@ -194,7 +196,12 @@
* Returns true if the passed mime type is supported by the helper.
*/
public boolean isSupportedArchiveType(String mimeType) {
- return ZIP_MIME_TYPE.equals(mimeType);
+ for (final String zipMimeType : ZIP_MIME_TYPES) {
+ if (zipMimeType.equals(mimeType)) {
+ return true;
+ }
+ }
+ return false;
}
/**