Remove AttachmentsV3 feature flag.
This commit is contained in:
parent
dc4faf57cb
commit
706f43caa8
7 changed files with 10 additions and 36 deletions
|
@ -138,8 +138,7 @@ public class ApplicationDependencies {
|
|||
messageSender.update(
|
||||
IncomingMessageObserver.getPipe(),
|
||||
IncomingMessageObserver.getUnidentifiedPipe(),
|
||||
TextSecurePreferences.isMultiDevice(application),
|
||||
FeatureFlags.attachmentsV3());
|
||||
TextSecurePreferences.isMultiDevice(application));
|
||||
}
|
||||
|
||||
return messageSender;
|
||||
|
|
|
@ -95,7 +95,6 @@ public class ApplicationDependencyProvider implements ApplicationDependencies.Pr
|
|||
new SignalProtocolStoreImpl(context),
|
||||
BuildConfig.SIGNAL_AGENT,
|
||||
TextSecurePreferences.isMultiDevice(context),
|
||||
FeatureFlags.attachmentsV3(),
|
||||
Optional.fromNullable(IncomingMessageObserver.getPipe()),
|
||||
Optional.fromNullable(IncomingMessageObserver.getUnidentifiedPipe()),
|
||||
Optional.of(new SecurityEventListener(context)),
|
||||
|
|
|
@ -261,14 +261,11 @@ public class MultiDeviceContactUpdateJob extends BaseJob {
|
|||
{
|
||||
if (length > 0) {
|
||||
try {
|
||||
SignalServiceAttachmentStream.Builder attachmentStream = SignalServiceAttachment.newStreamBuilder()
|
||||
.withStream(stream)
|
||||
.withContentType("application/octet-stream")
|
||||
.withLength(length);
|
||||
|
||||
if (FeatureFlags.attachmentsV3()) {
|
||||
attachmentStream.withResumableUploadSpec(messageSender.getResumableUploadSpec());
|
||||
}
|
||||
SignalServiceAttachmentStream.Builder attachmentStream = SignalServiceAttachment.newStreamBuilder()
|
||||
.withStream(stream)
|
||||
.withContentType("application/octet-stream")
|
||||
.withLength(length)
|
||||
.withResumableUploadSpec(messageSender.getResumableUploadSpec());
|
||||
|
||||
messageSender.sendMessage(SignalServiceSyncMessage.forContacts(new ContactsMessage(attachmentStream.build(), complete)),
|
||||
UnidentifiedAccessUtil.getAccessForSync(context));
|
||||
|
|
|
@ -255,11 +255,8 @@ public abstract class PushSendJob extends SendJob {
|
|||
.withWidth(thumbnailData.getWidth())
|
||||
.withHeight(thumbnailData.getHeight())
|
||||
.withLength(thumbnailData.getBitmap().length)
|
||||
.withStream(new ByteArrayInputStream(thumbnailData.getBitmap()));
|
||||
|
||||
if (FeatureFlags.attachmentsV3()) {
|
||||
builder.withResumableUploadSpec(ApplicationDependencies.getSignalServiceMessageSender().getResumableUploadSpec());
|
||||
}
|
||||
.withStream(new ByteArrayInputStream(thumbnailData.getBitmap()))
|
||||
.withResumableUploadSpec(ApplicationDependencies.getSignalServiceMessageSender().getResumableUploadSpec());
|
||||
|
||||
thumbnail = builder.build();
|
||||
}
|
||||
|
|
|
@ -35,11 +35,6 @@ public class ResumableUploadSpecJob extends BaseJob {
|
|||
|
||||
@Override
|
||||
protected void onRun() throws Exception {
|
||||
if (!FeatureFlags.attachmentsV3()) {
|
||||
Log.i(TAG, "Attachments V3 is not enabled so there is nothing to do!");
|
||||
return;
|
||||
}
|
||||
|
||||
ResumableUploadSpec resumableUploadSpec = ApplicationDependencies.getSignalServiceMessageSender()
|
||||
.getResumableUploadSpec();
|
||||
|
||||
|
|
|
@ -50,7 +50,6 @@ public final class FeatureFlags {
|
|||
private static final long FETCH_INTERVAL = TimeUnit.HOURS.toMillis(2);
|
||||
|
||||
private static final String USERNAMES = "android.usernames";
|
||||
private static final String ATTACHMENTS_V3 = "android.attachmentsV3.2";
|
||||
private static final String REMOTE_DELETE = "android.remoteDelete";
|
||||
private static final String GROUPS_V2_OLD_1 = "android.groupsv2";
|
||||
private static final String GROUPS_V2_OLD_2 = "android.groupsv2.2";
|
||||
|
@ -73,7 +72,6 @@ public final class FeatureFlags {
|
|||
*/
|
||||
|
||||
private static final Set<String> REMOTE_CAPABLE = Sets.newHashSet(
|
||||
ATTACHMENTS_V3,
|
||||
REMOTE_DELETE,
|
||||
GROUPS_V2,
|
||||
GROUPS_V2_CREATE_VERSION,
|
||||
|
@ -106,7 +104,6 @@ public final class FeatureFlags {
|
|||
* more burden on the reader to ensure that the app experience remains consistent.
|
||||
*/
|
||||
private static final Set<String> HOT_SWAPPABLE = Sets.newHashSet(
|
||||
ATTACHMENTS_V3,
|
||||
GROUPS_V2_CREATE_VERSION,
|
||||
GROUPS_V2_JOIN_VERSION,
|
||||
VERIFY_V2,
|
||||
|
@ -196,11 +193,6 @@ public final class FeatureFlags {
|
|||
return getBoolean(USERNAMES, false);
|
||||
}
|
||||
|
||||
/** Whether or not we use the attachments v3 form. */
|
||||
public static boolean attachmentsV3() {
|
||||
return getBoolean(ATTACHMENTS_V3, false);
|
||||
}
|
||||
|
||||
/** Send support for remotely deleting a message. */
|
||||
public static boolean remoteDelete() {
|
||||
return getBoolean(REMOTE_DELETE, false);
|
||||
|
|
|
@ -124,7 +124,6 @@ public class SignalServiceMessageSender {
|
|||
private final AtomicReference<Optional<SignalServiceMessagePipe>> pipe;
|
||||
private final AtomicReference<Optional<SignalServiceMessagePipe>> unidentifiedPipe;
|
||||
private final AtomicBoolean isMultiDevice;
|
||||
private final AtomicBoolean attachmentsV3;
|
||||
|
||||
private final ExecutorService executor;
|
||||
|
||||
|
@ -144,14 +143,13 @@ public class SignalServiceMessageSender {
|
|||
SignalProtocolStore store,
|
||||
String signalAgent,
|
||||
boolean isMultiDevice,
|
||||
boolean attachmentsV3,
|
||||
Optional<SignalServiceMessagePipe> pipe,
|
||||
Optional<SignalServiceMessagePipe> unidentifiedPipe,
|
||||
Optional<EventListener> eventListener,
|
||||
ClientZkProfileOperations clientZkProfileOperations,
|
||||
ExecutorService executor)
|
||||
{
|
||||
this(urls, new StaticCredentialsProvider(uuid, e164, password, null), store, signalAgent, isMultiDevice, attachmentsV3, pipe, unidentifiedPipe, eventListener, clientZkProfileOperations, executor);
|
||||
this(urls, new StaticCredentialsProvider(uuid, e164, password, null), store, signalAgent, isMultiDevice, pipe, unidentifiedPipe, eventListener, clientZkProfileOperations, executor);
|
||||
}
|
||||
|
||||
public SignalServiceMessageSender(SignalServiceConfiguration urls,
|
||||
|
@ -159,7 +157,6 @@ public class SignalServiceMessageSender {
|
|||
SignalProtocolStore store,
|
||||
String signalAgent,
|
||||
boolean isMultiDevice,
|
||||
boolean attachmentsV3,
|
||||
Optional<SignalServiceMessagePipe> pipe,
|
||||
Optional<SignalServiceMessagePipe> unidentifiedPipe,
|
||||
Optional<EventListener> eventListener,
|
||||
|
@ -172,7 +169,6 @@ public class SignalServiceMessageSender {
|
|||
this.pipe = new AtomicReference<>(pipe);
|
||||
this.unidentifiedPipe = new AtomicReference<>(unidentifiedPipe);
|
||||
this.isMultiDevice = new AtomicBoolean(isMultiDevice);
|
||||
this.attachmentsV3 = new AtomicBoolean(attachmentsV3);
|
||||
this.eventListener = eventListener;
|
||||
this.executor = executor != null ? executor : Executors.newSingleThreadExecutor();
|
||||
}
|
||||
|
@ -365,11 +361,10 @@ public class SignalServiceMessageSender {
|
|||
socket.cancelInFlightRequests();
|
||||
}
|
||||
|
||||
public void update(SignalServiceMessagePipe pipe, SignalServiceMessagePipe unidentifiedPipe, boolean isMultiDevice, boolean attachmentsV3) {
|
||||
public void update(SignalServiceMessagePipe pipe, SignalServiceMessagePipe unidentifiedPipe, boolean isMultiDevice) {
|
||||
this.pipe.set(Optional.fromNullable(pipe));
|
||||
this.unidentifiedPipe.set(Optional.fromNullable(unidentifiedPipe));
|
||||
this.isMultiDevice.set(isMultiDevice);
|
||||
this.attachmentsV3.set(attachmentsV3);
|
||||
}
|
||||
|
||||
public SignalServiceAttachmentPointer uploadAttachment(SignalServiceAttachmentStream attachment) throws IOException {
|
||||
|
|
Loading…
Add table
Reference in a new issue