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:
commit
065088feb2
1 changed files with 4 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue