@@ -3,6 +3,7 @@ package com.fsck.k9
3
3
import androidx.annotation.GuardedBy
4
4
import androidx.annotation.RestrictTo
5
5
import app.k9mail.legacy.account.Account
6
+ import app.k9mail.legacy.account.AccountDefaultsProvider
6
7
import app.k9mail.legacy.account.AccountManager
7
8
import app.k9mail.legacy.account.AccountRemovedListener
8
9
import app.k9mail.legacy.account.AccountsChangeListener
@@ -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 accountDefaultsProvider : AccountDefaultsProvider ,
35
38
) : AccountManager {
36
39
private val accountLock = Any ()
37
40
private val storageLock = Any ()
@@ -87,6 +90,7 @@ class Preferences internal constructor(
87
90
88
91
accounts[uuid] = account
89
92
accountsInOrder.add(account)
93
+ accountDefaultsProvider.applyDefaults(account)
90
94
}
91
95
}
92
96
0 commit comments