LithoSaveableStateRegistry
Registry of component state that can be snapshotted into Android saved state.
Android's androidx.savedstate.SavedStateRegistry is owned and accessed by a lifecycle host on the main thread. Litho may resolve components on multiple background threads, so a host restores one Bundle into this registry and registers this registry's snapshot as one Android saved state provider. Components then register value providers without directly accessing the Android registry.
This type is thread-safe. Provider code is evaluated outside the registry lock, while each individual provider is serialized to prevent concurrent saver calls. The owner defines the registry lifetime and must close it when the corresponding tree or navigation entry is permanently removed.
Parameters
a snapshot produced by a previous registry instance and restored through Android's saved-state mechanism, or null for a new state scope.
the host android.content.Context class loader used to deserialize custom values from the restored Bundle. Hosts should pass Context.getClassLoader(); null uses the Bundle's default class loader.
Functions
Creates an independently keyed registry whose snapshot is owned by this registry.