Fix ComposeInitializerImpl
Bug: 230740991 Test: Builds Change-Id: Ifb5958a3cc1bb50a0fcb562ed4f8e8030a741cd2
This commit is contained in:
@@ -49,14 +49,12 @@ internal object ComposeInitializerImpl : ComposeInitializer {
|
||||
// initializer are created once, when the process is started.
|
||||
val savedStateRegistryOwner =
|
||||
object : SavedStateRegistryOwner {
|
||||
private val savedStateRegistry =
|
||||
private val savedStateRegistryController =
|
||||
SavedStateRegistryController.create(this).apply { performRestore(null) }
|
||||
|
||||
override fun getLifecycle(): Lifecycle = lifecycleOwner.lifecycle
|
||||
override val savedStateRegistry = savedStateRegistryController.savedStateRegistry
|
||||
|
||||
override fun getSavedStateRegistry(): SavedStateRegistry {
|
||||
return savedStateRegistry.savedStateRegistry
|
||||
}
|
||||
override fun getLifecycle(): Lifecycle = lifecycleOwner.lifecycle
|
||||
}
|
||||
|
||||
// We must call [ViewLifecycleOwner.onCreate] after creating the [SavedStateRegistryOwner]
|
||||
|
||||
Reference in New Issue
Block a user