Make sure not more than one libsignal Network instance is ever created

Co-authored-by: Greyson Parrelli <greyson@signal.org>
This commit is contained in:
moiseev-signal
2024-04-01 11:33:10 -07:00
committed by Greyson Parrelli
parent 544cc06f13
commit 78e36b85d4
6 changed files with 35 additions and 7 deletions

View File

@@ -98,7 +98,7 @@ object ContactDiscoveryRefreshV2 {
Optional.empty(),
BuildConfig.CDSI_MRENCLAVE,
10_000,
if (FeatureFlags.useLibsignalNetForCdsiLookup()) BuildConfig.LIBSIGNAL_NET_ENV else null
if (FeatureFlags.useLibsignalNetForCdsiLookup()) ApplicationDependencies.getLibsignalNetwork() else null
) {
Log.i(TAG, "Ignoring token for one-off lookup.")
}
@@ -163,7 +163,7 @@ object ContactDiscoveryRefreshV2 {
Optional.ofNullable(token),
BuildConfig.CDSI_MRENCLAVE,
timeoutMs,
if (FeatureFlags.useLibsignalNetForCdsiLookup()) BuildConfig.LIBSIGNAL_NET_ENV else null
if (FeatureFlags.useLibsignalNetForCdsiLookup()) ApplicationDependencies.getLibsignalNetwork() else null
) { tokenToSave ->
stopwatch.split("network-pre-token")
if (!isPartialRefresh) {