Inline max envelope size feature flag.
This commit is contained in:
parent
105862b524
commit
7efd8be238
3 changed files with 5 additions and 12 deletions
|
@ -40,6 +40,7 @@ import org.thoughtcrime.securesms.push.SignalServiceNetworkAccess;
|
||||||
import org.thoughtcrime.securesms.recipients.LiveRecipientCache;
|
import org.thoughtcrime.securesms.recipients.LiveRecipientCache;
|
||||||
import org.thoughtcrime.securesms.service.TrimThreadsByDateManager;
|
import org.thoughtcrime.securesms.service.TrimThreadsByDateManager;
|
||||||
import org.thoughtcrime.securesms.util.AlarmSleepTimer;
|
import org.thoughtcrime.securesms.util.AlarmSleepTimer;
|
||||||
|
import org.thoughtcrime.securesms.util.ByteUnit;
|
||||||
import org.thoughtcrime.securesms.util.EarlyMessageCache;
|
import org.thoughtcrime.securesms.util.EarlyMessageCache;
|
||||||
import org.thoughtcrime.securesms.util.FeatureFlags;
|
import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||||
import org.thoughtcrime.securesms.util.FrameRateTracker;
|
import org.thoughtcrime.securesms.util.FrameRateTracker;
|
||||||
|
@ -102,7 +103,7 @@ public class ApplicationDependencyProvider implements ApplicationDependencies.Pr
|
||||||
Optional.of(new SecurityEventListener(context)),
|
Optional.of(new SecurityEventListener(context)),
|
||||||
provideClientZkOperations().getProfileOperations(),
|
provideClientZkOperations().getProfileOperations(),
|
||||||
SignalExecutors.newCachedBoundedExecutor("signal-messages", 1, 16),
|
SignalExecutors.newCachedBoundedExecutor("signal-messages", 1, 16),
|
||||||
FeatureFlags.maxEnvelopeSize());
|
ByteUnit.KILOBYTES.toBytes(512));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -61,7 +61,6 @@ public final class FeatureFlags {
|
||||||
public static final String RESEARCH_MEGAPHONE_1 = "research.megaphone.1";
|
public static final String RESEARCH_MEGAPHONE_1 = "research.megaphone.1";
|
||||||
public static final String DONATE_MEGAPHONE = "android.donate";
|
public static final String DONATE_MEGAPHONE = "android.donate";
|
||||||
private static final String VIEWED_RECEIPTS = "android.viewed.receipts";
|
private static final String VIEWED_RECEIPTS = "android.viewed.receipts";
|
||||||
private static final String MAX_ENVELOPE_SIZE = "android.maxEnvelopeSize";
|
|
||||||
private static final String GROUP_CALLING_VERSION = "android.groupsv2.callingVersion";
|
private static final String GROUP_CALLING_VERSION = "android.groupsv2.callingVersion";
|
||||||
private static final String GV1_AUTO_MIGRATE = "android.groupsV1Migration.auto.2";
|
private static final String GV1_AUTO_MIGRATE = "android.groupsV1Migration.auto.2";
|
||||||
private static final String GV1_MANUAL_MIGRATE = "android.groupsV1Migration.manual";
|
private static final String GV1_MANUAL_MIGRATE = "android.groupsV1Migration.manual";
|
||||||
|
@ -83,7 +82,6 @@ public final class FeatureFlags {
|
||||||
RESEARCH_MEGAPHONE_1,
|
RESEARCH_MEGAPHONE_1,
|
||||||
DONATE_MEGAPHONE,
|
DONATE_MEGAPHONE,
|
||||||
VIEWED_RECEIPTS,
|
VIEWED_RECEIPTS,
|
||||||
MAX_ENVELOPE_SIZE,
|
|
||||||
GV1_AUTO_MIGRATE,
|
GV1_AUTO_MIGRATE,
|
||||||
GV1_MANUAL_MIGRATE,
|
GV1_MANUAL_MIGRATE,
|
||||||
GV1_FORCED_MIGRATE,
|
GV1_FORCED_MIGRATE,
|
||||||
|
@ -110,8 +108,7 @@ public final class FeatureFlags {
|
||||||
private static final Set<String> HOT_SWAPPABLE = SetUtil.newHashSet(
|
private static final Set<String> HOT_SWAPPABLE = SetUtil.newHashSet(
|
||||||
GROUPS_V2_JOIN_VERSION,
|
GROUPS_V2_JOIN_VERSION,
|
||||||
VERIFY_V2,
|
VERIFY_V2,
|
||||||
CLIENT_EXPIRATION,
|
CLIENT_EXPIRATION
|
||||||
MAX_ENVELOPE_SIZE
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -262,11 +259,6 @@ public final class FeatureFlags {
|
||||||
return getBoolean(VIEWED_RECEIPTS, false);
|
return getBoolean(VIEWED_RECEIPTS, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The max size envelope that is allowed to be sent. */
|
|
||||||
public static int maxEnvelopeSize() {
|
|
||||||
return getInteger(MAX_ENVELOPE_SIZE, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Whether or not group calling is enabled. */
|
/** Whether or not group calling is enabled. */
|
||||||
public static boolean groupCalling() {
|
public static boolean groupCalling() {
|
||||||
return getVersionFlag(GROUP_CALLING_VERSION) == VersionFlag.ON;
|
return getVersionFlag(GROUP_CALLING_VERSION) == VersionFlag.ON;
|
||||||
|
|
|
@ -126,7 +126,7 @@ public class SignalServiceMessageSender {
|
||||||
private final AtomicBoolean isMultiDevice;
|
private final AtomicBoolean isMultiDevice;
|
||||||
|
|
||||||
private final ExecutorService executor;
|
private final ExecutorService executor;
|
||||||
private final int maxEnvelopeSize;
|
private final long maxEnvelopeSize;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a SignalServiceMessageSender.
|
* Construct a SignalServiceMessageSender.
|
||||||
|
@ -163,7 +163,7 @@ public class SignalServiceMessageSender {
|
||||||
Optional<EventListener> eventListener,
|
Optional<EventListener> eventListener,
|
||||||
ClientZkProfileOperations clientZkProfileOperations,
|
ClientZkProfileOperations clientZkProfileOperations,
|
||||||
ExecutorService executor,
|
ExecutorService executor,
|
||||||
int maxEnvelopeSize)
|
long maxEnvelopeSize)
|
||||||
{
|
{
|
||||||
this.socket = new PushServiceSocket(urls, credentialsProvider, signalAgent, clientZkProfileOperations);
|
this.socket = new PushServiceSocket(urls, credentialsProvider, signalAgent, clientZkProfileOperations);
|
||||||
this.store = store;
|
this.store = store;
|
||||||
|
|
Loading…
Add table
Reference in a new issue