Fix videos losing their extension after forwarding.

Special thanks to @signalien

Fixes #7783
This commit is contained in:
Greyson Parrelli 2018-08-13 16:55:58 -04:00
parent 2882ef6d9f
commit 2acbea014b

View File

@ -69,8 +69,8 @@ public class MediaUtil {
public static @Nullable String getMimeType(Context context, Uri uri) {
if (uri == null) return null;
if (PersistentBlobProvider.isAuthority(context, uri)) {
return PersistentBlobProvider.getMimeType(context, uri);
if (PartAuthority.isLocalUri(uri)) {
return PartAuthority.getAttachmentContentType(context, uri);
}
String type = context.getContentResolver().getType(uri);
@ -78,6 +78,7 @@ public class MediaUtil {
final String extension = MimeTypeMap.getFileExtensionFromUrl(uri.toString());
type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension.toLowerCase());
}
return getCorrectedMimeType(type);
}