CarSensors

public interface CarSensors

androidx.car.app.hardware.info.CarSensors


Manages access to androidx.car.app.hardware specific sensors such as compass, accelerometer, and gyroscope.

Summary

Constants

int UPDATE_RATE_FASTEST

Car hardware property, sensor, or action should be fetched at its fastest possible rate.

int UPDATE_RATE_NORMAL

Car hardware info, sensor, or action should be fetched at its default rate.

int UPDATE_RATE_UI

Car hardware property, sensor, or action should be fetched at a rate consistent with drawing UI to a screen.

Public methods

abstract void addAccelerometerListener(int rate, Executor executor, OnCarDataAvailableListener<Accelerometer> listener)

Setup an ongoing listener to receive Accelerometer data from the car hardware.

abstract void addCarHardwareLocationListener(int rate, Executor executor, OnCarDataAvailableListener<CarHardwareLocation> listener)

Setup an ongoing listener to receive CarHardwareLocation data from the car hardware.

abstract void addCompassListener(int rate, Executor executor, OnCarDataAvailableListener<Compass> listener)

Setup an ongoing listener to receive Compass data from the car hardware.

abstract void addGyroscopeListener(int rate, Executor executor, OnCarDataAvailableListener<Gyroscope> listener)

Setup an ongoing listener to receive Gyroscope data from the car hardware.

abstract void removeAccelerometerListener(OnCarDataAvailableListener<Accelerometer> listener)

Remove an ongoing listener for Accelerometer information.

abstract void removeCarHardwareLocationListener(OnCarDataAvailableListener<CarHardwareLocation> listener)

Remove an ongoing listener for CarHardwareLocation information.

abstract void removeCompassListener(OnCarDataAvailableListener<Compass> listener)

Remove an on