SystemUiHostExtensionContext

data class SystemUiHostExtensionContext(val systemUiHost: SystemUiHost, val coreViewModel: CoreSystemUiViewModel, val lifecycleOwner: LifecycleOwner, val viewLifecycleOwner: LifecycleOwner, val viewModelStoreOwner: ViewModelStoreOwner, val iviInstanceId: IviInstanceId, val iviServiceProvider: IviInstanceBoundIviServiceProvider, val staticConfigurationProvider: StaticConfigurationProvider, val registerOnBackPressedConsumersCallback: (List<OnBackPressedConsumer>) -> Unit)

Information about the environment that a SystemUiHostExtension runs in.

Parameters

systemUiHost

The SystemUiHost instance.

coreViewModel

The view model for the state of the system UI's core functionality.

lifecycleOwner

The lifecycle to which the system UI is bound. It is not stopped or destroyed when a theme change triggers view recreation, so don't provide this LifecycleOwner to views that are recreated at that time. Use viewLifecycleOwner instead.

viewLifecycleOwner

The lifecycle to which the system UI's view is bound. This lifecycle remains in the Lifecycle.State.CREATED state until theming is applied.

viewModelStoreOwner

Used for managing the system UI's view model(s).

iviInstanceId

The ID for the IVI instance that this system UI instance operates in.

iviServiceProvider

The IviServiceProvider that is bound to the IviInstanceId associated to the SystemUiHost. The IviServiceProvider can provide IVI service API instances that are bound the IviInstanceId, and global IVI service API instances.

staticConfigurationProvider

Allows retrieving the values of static configurations.

registerOnBackPressedConsumersCallback

Callback to register a collection of components represented in the system UI, capable of handling back presses. Back presses are offered to the registered consumers in the same order that they were registered. Once a consumer consumes a back press, consumers that were registered after it will not get a callback. The registered consumers are bound to the current system UI view's lifecycle.

Constructors

Link copied to clipboard
fun SystemUiHostExtensionContext(systemUiHost: SystemUiHost, coreViewModel: CoreSystemUiViewModel, lifecycleOwner: LifecycleOwner, viewLifecycleOwner: LifecycleOwner, viewModelStoreOwner: ViewModelStoreOwner, iviInstanceId: IviInstanceId, iviServiceProvider: IviInstanceBoundIviServiceProvider, staticConfigurationProvider: StaticConfigurationProvider, registerOnBackPressedConsumersCallback: (List<OnBackPressedConsumer>) -> Unit)

Properties