Actual attachments size is the minimum size except images
Only images can be compressed before sending. Actual size got from a content uri is used for computing the minimum size for others. Test: Manual Change-Id: Id8d6ec24f80fe0eae70b6b1686ca7b199c70e313 Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
This commit is contained in:
@@ -492,16 +492,8 @@ public class MessagePartData implements Parcelable {
|
|||||||
}
|
}
|
||||||
// Other images should be arbitrarily resized by ImageResizer before sending.
|
// Other images should be arbitrarily resized by ImageResizer before sending.
|
||||||
return MmsUtils.MIN_IMAGE_BYTE_SIZE;
|
return MmsUtils.MIN_IMAGE_BYTE_SIZE;
|
||||||
} else if (isAudio()) {
|
} else if (isMedia()) {
|
||||||
// Audios are already recorded with the lowest sampling settings (AMR_NB), so just
|
// We can't compress attachments except images.
|
||||||
// return the file size as the minimum size.
|
|
||||||
return UriUtil.getContentSize(mContentUri);
|
|
||||||
} else if (isVideo()) {
|
|
||||||
final int mediaDurationMs = UriUtil.getMediaDurationMs(mContentUri);
|
|
||||||
return MmsUtils.MIN_VIDEO_BYTES_PER_SECOND * mediaDurationMs
|
|
||||||
/ TimeUnit.SECONDS.toMillis(1);
|
|
||||||
} else if (isVCard()) {
|
|
||||||
// We can't compress vCards.
|
|
||||||
return UriUtil.getContentSize(mContentUri);
|
return UriUtil.getContentSize(mContentUri);
|
||||||
} else {
|
} else {
|
||||||
// This is some unknown media type that we don't know how to handle. Log an error
|
// This is some unknown media type that we don't know how to handle. Log an error
|
||||||
|
|||||||
Reference in New Issue
Block a user