IviServiceConnectionManagerImpl
The IVI service connection managers.
An IVI service connection manager manages the connection of a service interface instance identified by the iviInstanceId and serviceId.
<Interface>Api
class instances can observe the connection of type C. As long as connection is observed by an active LifecycleOwner owner, the IVI service host manager will try to establish the connection.
connection is set when the IVI service host manager provide the connection data D. The IVI service host managers provides D when the connection has been established by calling onServiceConnectionAvailable. C is created through IviServiceInterfaceRegistration.connectionFactory of the serviceInterfaceRegistration. C is parameterized by the properties class P and a properties observer interface PO.
The manager keeps a cache of the IVI service interface properties. This cache is updated after a new connection is available and when the IVI service's serviceReady
property is set to true
. The cache is also updated on any following property changes. The caches are live data properties as such clients can observe the property changes.
serviceAvailable is set to true
after the property cache is updated and set to false
when either the connection is lost or when the IVI service's serviceReady
property is set to false
.
On disconnect, the IVI service connection manager is responsible to set the mutableConnection property to null.
Parameters
The <Interface>Connection
interface implementation.
The connection data class for this connection.
The <Interface>Properties
class.
The <Interface>PropertiesObserver
interface.
The <Interface>LiveDataProperties
class.
The IVI instance ID.
The lifecycle owner of this service connection manager.
The interface registration entry of this connection.
Factory for LP.
Invoked when connectionRequested changes.
Invoked when connecting throws an exception.
Types
Properties
The service connection manager that manages the connection for the service interface as specified by the serviceInterfaceRegistration.
Functions
Called when a connection is available.
Called when the connection is unavailable.