kopia lustrzana https://github.com/ryukoposting/Signal-Android
Improve logging around attachment compression failures.
rodzic
a340ebf74a
commit
6417f5cce0
|
@ -289,7 +289,7 @@ public class MessageSender {
|
||||||
final long threadId,
|
final long threadId,
|
||||||
final SmsDatabase.InsertListener insertListener)
|
final SmsDatabase.InsertListener insertListener)
|
||||||
{
|
{
|
||||||
Log.i(TAG, "Sending media message with pre-uploads to " + message.getRecipient().getId() + ", thread: " + threadId);
|
Log.i(TAG, "Sending media message with pre-uploads to " + message.getRecipient().getId() + ", thread: " + threadId + ", pre-uploads: " + preUploadResults);
|
||||||
Preconditions.checkArgument(message.getAttachments().isEmpty(), "If the media is pre-uploaded, there should be no attachments on the message.");
|
Preconditions.checkArgument(message.getAttachments().isEmpty(), "If the media is pre-uploaded, there should be no attachments on the message.");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -807,6 +807,11 @@ public class MessageSender {
|
||||||
ParcelUtil.writeStringCollection(dest, jobIds);
|
ParcelUtil.writeStringCollection(dest, jobIds);
|
||||||
dest.writeParcelable(media, flags);
|
dest.writeParcelable(media, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @NonNull String toString() {
|
||||||
|
return "{ID: " + attachmentId.getRowId() + ", URI: " + media.getUri() + ", Jobs: " + jobIds.stream().map(j -> "JOB::" + j).collect(Collectors.toList()) + "}";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum MessageSentEvent {
|
public enum MessageSentEvent {
|
||||||
|
|
|
@ -9,7 +9,9 @@ import androidx.annotation.Nullable;
|
||||||
import androidx.annotation.WorkerThread;
|
import androidx.annotation.WorkerThread;
|
||||||
|
|
||||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||||
|
import com.bumptech.glide.load.engine.GlideException;
|
||||||
|
|
||||||
|
import org.signal.core.util.logging.Log;
|
||||||
import org.thoughtcrime.securesms.mms.GlideApp;
|
import org.thoughtcrime.securesms.mms.GlideApp;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
|
@ -17,6 +19,8 @@ import java.util.concurrent.ExecutionException;
|
||||||
|
|
||||||
public final class ImageCompressionUtil {
|
public final class ImageCompressionUtil {
|
||||||
|
|
||||||
|
private static final String TAG = Log.tag(ImageCompressionUtil.class);
|
||||||
|
|
||||||
private ImageCompressionUtil () {}
|
private ImageCompressionUtil () {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -63,6 +67,9 @@ public final class ImageCompressionUtil {
|
||||||
.submit(maxDimension, maxDimension)
|
.submit(maxDimension, maxDimension)
|
||||||
.get();
|
.get();
|
||||||
} catch (ExecutionException | InterruptedException e) {
|
} catch (ExecutionException | InterruptedException e) {
|
||||||
|
if (e.getCause() instanceof GlideException) {
|
||||||
|
((GlideException) e.getCause()).logRootCauses(TAG);
|
||||||
|
}
|
||||||
throw new BitmapDecodingException(e);
|
throw new BitmapDecodingException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue