mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Preclude cancelation of pre-uploaded video attachments.
Addresses ##10225.
This commit is contained in:
@@ -49,18 +49,18 @@ public abstract class MediaConstraints {
|
||||
public abstract int[] getImageDimensionTargets(Context context);
|
||||
|
||||
public abstract long getGifMaxSize(Context context);
|
||||
public abstract long getVideoMaxSize(Context context);
|
||||
public abstract long getVideoMaxSize();
|
||||
|
||||
public @IntRange(from = 0, to = 100) int getImageCompressionQualitySetting(@NonNull Context context) {
|
||||
return 70;
|
||||
}
|
||||
|
||||
public long getUncompressedVideoMaxSize(Context context) {
|
||||
return getVideoMaxSize(context);
|
||||
return getVideoMaxSize();
|
||||
}
|
||||
|
||||
public long getCompressedVideoMaxSize(Context context) {
|
||||
return getVideoMaxSize(context);
|
||||
return getVideoMaxSize();
|
||||
}
|
||||
|
||||
public abstract long getAudioMaxSize(Context context);
|
||||
@@ -79,7 +79,7 @@ public abstract class MediaConstraints {
|
||||
return (MediaUtil.isGif(attachment) && size <= getGifMaxSize(context) && isWithinBounds(context, attachment.getUri())) ||
|
||||
(MediaUtil.isImage(attachment) && size <= getImageMaxSize(context) && isWithinBounds(context, attachment.getUri())) ||
|
||||
(MediaUtil.isAudio(attachment) && size <= getAudioMaxSize(context)) ||
|
||||
(MediaUtil.isVideo(attachment) && size <= getVideoMaxSize(context)) ||
|
||||
(MediaUtil.isVideo(attachment) && size <= getVideoMaxSize()) ||
|
||||
(MediaUtil.isFile(attachment) && size <= getDocumentMaxSize(context));
|
||||
} catch (IOException ioe) {
|
||||
Log.w(TAG, "Failed to determine if media's constraints are satisfied.", ioe);
|
||||
@@ -95,7 +95,7 @@ public abstract class MediaConstraints {
|
||||
return (MediaUtil.isGif(contentType) && size <= getGifMaxSize(context) && isWithinBounds(context, uri)) ||
|
||||
(MediaUtil.isImageType(contentType) && size <= getImageMaxSize(context) && isWithinBounds(context, uri)) ||
|
||||
(MediaUtil.isAudioType(contentType) && size <= getAudioMaxSize(context)) ||
|
||||
(MediaUtil.isVideoType(contentType) && size <= getVideoMaxSize(context)) ||
|
||||
(MediaUtil.isVideoType(contentType) && size <= getVideoMaxSize()) ||
|
||||
size <= getDocumentMaxSize(context);
|
||||
} catch (IOException ioe) {
|
||||
Log.w(TAG, "Failed to determine if media's constraints are satisfied.", ioe);
|
||||
|
||||
@@ -53,14 +53,14 @@ public class PushMediaConstraints extends MediaConstraints {
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getVideoMaxSize(Context context) {
|
||||
public long getVideoMaxSize() {
|
||||
return getMaxAttachmentSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getUncompressedVideoMaxSize(Context context) {
|
||||
return isVideoTranscodeAvailable() ? RemoteConfig.maxSourceTranscodeVideoSizeBytes()
|
||||
: getVideoMaxSize(context);
|
||||
: getVideoMaxSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user