CarInfo

public interface CarInfo

androidx.car.app.hardware.info.CarInfo


Manages access to car hardware specific info such as model, energy, and speed info.

Summary

Public methods

abstract void addEnergyLevelListener(Executor executor, OnCarDataAvailableListener<EnergyLevel> listener)

Setup an ongoing listener to receive EnergyLevel information from the car hardware.

abstract void addMileageListener(Executor executor, OnCarDataAvailableListener<Mileage> listener)

Setup an ongoing listener to receive Mileage information from the car hardware.

abstract void addSpeedListener(Executor executor, OnCarDataAvailableListener<Speed> listener)

Setup an ongoing listener to receive Speed information from the car hardware.

abstract void addTollListener(Executor executor, OnCarDataAvailableListener<TollCard> listener)

Setup an ongoing listener to receive TollCard information from the car hardware.

abstract void fetchEnergyProfile(Executor executor, OnCarDataAvailableListener<EnergyProfile> listener)

Reguest the EnergyProfile information about the car hardware.

abstract void fetchModel(Executor executor, OnCarDataAvailableListener<Model> listener)

Fetch the Model information about the car hardware.

abstract void removeEnergyLevelListener(OnCarDataAvailableListener<EnergyLevel> listener)

Remove an ongoing listener for EnergyLevel information.

abstract void removeMileageListener(OnCarDataAvailableListener<Mileage> listener)

Remove an ongoing listener for Mileage information.

abstract void removeSpeedListener(OnCarDataAvailableListener<Speed> listener)

Remove an ongoing listener for Speed information.

abstract void removeTollListener(OnCarDataAvailableListener<TollCard> listener)

Remove an ongoing listener for TollCard information.

Public methods

addEnergyLevelListener

public abstract void addEnergyLevelListener (Executor executor, 
                OnCarDataAvailableListener<EnergyLevel> listener)

Setup an ongoing listener to receive EnergyLevel information from the car hardware.

If the listener was added previously then it won't be added.

Parameters
executor Executor: the executor which will be used for invoking the listener

listener OnCarDataAvailableListener: the listener that will be invoked when data is available

addMileageListener

public abstract void addMileageListener (Executor executor, 
                OnCarDataAvailableListener<Mileage> listener)

Setup an ongoing listener to receive Mileage information from the car hardware.

If the listener was added previously then it won't be added.

Parameters
executor Executor: the executor which will be used for invoking the listener

listener OnCarDataAvailableListener: the listener that will be invoked when data is available

addSpeedListener

public abstract void addSpeedListener (Executor executor, 
                OnCarDataAvailableListener<Speed> listener)

Setup an ongoing listener to receive Speed information from the car hardware.

If the listener was added previously then it won't be added.

Parameters
executor Executor: the executor which will be used for invoking the listener

listener OnCarDataAvailableListener: the listener that will be invoked when data is available

addTollListener

public abstract void addTollListener (Executor executor, 
                OnCarDataAvailableListener<TollCard> listener)

Setup an ongoing listener to receive TollCard information from the car hardware.

If the listener was added previously then it won't be added again.

Parameters
executor Executor: the executor which will be used for invoking the listener

listener OnCarDataAvailableListener: the listener that will be invoked when data is available

fetchEnergyProfile

public abstract void fetchEnergyProfile (Executor executor, 
                OnCarDataAvailableListener<EnergyProfile> listener)

Reguest the EnergyProfile information about the car hardware.

Parameters
executor Executor: the executor which will be used for invoking the listener

listener OnCarDataAvailableListener: the listener that will be invoked when data is available

fetchModel

public abstract void fetchModel (Executor executor, 
                OnCarDataAvailableListener<Model> listener)

Fetch the Model information about the car hardware.

Parameters
executor Executor: the executor which will be used for invoking the listener

listener OnCarDataAvailableListener: the listener that will be invoked when data is available

removeEnergyLevelListener

public abstract void removeEnergyLevelListener (OnCarDataAvailableListener<EnergyLevel> listener)

Remove an ongoing listener for EnergyLevel information.

If the listener is not currently added, then nothing will be removed.

Parameters
listener OnCarDataAvailableListener: the listener to remove

removeMileageListener

public abstract void removeMileageListener (OnCarDataAvailableListener<Mileage> listener)

Remove an ongoing listener for Mileage information.

If the listener is not currently added, then nothing will be removed.

Parameters
listener OnCarDataAvailableListener: the listener to remove

removeSpeedListener

public abstract void removeSpeedListener (OnCarDataAvailableListener<Speed> listener)

Remove an ongoing listener for Speed information.

If the listener is not currently added, then nothing will be removed.

Parameters
listener OnCarDataAvailableListener: the listener to remove

removeTollListener

public abstract void removeTollListener (OnCarDataAvailableListener<TollCard> listener)

Remove an ongoing listener for TollCard information.

If the listener is not currently added, then nothing will be removed.

Parameters
listener OnCarDataAvailableListener: the listener to remove