aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2019-01-03 22:48:47 +0100
committerChristian Schneppe <christian@pix-art.de>2019-01-03 22:48:47 +0100
commit76c8a67ade32affffef1da61dd2f9454f730984e (patch)
tree2af6ef3035f32960fa11f6e5caeaa28c8a3c3b90 /src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java
parent5f79aa085d74dadabd475cfc51e4a214ccfaf0ad (diff)
introduced 'original' as video and image quality and do not ignorer error
Diffstat (limited to 'src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java')
-rw-r--r--src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java b/src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java
index 192d9221d..993de3bc6 100644
--- a/src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java
+++ b/src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java
@@ -49,12 +49,11 @@ public class AttachFileToConversationRunnable implements Runnable, MediaTranscod
this.originalFileSize = FileBackend.getFileSize(mXmppConnectionService, uri);
this.isVideoMessage = !getFileBackend().useFileAsIs(uri)
&& (mimeType != null && mimeType.startsWith("video/")
- && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2)
+ && (mXmppConnectionService.getCompressVideoBitratePreference() != 0 && mXmppConnectionService.getCompressVideoResolutionPreference() != 0))
&& originalFileSize > autoAcceptFileSize;
-
}
- public boolean isVideoMessage() {
+ boolean isVideoMessage() {
return this.isVideoMessage && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2;
}
@@ -110,8 +109,12 @@ public class AttachFileToConversationRunnable implements Runnable, MediaTranscod
mXmppConnectionService.stopForcingForegroundNotification();
throw new AssertionError(e);
} catch (ExecutionException e) {
- mXmppConnectionService.stopForcingForegroundNotification();
- Log.d(Config.LOGTAG, "ignoring execution exception. Should get handled by onTranscodeFiled() instead", e);
+ if (e.getCause() instanceof Error) {
+ mXmppConnectionService.stopForcingForegroundNotification();
+ processAsFile();
+ } else {
+ Log.d(Config.LOGTAG, "ignoring execution exception. Should get handled by onTranscodeFiled() instead", e);
+ }
}
}