2015-01-02 15:43:28 -08:00
|
|
|
package org.thoughtcrime.securesms.mms;
|
|
|
|
|
2015-06-04 14:19:10 -07:00
|
|
|
import android.content.Context;
|
|
|
|
|
|
|
|
import org.thoughtcrime.securesms.util.Util;
|
|
|
|
|
2015-01-02 15:43:28 -08:00
|
|
|
public class MmsMediaConstraints extends MediaConstraints {
|
2015-06-04 14:19:10 -07:00
|
|
|
private static final int MAX_IMAGE_DIMEN_LOWMEM = 768;
|
|
|
|
private static final int MAX_IMAGE_DIMEN = 1024;
|
|
|
|
public static final int MAX_MESSAGE_SIZE = 280 * 1024;
|
2015-01-02 15:43:28 -08:00
|
|
|
|
|
|
|
@Override
|
2015-06-04 14:19:10 -07:00
|
|
|
public int getImageMaxWidth(Context context) {
|
|
|
|
return Util.isLowMemory(context) ? MAX_IMAGE_DIMEN_LOWMEM : MAX_IMAGE_DIMEN;
|
2015-01-02 15:43:28 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-06-04 14:19:10 -07:00
|
|
|
public int getImageMaxHeight(Context context) {
|
|
|
|
return getImageMaxWidth(context);
|
2015-01-02 15:43:28 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getImageMaxSize() {
|
|
|
|
return MAX_MESSAGE_SIZE;
|
|
|
|
}
|
|
|
|
|
2015-07-15 13:42:59 -07:00
|
|
|
@Override
|
|
|
|
public int getGifMaxSize() {
|
|
|
|
return MAX_MESSAGE_SIZE;
|
|
|
|
}
|
|
|
|
|
2015-01-02 15:43:28 -08:00
|
|
|
@Override
|
|
|
|
public int getVideoMaxSize() {
|
|
|
|
return MAX_MESSAGE_SIZE;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getAudioMaxSize() {
|
|
|
|
return MAX_MESSAGE_SIZE;
|
|
|
|
}
|
2017-04-24 15:52:48 -07:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getDocumentMaxSize() {
|
|
|
|
return MAX_MESSAGE_SIZE;
|
|
|
|
}
|
2015-01-02 15:43:28 -08:00
|
|
|
}
|