session-android/src/org/thoughtcrime/securesms/mms/PushMediaConstraints.java

48 lines
1.2 KiB
Java
Raw Normal View History

2015-01-02 23:43:28 +00:00
package org.thoughtcrime.securesms.mms;
import android.content.Context;
import org.thoughtcrime.securesms.util.Util;
2020-04-09 03:38:15 +00:00
import org.whispersystems.signalservice.loki.api.fileserver.LokiFileServerAPI;
2015-01-02 23:43:28 +00:00
public class PushMediaConstraints extends MediaConstraints {
private static final int MAX_IMAGE_DIMEN_LOWMEM = 768;
private static final int MAX_IMAGE_DIMEN = 4096;
2015-01-02 23:43:28 +00:00
@Override
public int getImageMaxWidth(Context context) {
return Util.isLowMemory(context) ? MAX_IMAGE_DIMEN_LOWMEM : MAX_IMAGE_DIMEN;
2015-01-02 23:43:28 +00:00
}
@Override
public int getImageMaxHeight(Context context) {
return getImageMaxWidth(context);
2015-01-02 23:43:28 +00:00
}
@Override
public int getImageMaxSize(Context context) {
2020-02-11 00:00:00 +00:00
return LokiFileServerAPI.Companion.getMaxFileSize();
2015-01-02 23:43:28 +00:00
}
@Override
public int getGifMaxSize(Context context) {
2020-02-11 00:00:00 +00:00
return LokiFileServerAPI.Companion.getMaxFileSize();
}
2015-01-02 23:43:28 +00:00
@Override
public int getVideoMaxSize(Context context) {
2020-02-11 00:00:00 +00:00
return LokiFileServerAPI.Companion.getMaxFileSize();
2015-01-02 23:43:28 +00:00
}
@Override
public int getAudioMaxSize(Context context) {
2020-02-11 00:00:00 +00:00
return LokiFileServerAPI.Companion.getMaxFileSize();
2015-01-02 23:43:28 +00:00
}
@Override
public int getDocumentMaxSize(Context context) {
2020-02-11 00:00:00 +00:00
return LokiFileServerAPI.Companion.getMaxFileSize();
}
2015-01-02 23:43:28 +00:00
}