aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-05-16 21:51:13 +0200
committerChristian Schneppe <christian@pix-art.de>2018-05-16 21:51:13 +0200
commit78211bfd01bbb8a9adf34c4c6fa6e6932259f669 (patch)
treef413947d22636d7ebe3c302acd3d45e4ad4d327a /src/main/java/de/pixart
parentf8ec77ab9689193e366eb3aed51cb17d1ccbd986 (diff)
fix exceptions
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r--src/main/java/de/pixart/messenger/persistance/FileBackend.java6
-rw-r--r--src/main/java/de/pixart/messenger/services/NotificationService.java4
-rw-r--r--src/main/java/de/pixart/messenger/ui/XmppActivity.java6
3 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/de/pixart/messenger/persistance/FileBackend.java b/src/main/java/de/pixart/messenger/persistance/FileBackend.java
index 17290864a..4d9e09d00 100644
--- a/src/main/java/de/pixart/messenger/persistance/FileBackend.java
+++ b/src/main/java/de/pixart/messenger/persistance/FileBackend.java
@@ -485,7 +485,7 @@ public class FileBackend {
}
}
- public Bitmap getThumbnail(Message message, int size, boolean cacheOnly) throws FileNotFoundException {
+ public Bitmap getThumbnail(Message message, int size, boolean cacheOnly) throws IOException {
final String uuid = message.getUuid();
final LruCache<String, Bitmap> cache = mXmppConnectionService.getBitmapCache();
Bitmap thumbnail = cache.get(uuid);
@@ -549,7 +549,7 @@ public class FileBackend {
return paint;
}
- private Bitmap getVideoPreview(File file, int size) {
+ private Bitmap getVideoPreview(File file, int size) throws IOException {
MediaMetadataRetriever metadataRetriever = new MediaMetadataRetriever();
Bitmap frame;
try {
@@ -557,7 +557,7 @@ public class FileBackend {
frame = metadataRetriever.getFrameAtTime(0);
metadataRetriever.release();
frame = resize(frame, size);
- } catch(RuntimeException e) {
+ } catch (IOException | RuntimeException e) {
frame = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
frame.eraseColor(0xff000000);
}
diff --git a/src/main/java/de/pixart/messenger/services/NotificationService.java b/src/main/java/de/pixart/messenger/services/NotificationService.java
index 62461c0c0..4b190c65e 100644
--- a/src/main/java/de/pixart/messenger/services/NotificationService.java
+++ b/src/main/java/de/pixart/messenger/services/NotificationService.java
@@ -25,7 +25,7 @@ import android.util.Log;
import android.util.Pair;
import java.io.File;
-import java.io.FileNotFoundException;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
@@ -508,7 +508,7 @@ public class NotificationService {
builder.setContentText(UIHelper.getFileDescriptionString(mXmppConnectionService, message));
}
builder.setStyle(bigPictureStyle);
- } catch (final FileNotFoundException e) {
+ } catch (final IOException e) {
modifyForTextOnly(builder, uBuilder, messages);
}
}
diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java
index fc5f6a30e..f49331c5b 100644
--- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java
@@ -52,7 +52,7 @@ import android.widget.Toast;
import net.java.otr4j.session.SessionID;
-import java.io.FileNotFoundException;
+import java.io.IOException;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collections;
@@ -1083,7 +1083,7 @@ public abstract class XmppActivity extends ActionBarActivity {
Bitmap bm;
try {
bm = xmppConnectionService.getFileBackend().getThumbnail(message, (int) (metrics.density * 288), true);
- } catch (FileNotFoundException e) {
+ } catch (IOException e) {
bm = null;
}
if (bm != null) {
@@ -1181,7 +1181,7 @@ public abstract class XmppActivity extends ActionBarActivity {
} else {
return null;
}
- } catch (FileNotFoundException e) {
+ } catch (IOException e) {
return null;
}
}