@@ -2,6 +2,7 @@ package com.fsck.k9
2
2
3
3
import androidx.annotation.GuardedBy
4
4
import androidx.annotation.RestrictTo
5
+ import app.k9mail.core.featureflag.FeatureFlagProvider
5
6
import app.k9mail.legacy.account.Account
6
7
import app.k9mail.legacy.account.AccountManager
7
8
import app.k9mail.legacy.account.AccountRemovedListener
@@ -27,11 +28,13 @@ import kotlinx.coroutines.flow.callbackFlow
27
28
import kotlinx.coroutines.flow.flowOn
28
29
import timber.log.Timber
29
30
31
+ @Suppress(" MaxLineLength" )
30
32
class Preferences internal constructor(
31
33
private val storagePersister : StoragePersister ,
32
34
private val localStoreProvider : LocalStoreProvider ,
33
35
private val accountPreferenceSerializer : AccountPreferenceSerializer ,
34
36
private val backgroundDispatcher : CoroutineDispatcher = Dispatchers .IO ,
37
+ private val featureFlagProvider : FeatureFlagProvider ,
35
38
) : AccountManager {
36
39
private val accountLock = Any ()
37
40
private val storageLock = Any ()
@@ -82,7 +85,11 @@ class Preferences internal constructor(
82
85
if (! accountUuids.isNullOrEmpty()) {
83
86
accountUuids.split(" ," ).forEach { uuid ->
84
87
val existingAccount = accountsMap?.get(uuid)
85
- val account = existingAccount ? : Account (uuid, K9 ::isSensitiveDebugLoggingEnabled)
88
+ val account = existingAccount ? : Account (
89
+ uuid,
90
+ K9 ::isSensitiveDebugLoggingEnabled,
91
+ featureFlagProvider,
92
+ )
86
93
accountPreferenceSerializer.loadAccount(account, storage)
87
94
88
95
accounts[uuid] = account
@@ -176,7 +183,7 @@ class Preferences internal constructor(
176
183
}
177
184
178
185
fun newAccount (accountUuid : String ): Account {
179
- val account = Account (accountUuid, K9 ::isSensitiveDebugLoggingEnabled)
186
+ val account = Account (accountUuid, K9 ::isSensitiveDebugLoggingEnabled, featureFlagProvider )
180
187
accountPreferenceSerializer.loadDefaults(account)
181
188
182
189
synchronized(accountLock) {
0 commit comments