1
0
Fork 0

Part 6: Kick-off account manager initialization after visual completeness

In order to hide the time it takes for the account manager to be initialized
(which always involves disk IO, and often network IO), let's kick it off
after "visual completeness".
This makes sure that for most users, by the time they interact with the account
manager-related functionality (e.g. in Settings), it's ready to go.

Also, for signed-in users, this will establish background sync workers.
master
Grisha Kruglov 2020-03-26 23:28:16 -07:00 committed by Grisha Kruglov
parent 057e28d4e4
commit 6c38b77315
1 changed files with 6 additions and 0 deletions

View File

@ -162,6 +162,12 @@ open class FenixApplication : LocaleAwareApplication() {
components.core.passwordsStorage.warmUp()
}
}
// Account manager initialization needs to happen on the main thread.
GlobalScope.launch(Dispatchers.Main) {
logElapsedTime(logger, "Kicking-off account manager") {
components.backgroundServices.accountManager
}
}
}
}