aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/services
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-12-14 22:03:33 +0100
committerChristian Schneppe <christian@pix-art.de>2018-12-14 22:04:42 +0100
commit155332f65b5fc5baaaff845f2c288056d7ae12ec (patch)
treef2d55cb9fe796c6dee67c02355706ddc7738df1f /src/main/java/de/pixart/messenger/services
parent7df333bf2a8aad44f082ac6a6a9ee49948ce36d7 (diff)
limit video transcoding to api >= 18 and other api 16 fixes
Diffstat (limited to 'src/main/java/de/pixart/messenger/services')
-rw-r--r--src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java b/src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java
index 1581638ae..d2f623c45 100644
--- a/src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java
+++ b/src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java
@@ -3,6 +3,7 @@ package de.pixart.messenger.services;
import android.net.Uri;
import android.os.Build;
import android.os.ParcelFileDescriptor;
+import android.support.annotation.RequiresApi;
import android.util.Log;
import net.ypresto.androidtranscoder.MediaTranscoder;
@@ -54,7 +55,7 @@ public class AttachFileToConversationRunnable implements Runnable, MediaTranscod
}
public boolean isVideoMessage() {
- return this.isVideoMessage;
+ return this.isVideoMessage && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2;
}
private void processAsFile() {
@@ -89,6 +90,7 @@ public class AttachFileToConversationRunnable implements Runnable, MediaTranscod
}
}
+ @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
private void processAsVideo() throws FileNotFoundException {
Log.d(Config.LOGTAG, "processing file as video");
mXmppConnectionService.startForcingForegroundNotification();
@@ -161,7 +163,7 @@ public class AttachFileToConversationRunnable implements Runnable, MediaTranscod
@Override
public void run() {
- if (isVideoMessage) {
+ if (this.isVideoMessage()) {
try {
processAsVideo();
} catch (FileNotFoundException e) {