Refactor FeatureFlags.

This commit is contained in:
Greyson Parrelli
2024-06-12 13:57:07 -04:00
parent 39cb1c638e
commit 13f7a64139
76 changed files with 1059 additions and 1053 deletions

View File

@@ -98,7 +98,7 @@ object ContactDiscoveryRefreshV2 {
Optional.empty(),
BuildConfig.CDSI_MRENCLAVE,
10_000,
if (FeatureFlags.useLibsignalNetForCdsiLookup()) AppDependencies.libsignalNetwork else null
if (FeatureFlags.useLibsignalNetForCdsiLookup) AppDependencies.libsignalNetwork else null
) {
Log.i(TAG, "Ignoring token for one-off lookup.")
}
@@ -145,8 +145,8 @@ object ContactDiscoveryRefreshV2 {
return ContactDiscovery.RefreshResult(emptySet(), emptyMap())
}
if (newE164s.size > FeatureFlags.cdsHardLimit()) {
Log.w(TAG, "[$tag] Number of new contacts (${newE164s.size.roundedString()} > hard limit (${FeatureFlags.cdsHardLimit()}! Failing and marking ourselves as permanently blocked.")
if (newE164s.size > FeatureFlags.cdsHardLimit) {
Log.w(TAG, "[$tag] Number of new contacts (${newE164s.size.roundedString()} > hard limit (${FeatureFlags.cdsHardLimit}! Failing and marking ourselves as permanently blocked.")
SignalStore.misc().markCdsPermanentlyBlocked()
throw IOException("New contacts over the CDS hard limit!")
}
@@ -163,7 +163,7 @@ object ContactDiscoveryRefreshV2 {
Optional.ofNullable(token),
BuildConfig.CDSI_MRENCLAVE,
timeoutMs,
if (FeatureFlags.useLibsignalNetForCdsiLookup()) AppDependencies.libsignalNetwork else null
if (FeatureFlags.useLibsignalNetForCdsiLookup) AppDependencies.libsignalNetwork else null
) { tokenToSave ->
stopwatch.split("network-pre-token")
if (!isPartialRefresh) {