mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-11 19:43:11 +02:00
Fix shared mime types
This commit is contained in:
@@ -51,17 +51,23 @@ public class UriType implements Parcelable {
|
||||
}
|
||||
} else
|
||||
this.type = type;
|
||||
fixMimeType(context);
|
||||
}
|
||||
|
||||
public UriType(Uri uri, String type, Context context) {
|
||||
type = "image/*";
|
||||
this.uri = uri;
|
||||
if (!TextUtils.isEmpty(type))
|
||||
this.type = type;
|
||||
fixMimeType(context);
|
||||
}
|
||||
|
||||
//if (context != null) {
|
||||
// Helper.UriInfo info = Helper.getInfo(this, context);
|
||||
// this.type = EntityAttachment.getMimeType(type, info.name);
|
||||
//}
|
||||
private void fixMimeType(Context context) {
|
||||
if (context != null &&
|
||||
(type == null || type.endsWith("/*"))) {
|
||||
Helper.UriInfo info = Helper.getInfo(this, context);
|
||||
this.type = EntityAttachment.getMimeType(type, info.name);
|
||||
}
|
||||
}
|
||||
|
||||
public Uri getUri() {
|
||||
|
||||
Reference in New Issue
Block a user