mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-05-01 14:13:22 +01:00
Improve UI send latency
// FREEBIE
This commit is contained in:
@@ -28,18 +28,22 @@ public abstract class Attachment {
|
||||
@Nullable
|
||||
private final byte[] digest;
|
||||
|
||||
@Nullable
|
||||
private final String fastPreflightId;
|
||||
|
||||
public Attachment(@NonNull String contentType, int transferState, long size, @Nullable String fileName,
|
||||
@Nullable String location, @Nullable String key, @Nullable String relay,
|
||||
@Nullable byte[] digest)
|
||||
@Nullable byte[] digest, @Nullable String fastPreflightId)
|
||||
{
|
||||
this.contentType = contentType;
|
||||
this.transferState = transferState;
|
||||
this.size = size;
|
||||
this.fileName = fileName;
|
||||
this.location = location;
|
||||
this.key = key;
|
||||
this.relay = relay;
|
||||
this.digest = digest;
|
||||
this.contentType = contentType;
|
||||
this.transferState = transferState;
|
||||
this.size = size;
|
||||
this.fileName = fileName;
|
||||
this.location = location;
|
||||
this.key = key;
|
||||
this.relay = relay;
|
||||
this.digest = digest;
|
||||
this.fastPreflightId = fastPreflightId;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -90,4 +94,9 @@ public abstract class Attachment {
|
||||
public byte[] getDigest() {
|
||||
return digest;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getFastPreflightId() {
|
||||
return fastPreflightId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,9 +16,9 @@ public class DatabaseAttachment extends Attachment {
|
||||
boolean hasData, boolean hasThumbnail,
|
||||
String contentType, int transferProgress, long size,
|
||||
String fileName, String location, String key, String relay,
|
||||
byte[] digest)
|
||||
byte[] digest, String fastPreflightId)
|
||||
{
|
||||
super(contentType, transferProgress, size, fileName, location, key, relay, digest);
|
||||
super(contentType, transferProgress, size, fileName, location, key, relay, digest, fastPreflightId);
|
||||
this.attachmentId = attachmentId;
|
||||
this.hasData = hasData;
|
||||
this.hasThumbnail = hasThumbnail;
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.thoughtcrime.securesms.database.MmsDatabase;
|
||||
public class MmsNotificationAttachment extends Attachment {
|
||||
|
||||
public MmsNotificationAttachment(int status, long size) {
|
||||
super("application/mms", getTransferStateFromStatus(status), size, null, null, null, null, null);
|
||||
super("application/mms", getTransferStateFromStatus(status), size, null, null, null, null, null, null);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -20,7 +20,7 @@ public class PointerAttachment extends Attachment {
|
||||
@NonNull String key, @NonNull String relay,
|
||||
@Nullable byte[] digest)
|
||||
{
|
||||
super(contentType, transferState, size, fileName, location, key, relay, digest);
|
||||
super(contentType, transferState, size, fileName, location, key, relay, digest, null);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -12,14 +12,14 @@ public class UriAttachment extends Attachment {
|
||||
public UriAttachment(@NonNull Uri uri, @NonNull String contentType, int transferState, long size,
|
||||
@Nullable String fileName)
|
||||
{
|
||||
this(uri, uri, contentType, transferState, size, fileName);
|
||||
this(uri, uri, contentType, transferState, size, fileName, null);
|
||||
}
|
||||
|
||||
public UriAttachment(@NonNull Uri dataUri, @Nullable Uri thumbnailUri,
|
||||
@NonNull String contentType, int transferState, long size,
|
||||
@Nullable String fileName)
|
||||
@Nullable String fileName, @Nullable String fastPreflightId)
|
||||
{
|
||||
super(contentType, transferState, size, fileName, null, null, null, null);
|
||||
super(contentType, transferState, size, fileName, null, null, null, null, fastPreflightId);
|
||||
this.dataUri = dataUri;
|
||||
this.thumbnailUri = thumbnailUri;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user