Merge pull request #776 from k9mail/GH-744_attachment_mime_type

Prefer attachment MIME type from content provider over information from intent

Fixes #744
This commit is contained in:
cketti 2015-09-13 03:03:16 +02:00
commit 065088feb2

View file

@ -68,10 +68,11 @@ public class AttachmentInfoLoader extends AsyncTaskLoader<Attachment> {
name = uri.getLastPathSegment();
}
String usableContentType = contentType;
if ((usableContentType == null) || (usableContentType.indexOf('*') != -1)) {
usableContentType = contentResolver.getType(uri);
String usableContentType = contentResolver.getType(uri);
if (usableContentType == null && contentType != null && contentType.indexOf('*') != -1) {
usableContentType = contentType;
}
if (usableContentType == null) {
usableContentType = MimeUtility.getMimeTypeByExtension(name);
}