summaryrefslogtreecommitdiff
path: root/packages/MtpDocumentsProvider
diff options
context:
space:
mode:
Diffstat (limited to 'packages/MtpDocumentsProvider')
-rw-r--r--packages/MtpDocumentsProvider/src/com/android/mtp/MtpDatabase.java20
1 files changed, 1 insertions, 19 deletions
diff --git a/packages/MtpDocumentsProvider/src/com/android/mtp/MtpDatabase.java b/packages/MtpDocumentsProvider/src/com/android/mtp/MtpDatabase.java
index f243b51d6769..59c205aebe18 100644
--- a/packages/MtpDocumentsProvider/src/com/android/mtp/MtpDatabase.java
+++ b/packages/MtpDocumentsProvider/src/com/android/mtp/MtpDatabase.java
@@ -851,25 +851,7 @@ class MtpDatabase {
return DocumentsContract.Document.MIME_TYPE_DIR;
}
- final String formatCodeMimeType = MediaFile.getMimeTypeForFormatCode(info.getFormat());
- final String mediaFileMimeType = MediaFile.getMimeTypeForFile(info.getName());
-
- // Format code can be mapped with multiple mime types, e.g. FORMAT_MPEG is mapped with
- // audio/mp4 and video/mp4.
- // As file extension contains more information than format code, returns mime type obtained
- // from file extension if it is consistent with format code.
- if (mediaFileMimeType != null &&
- MediaFile.getFormatCode("", mediaFileMimeType) == info.getFormat()) {
- return mediaFileMimeType;
- }
- if (formatCodeMimeType != null) {
- return formatCodeMimeType;
- }
- if (mediaFileMimeType != null) {
- return mediaFileMimeType;
- }
- // We don't know the file type.
- return "application/octet-stream";
+ return MediaFile.getMimeType(info.getName(), info.getFormat());
}
private static int getRootFlags(int[] operationsSupported) {