diff --git a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java index 821899eb7..faeca6308 100644 --- a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java +++ b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java @@ -437,7 +437,7 @@ public class FileBackend { return bitmap; } final String mime = attachment.getMime(); - if ("application/pdf".equals(mime) && Compatibility.runsTwentyOne()) { + if ("application/pdf".equals(mime)) { bitmap = cropCenterSquarePdf(attachment.getUri(), size); drawOverlay( bitmap, @@ -961,7 +961,7 @@ public class FileBackend { } DownloadableFile file = getFile(message); final String mime = file.getMimeType(); - if ("application/pdf".equals(mime) && Compatibility.runsTwentyOne()) { + if ("application/pdf".equals(mime)) { thumbnail = getPdfDocumentPreview(file, size); } else if (mime.startsWith("video/")) { thumbnail = getVideoPreview(file, size); @@ -1507,12 +1507,12 @@ public class FileBackend { body.append(url); } body.append('|').append(file.getSize()); - if (image || video || (pdf && Compatibility.runsTwentyOne())) { + if (image || video || pdf) { try { final Dimensions dimensions; if (video) { dimensions = getVideoDimensions(file); - } else if (pdf && Compatibility.runsTwentyOne()) { + } else if (pdf) { dimensions = getPdfDocumentDimensions(file); } else { dimensions = getImageDimensions(file); diff --git a/src/main/java/eu/siacs/conversations/ui/util/Attachment.java b/src/main/java/eu/siacs/conversations/ui/util/Attachment.java index b539c70ef..f994955d0 100644 --- a/src/main/java/eu/siacs/conversations/ui/util/Attachment.java +++ b/src/main/java/eu/siacs/conversations/ui/util/Attachment.java @@ -179,7 +179,7 @@ public class Attachment implements Parcelable { private static boolean renderFileThumbnail(final String mime) { return mime.startsWith("video/") || isImage(mime) - || (Compatibility.runsTwentyOne() && "application/pdf".equals(mime)); + || "application/pdf".equals(mime); } public Uri getUri() { diff --git a/src/main/java/eu/siacs/conversations/utils/Compatibility.java b/src/main/java/eu/siacs/conversations/utils/Compatibility.java index f181853c6..aadeaabf5 100644 --- a/src/main/java/eu/siacs/conversations/utils/Compatibility.java +++ b/src/main/java/eu/siacs/conversations/utils/Compatibility.java @@ -43,10 +43,6 @@ public class Compatibility { return Build.VERSION.SDK_INT < Build.VERSION_CODES.M || ContextCompat.checkSelfPermission(context, android.Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED; } - public static boolean runsTwentyOne() { - return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP; - } - private static boolean runsTwentyFour() { return Build.VERSION.SDK_INT >= Build.VERSION_CODES.N; }