Commit b2844911 authored by Evan W. Patton's avatar Evan W. Patton Committed by Jeffrey Schiller

Fallback to application/octet-stream for unknown file types

Change-Id: I2dcc304bbca68827c0b92dd5b1ef012d21de1db1
parent 77150161
......@@ -98,6 +98,10 @@ public class Sharing extends AndroidNonvisibleComponent {
String fileExtension = file.substring(file.lastIndexOf(".")+1).toLowerCase();
MimeTypeMap mime = MimeTypeMap.getSingleton();
String type = mime.getMimeTypeFromExtension(fileExtension);
if (type == null) {
// Fix for #1701: We don't know what it is, but it's at least a sequence of bytes (we hope)
type = "application/octet-stream";
}
Uri shareableUri = NougatUtil.getPackageUri(form, imageFile);
Intent shareIntent = new Intent(Intent.ACTION_SEND);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment