[fenix] 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.
pull/600/head
Grisha Kruglov 5 years ago committed by Grisha Kruglov
parent 1a25bc758e
commit 423d7cfdda

@ -162,6 +162,12 @@ open class FenixApplication : LocaleAwareApplication() {
components.core.passwordsStorage.warmUp() 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
}
}
} }
} }

Loading…
Cancel
Save