Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28a6ebbc authored by Jordan Demeulenaere's avatar Jordan Demeulenaere
Browse files

Fix ComposeInitializerImpl

Bug: 230740991
Test: Builds
Change-Id: Ifb5958a3cc1bb50a0fcb562ed4f8e8030a741cd2
parent 0897de80
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -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]