kopia lustrzana https://github.com/ryukoposting/Signal-Android
Feature flag automatic session reset.
rodzic
1e2590af49
commit
a3c7e7e552
|
@ -15,6 +15,7 @@ import org.thoughtcrime.securesms.recipients.Recipient;
|
|||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientUtil;
|
||||
import org.thoughtcrime.securesms.transport.RetryLaterException;
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||
import org.whispersystems.libsignal.util.guava.Optional;
|
||||
import org.whispersystems.signalservice.api.SignalServiceMessageSender;
|
||||
import org.whispersystems.signalservice.api.crypto.UnidentifiedAccessPair;
|
||||
|
@ -82,9 +83,13 @@ public class AutomaticSessionResetJob extends BaseJob {
|
|||
|
||||
@Override
|
||||
protected void onRun() throws Exception {
|
||||
SessionUtil.archiveSession(context, recipientId, deviceId);
|
||||
insertLocalMessage();
|
||||
sendNullMessage();
|
||||
if (FeatureFlags.automaticSessionReset()) {
|
||||
SessionUtil.archiveSession(context, recipientId, deviceId);
|
||||
insertLocalMessage();
|
||||
sendNullMessage();
|
||||
} else {
|
||||
insertLocalMessage();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -67,6 +67,7 @@ public final class FeatureFlags {
|
|||
private static final String SEND_VIEWED_RECEIPTS = "android.sendViewedReceipts";
|
||||
private static final String CUSTOM_VIDEO_MUXER = "android.customVideoMuxer";
|
||||
private static final String CDS_REFRESH_INTERVAL = "cds.syncInterval.seconds";
|
||||
private static final String AUTOMATIC_SESSION_RESET = "android.automaticSessionReset";
|
||||
|
||||
/**
|
||||
* We will only store remote values for flags in this set. If you want a flag to be controllable
|
||||
|
@ -90,7 +91,8 @@ public final class FeatureFlags {
|
|||
SEND_VIEWED_RECEIPTS,
|
||||
CUSTOM_VIDEO_MUXER,
|
||||
CDS_REFRESH_INTERVAL,
|
||||
GROUP_NAME_MAX_LENGTH
|
||||
GROUP_NAME_MAX_LENGTH,
|
||||
AUTOMATIC_SESSION_RESET
|
||||
);
|
||||
|
||||
@VisibleForTesting
|
||||
|
@ -124,7 +126,8 @@ public final class FeatureFlags {
|
|||
GV1_MIGRATION_JOB,
|
||||
CUSTOM_VIDEO_MUXER,
|
||||
CDS_REFRESH_INTERVAL,
|
||||
GROUP_NAME_MAX_LENGTH
|
||||
GROUP_NAME_MAX_LENGTH,
|
||||
AUTOMATIC_SESSION_RESET
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -285,6 +288,11 @@ public final class FeatureFlags {
|
|||
return Math.max(32, getInteger(GROUP_NAME_MAX_LENGTH, -1));
|
||||
}
|
||||
|
||||
/** Whether or not to allow automatic session resets. */
|
||||
public static boolean automaticSessionReset() {
|
||||
return getBoolean(AUTOMATIC_SESSION_RESET, true);
|
||||
}
|
||||
|
||||
/** Only for rendering debug info. */
|
||||
public static synchronized @NonNull Map<String, Object> getMemoryValues() {
|
||||
return new TreeMap<>(REMOTE_VALUES);
|
||||
|
|
Ładowanie…
Reference in New Issue