From 15de57c4a50b81b3b2258a0d3481de656d94c79b Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 1 Mar 2024 11:42:15 +0000 Subject: [PATCH] Bump SDK version to 33 --- build.gradle | 4 ++-- .../siacs/conversations/persistance/FileBackend.java | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 6332dfde0..e4537e71a 100644 --- a/build.gradle +++ b/build.gradle @@ -86,11 +86,11 @@ ext { android { namespace 'eu.siacs.conversations' - compileSdkVersion 32 + compileSdkVersion 33 defaultConfig { minSdkVersion 21 - targetSdkVersion 32 + targetSdkVersion 33 versionCode 42051 versionName "2.12.2-2" archivesBaseName += "-$versionName" diff --git a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java index 8519e5dbd..3c193219e 100644 --- a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java +++ b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java @@ -143,7 +143,7 @@ public static boolean allFilesUnderSize( "do not consider video file with min width larger than 720 for size check"); continue; } - } catch (NotAVideoFile notAVideoFile) { + } catch (final IOException | NotAVideoFile e) { // ignore and fall through } } @@ -268,7 +268,7 @@ private static int calcSampleSize(BitmapFactory.Options options, int size) { return inSampleSize; } - private static Dimensions getVideoDimensions(Context context, Uri uri) throws NotAVideoFile { + private static Dimensions getVideoDimensions(Context context, Uri uri) throws NotAVideoFile, IOException { MediaMetadataRetriever mediaMetadataRetriever = new MediaMetadataRetriever(); try { mediaMetadataRetriever.setDataSource(context, uri); @@ -294,7 +294,7 @@ private static Dimensions getVideoDimensionsOfFrame( } private static Dimensions getVideoDimensions(MediaMetadataRetriever metadataRetriever) - throws NotAVideoFile { + throws NotAVideoFile, IOException { String hasVideo = metadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_HAS_VIDEO); if (hasVideo == null) { @@ -1527,7 +1527,7 @@ public void updateFileParams(final Message message, final String url) { Log.d(Config.LOGTAG, "ambiguous file " + mime + " is audio"); body.append("|0|0|").append(getMediaRuntime(file)); } - } catch (final NotAVideoFile e) { + } catch (final IOException | NotAVideoFile e) { Log.d(Config.LOGTAG, "ambiguous file " + mime + " is audio"); body.append("|0|0|").append(getMediaRuntime(file)); } @@ -1547,7 +1547,7 @@ public void updateFileParams(final Message message, final String url) { .append('|') .append(dimensions.height); } - } catch (NotAVideoFile notAVideoFile) { + } catch (final IOException | NotAVideoFile notAVideoFile) { Log.d( Config.LOGTAG, "file with mime type " + file.getMimeType() + " was not a video file"); @@ -1592,7 +1592,7 @@ private Dimensions getImageDimensions(File file) { return new Dimensions(imageHeight, imageWidth); } - private Dimensions getVideoDimensions(File file) throws NotAVideoFile { + private Dimensions getVideoDimensions(final File file) throws NotAVideoFile, IOException { MediaMetadataRetriever metadataRetriever = new MediaMetadataRetriever(); try { metadataRetriever.setDataSource(file.getAbsolutePath());