# CarSensorManager

Summary:[Nested Classes](https://developer.android.com/reference/android/car/hardware/CarSensorManager#nestedclasses)\|[Constants](https://developer.android.com/reference/android/car/hardware/CarSensorManager#constants)\|[Methods](https://developer.android.com/reference/android/car/hardware/CarSensorManager#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/car/hardware/CarSensorManager#inhmethods)  

# CarSensorManager

`
public

final

class
CarSensorManager
`  
`

extends Object


``


`

|---|---------------------------------------|
| java.lang.Object                         ||
| ↳ | android.car.hardware.CarSensorManager |

<br />

*** ** * ** ***

<br />

**This class is deprecated.**   
Use[CarPropertyManager](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager)instead. API for monitoring car sensor data.

## Summary

|                                                                                          ### Nested classes                                                                                          ||
|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` interface` | [CarSensorManager.OnSensorChangedListener](https://developer.android.com/reference/android/car/hardware/CarSensorManager.OnSensorChangedListener) Listener for car sensor data change. |

|                                                                                                     ### Constants                                                                                                      ||
|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [SENSOR_RATE_FAST](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_RATE_FAST) <br />                                                                                       |
| `int` | [SENSOR_RATE_FASTEST](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_RATE_FASTEST) Read sensor at the maximum rate.                                                       |
| `int` | [SENSOR_RATE_NORMAL](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_RATE_NORMAL) Read sensor in default normal rate set for each sensors.                                 |
| `int` | [SENSOR_RATE_ONCHANGE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_RATE_ONCHANGE) Read on_change type sensors                                                          |
| `int` | [SENSOR_RATE_UI](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_RATE_UI) <br />                                                                                           |
| `int` | [SENSOR_TYPE_ABS_ACTIVE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_ABS_ACTIVE) Set to true when ABS is active.                                                  |
| `int` | [SENSOR_TYPE_CAR_SPEED](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_CAR_SPEED) This sensor represents vehicle speed in m/s.                                       |
| `int` | [SENSOR_TYPE_ENGINE_OIL_LEVEL](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_ENGINE_OIL_LEVEL) Oil level sensor.                                                    |
| `int` | [SENSOR_TYPE_ENV_OUTSIDE_TEMPERATURE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_ENV_OUTSIDE_TEMPERATURE) Outside Environment like temperature.                  |
| `int` | [SENSOR_TYPE_EV_BATTERY_CHARGE_RATE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_EV_BATTERY_CHARGE_RATE) Indicates the instantaneous battery charging rate in mW. |
| `int` | [SENSOR_TYPE_EV_BATTERY_LEVEL](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_EV_BATTERY_LEVEL) Indicates battery level of the car.                                  |
| `int` | [SENSOR_TYPE_EV_CHARGE_PORT_CONNECTED](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_EV_CHARGE_PORT_CONNECTED) Set to true if EV charging port is connected.        |
| `int` | [SENSOR_TYPE_EV_CHARGE_PORT_OPEN](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_EV_CHARGE_PORT_OPEN) Set to true if EV charging port is open.                       |
| `int` | [SENSOR_TYPE_FUEL_DOOR_OPEN](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_FUEL_DOOR_OPEN) Set to true if the fuel door is open.                                    |
| `int` | [SENSOR_TYPE_FUEL_LEVEL](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_FUEL_LEVEL) Indicates fuel level of the car.                                                 |
| `int` | [SENSOR_TYPE_GEAR](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_GEAR) This represents the current position of transmission gear.                                   |
| `int` | [SENSOR_TYPE_IGNITION_STATE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_IGNITION_STATE) Represents ignition state.                                               |
| `int` | [SENSOR_TYPE_NIGHT](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_NIGHT) Day/night sensor.                                                                          |
| `int` | [SENSOR_TYPE_ODOMETER](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_ODOMETER) Total travel distance of the car in Kilometer.                                       |
| `int` | [SENSOR_TYPE_PARKING_BRAKE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_PARKING_BRAKE) Represents the current status of parking brake.                            |
| `int` | [SENSOR_TYPE_RPM](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_RPM) Represents engine RPM of the car.                                                              |
| `int` | [SENSOR_TYPE_TRACTION_CONTROL_ACTIVE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_TRACTION_CONTROL_ACTIVE) Set to true when traction control is active.           |
| `int` | [SENSOR_TYPE_WHEEL_TICK_DISTANCE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_WHEEL_TICK_DISTANCE) Represents wheel distance in millimeters.                      |

|                                                                                                                                                                                                                                                                                                                                    ### Public methods                                                                                                                                                                                                                                                                                                                                    ||
|-------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[CarSensorEvent](https://developer.android.com/reference/android/car/hardware/CarSensorEvent)                  | ` `[getLatestSensorEvent](https://developer.android.com/reference/android/car/hardware/CarSensorManager#getLatestSensorEvent(int))`(int type) ` Get the most recent CarSensorEvent for the given type.                                                                                                                                                                                                                                                                                                                                                                |
| ` List<`[CarPropertyConfig](https://developer.android.com/reference/android/car/hardware/CarPropertyConfig)`<T>>` | ` `[getPropertyList](https://developer.android.com/reference/android/car/hardware/CarSensorManager#getPropertyList())`() ` Get list of properties represented by CarSensorManager for this car.                                                                                                                                                                                                                                                                                                                                                                       |
| ` int[]`                                                                                                          | ` `[getSupportedSensors](https://developer.android.com/reference/android/car/hardware/CarSensorManager#getSupportedSensors())`() ` Give the list of CarSensors available in the connected car.                                                                                                                                                                                                                                                                                                                                                                        |
| ` boolean`                                                                                                        | ` `[isSensorSupported](https://developer.android.com/reference/android/car/hardware/CarSensorManager#isSensorSupported(int))`(int sensorType) ` Tells if given sensor is supported or not.                                                                                                                                                                                                                                                                                                                                                                            |
| ` boolean`                                                                                                        | ` `[registerListener](https://developer.android.com/reference/android/car/hardware/CarSensorManager#registerListener(android.car.hardware.CarSensorManager.OnSensorChangedListener,%20int,%20int))`(`[CarSensorManager.OnSensorChangedListener](https://developer.android.com/reference/android/car/hardware/CarSensorManager.OnSensorChangedListener)` listener, int sensorType, int rate) ` Register[OnSensorChangedListener](https://developer.android.com/reference/android/car/hardware/CarSensorManager.OnSensorChangedListener)to get repeated sensor updates. |
| ` void`                                                                                                           | ` `[unregisterListener](https://developer.android.com/reference/android/car/hardware/CarSensorManager#unregisterListener(android.car.hardware.CarSensorManager.OnSensorChangedListener,%20int))`(`[CarSensorManager.OnSensorChangedListener](https://developer.android.com/reference/android/car/hardware/CarSensorManager.OnSensorChangedListener)` listener, int sensorType) ` Stop getting sensor update for the given listener and sensor.                                                                                                                        |
| ` void`                                                                                                           | ` `[unregisterListener](https://developer.android.com/reference/android/car/hardware/CarSensorManager#unregisterListener(android.car.hardware.CarSensorManager.OnSensorChangedListener))`(`[CarSensorManager.OnSensorChangedListener](https://developer.android.com/reference/android/car/hardware/CarSensorManager.OnSensorChangedListener)` listener) ` Stop getting sensor update for the given listener.                                                                                                                                                          |

| ### Inherited methods |
|-----------------------|---|
| From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Constants

### SENSOR_RATE_FAST

```
public static final int SENSOR_RATE_FAST
```

<br />

<br />

Constant Value: 10 (0x0000000a)  

### SENSOR_RATE_FASTEST

```
public static final int SENSOR_RATE_FASTEST
```

Read sensor at the maximum rate. Actual rate will be different depending on the sensor.

<br />

Constant Value: 100 (0x00000064)  

### SENSOR_RATE_NORMAL

```
public static final int SENSOR_RATE_NORMAL
```

Read sensor in default normal rate set for each sensors. This is default rate.

<br />

Constant Value: 1 (0x00000001)  

### SENSOR_RATE_ONCHANGE

```
public static final int SENSOR_RATE_ONCHANGE
```

Read on_change type sensors

<br />

Constant Value: 0 (0x00000000)  

### SENSOR_RATE_UI

```
public static final int SENSOR_RATE_UI
```

<br />

<br />

Constant Value: 5 (0x00000005)  

### SENSOR_TYPE_ABS_ACTIVE

```
public static final int SENSOR_TYPE_ABS_ACTIVE
```

Set to true when ABS is active. This sensor is event driven.

<br />

Constant Value: 287310858 (0x1120040a)  

### SENSOR_TYPE_CAR_SPEED

```
public static final int SENSOR_TYPE_CAR_SPEED
```

This sensor represents vehicle speed in m/s.

Sensor data in[CarSensorEvent](https://developer.android.com/reference/android/car/hardware/CarSensorEvent)is a float. When the vehicle is moving forward, SENSOR_TYPE_CAR_SPEED is positive and negative when the vehicle is moving backward. Also, this value is independent of SENSOR_TYPE_GEAR. For example, if SENSOR_TYPE_GEAR is[CarSensorEvent.GEAR_NEUTRAL](https://developer.android.com/reference/android/car/hardware/CarSensorEvent#GEAR_NEUTRAL), SENSOR_TYPE_CAR_SPEED is positive when the vehicle is moving forward, negative when moving backward, and zero when not moving.

<br />

Constant Value: 291504647 (0x11600207)  

### SENSOR_TYPE_ENGINE_OIL_LEVEL

```
public static final int SENSOR_TYPE_ENGINE_OIL_LEVEL
```

Oil level sensor.

<br />

Constant Value: 289407747 (0x11400303)  

### SENSOR_TYPE_ENV_OUTSIDE_TEMPERATURE

```
public static final int SENSOR_TYPE_ENV_OUTSIDE_TEMPERATURE
```

Outside Environment like temperature. This requires[Car.PERMISSION_EXTERIOR_ENVIRONMENT](https://developer.android.com/reference/android/car/Car#PERMISSION_EXTERIOR_ENVIRONMENT)permission.

<br />

Constant Value: 291505923 (0x11600703)  

### SENSOR_TYPE_EV_BATTERY_CHARGE_RATE

```
public static final int SENSOR_TYPE_EV_BATTERY_CHARGE_RATE
```

Indicates the instantaneous battery charging rate in mW. This requires[Car.PERMISSION_ENERGY](https://developer.android.com/reference/android/car/Car#PERMISSION_ENERGY)permission.

<br />

Constant Value: 291504908 (0x1160030c)  

### SENSOR_TYPE_EV_BATTERY_LEVEL

```
public static final int SENSOR_TYPE_EV_BATTERY_LEVEL
```

Indicates battery level of the car. In[CarSensorEvent](https://developer.android.com/reference/android/car/hardware/CarSensorEvent), represents battery level in WH. floatValues of INDEX_EV_BATTERY_CAPACITY_ACTUAL property represents the actual battery capacity in WH. The battery degrades over time, so this value is expected to drop slowly over the life of the vehicle. This requires[Car.PERMISSION_ENERGY](https://developer.android.com/reference/android/car/Car#PERMISSION_ENERGY)permission.

<br />

Constant Value: 291504905 (0x11600309)  

### SENSOR_TYPE_EV_CHARGE_PORT_CONNECTED

```
public static final int SENSOR_TYPE_EV_CHARGE_PORT_CONNECTED
```

Set to true if EV charging port is connected. This requires[Car.PERMISSION_ENERGY_PORTS](https://developer.android.com/reference/android/car/Car#PERMISSION_ENERGY_PORTS)permission.

<br />

Constant Value: 287310603 (0x1120030b)  

### SENSOR_TYPE_EV_CHARGE_PORT_OPEN

```
public static final int SENSOR_TYPE_EV_CHARGE_PORT_OPEN
```

Set to true if EV charging port is open. This requires[Car.PERMISSION_ENERGY_PORTS](https://developer.android.com/reference/android/car/Car#PERMISSION_ENERGY_PORTS)permission.

<br />

Constant Value: 287310602 (0x1120030a)  

### SENSOR_TYPE_FUEL_DOOR_OPEN

```
public static final int SENSOR_TYPE_FUEL_DOOR_OPEN
```

Set to true if the fuel door is open. This requires[Car.PERMISSION_ENERGY_PORTS](https://developer.android.com/reference/android/car/Car#PERMISSION_ENERGY_PORTS)permission.

<br />

Constant Value: 287310600 (0x11200308)  

### SENSOR_TYPE_FUEL_LEVEL

```
public static final int SENSOR_TYPE_FUEL_LEVEL
```

Indicates fuel level of the car. In[CarSensorEvent](https://developer.android.com/reference/android/car/hardware/CarSensorEvent), represents fuel level in milliliters. This requires[Car.PERMISSION_ENERGY](https://developer.android.com/reference/android/car/Car#PERMISSION_ENERGY)permission.

<br />

Constant Value: 291504903 (0x11600307)  

### SENSOR_TYPE_GEAR

```
public static final int SENSOR_TYPE_GEAR
```

This represents the current position of transmission gear. Sensor data in[CarSensorEvent](https://developer.android.com/reference/android/car/hardware/CarSensorEvent)is an intValues\[0\]. For the meaning of the value, check[CarSensorEvent.GEAR_NEUTRAL](https://developer.android.com/reference/android/car/hardware/CarSensorEvent#GEAR_NEUTRAL)and other GEAR_\*. This requires[Car.PERMISSION_POWERTRAIN](https://developer.android.com/reference/android/car/Car#PERMISSION_POWERTRAIN)permission.

<br />

Constant Value: 289408000 (0x11400400)  

### SENSOR_TYPE_IGNITION_STATE

```
public static final int SENSOR_TYPE_IGNITION_STATE
```

Represents ignition state. The value should be one of the constants that starts with IGNITION_STATE_\* in[CarSensorEvent](https://developer.android.com/reference/android/car/hardware/CarSensorEvent). This requires[Car.PERMISSION_POWERTRAIN](https://developer.android.com/reference/android/car/Car#PERMISSION_POWERTRAIN)permission.

<br />

Constant Value: 289408009 (0x11400409)  

### SENSOR_TYPE_NIGHT

```
public static final int SENSOR_TYPE_NIGHT
```

Day/night sensor. Sensor data is intValues\[0\]. This requires[Car.PERMISSION_EXTERIOR_ENVIRONMENT](https://developer.android.com/reference/android/car/Car#PERMISSION_EXTERIOR_ENVIRONMENT)permission.

<br />

Constant Value: 287310855 (0x11200407)  

### SENSOR_TYPE_ODOMETER

```
public static final int SENSOR_TYPE_ODOMETER
```

Total travel distance of the car in Kilometer. Sensor data is a float.

<br />

Constant Value: 291504644 (0x11600204)  

### SENSOR_TYPE_PARKING_BRAKE

```
public static final int SENSOR_TYPE_PARKING_BRAKE
```

Represents the current status of parking brake. Sensor data in[CarSensorEvent](https://developer.android.com/reference/android/car/hardware/CarSensorEvent)is an intValues\[0\]. Value of 1 represents parking brake applied while 0 means the other way around. For this sensor, rate in[registerListener(android.car.hardware.CarSensorManager.OnSensorChangedListener, int, int)](https://developer.android.com/reference/android/car/hardware/CarSensorManager#registerListener(android.car.hardware.CarSensorManager.OnSensorChangedListener,%20int,%20int))will be ignored and all changes will be notified. This requires[Car.PERMISSION_POWERTRAIN](https://developer.android.com/reference/android/car/Car#PERMISSION_POWERTRAIN)permission.

<br />

Constant Value: 287310850 (0x11200402)  

### SENSOR_TYPE_RPM

```
public static final int SENSOR_TYPE_RPM
```

Represents engine RPM of the car. Sensor data in[CarSensorEvent](https://developer.android.com/reference/android/car/hardware/CarSensorEvent)is a float.

<br />

Constant Value: 291504901 (0x11600305)  

### SENSOR_TYPE_TRACTION_CONTROL_ACTIVE

```
public static final int SENSOR_TYPE_TRACTION_CONTROL_ACTIVE
```

Set to true when traction control is active. This sensor is event driven.

<br />

Constant Value: 287310859 (0x1120040b)  

### SENSOR_TYPE_WHEEL_TICK_DISTANCE

```
public static final int SENSOR_TYPE_WHEEL_TICK_DISTANCE
```

Represents wheel distance in millimeters. Some cars may not have individual sensors on each wheel. If a value is not available, Long.MAX_VALUE will be reported. The wheel distance accumulates over time. It increments on forward movement, and decrements on reverse. Wheel distance shall be reset to zero each time a vehicle is started by the user. This requires[Car.PERMISSION_SPEED](https://developer.android.com/reference/android/car/Car#PERMISSION_SPEED)permission.

<br />

Constant Value: 290521862 (0x11510306)

## Public methods

### getLatestSensorEvent

```
public CarSensorEvent getLatestSensorEvent (int type)
```

Get the most recent CarSensorEvent for the given type. Note that latest sensor data from car will not be available if it was never subscribed before. This call will return immediately with null if there is no data available.

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     ||
|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type` | `int`: A sensor to request Value is[SENSOR_TYPE_CAR_SPEED](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_CAR_SPEED),[SENSOR_TYPE_RPM](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_RPM),[SENSOR_TYPE_ODOMETER](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_ODOMETER),[SENSOR_TYPE_FUEL_LEVEL](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_FUEL_LEVEL),[SENSOR_TYPE_PARKING_BRAKE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_PARKING_BRAKE),[SENSOR_TYPE_GEAR](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_GEAR),[SENSOR_TYPE_NIGHT](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_NIGHT),[SENSOR_TYPE_ENV_OUTSIDE_TEMPERATURE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_ENV_OUTSIDE_TEMPERATURE),[SENSOR_TYPE_IGNITION_STATE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_IGNITION_STATE),[SENSOR_TYPE_WHEEL_TICK_DISTANCE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_WHEEL_TICK_DISTANCE),[SENSOR_TYPE_ABS_ACTIVE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_ABS_ACTIVE),[SENSOR_TYPE_TRACTION_CONTROL_ACTIVE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_TRACTION_CONTROL_ACTIVE),[SENSOR_TYPE_FUEL_DOOR_OPEN](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_FUEL_DOOR_OPEN),[SENSOR_TYPE_EV_BATTERY_LEVEL](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_EV_BATTERY_LEVEL),[SENSOR_TYPE_EV_CHARGE_PORT_OPEN](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_EV_CHARGE_PORT_OPEN),[SENSOR_TYPE_EV_CHARGE_PORT_CONNECTED](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_EV_CHARGE_PORT_CONNECTED),[SENSOR_TYPE_EV_BATTERY_CHARGE_RATE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_EV_BATTERY_CHARGE_RATE), or[SENSOR_TYPE_ENGINE_OIL_LEVEL](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_ENGINE_OIL_LEVEL) <br /> |

|                                                                               Returns                                                                                ||
|-----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|
| [CarSensorEvent](https://developer.android.com/reference/android/car/hardware/CarSensorEvent) | null if there was no sensor update since connected to the car. <br /> |

### getPropertyList

```
public List<CarPropertyConfig<T>> getPropertyList ()
```

Get list of properties represented by CarSensorManager for this car.

<br />

|                                                                                           Returns                                                                                            ||
|------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------|
| `List<`[CarPropertyConfig](https://developer.android.com/reference/android/car/hardware/CarPropertyConfig)`<T>>` | List of CarPropertyConfig objects available via Car Sensor Manager. <br /> |

### getSupportedSensors

```
public int[] getSupportedSensors ()
```

Give the list of CarSensors available in the connected car.

<br />

|                                            Returns                                            ||
|---------|--------------------------------------------------------------------------------------|
| `int[]` | array of all sensor types supported. Sensor types is the same as property id. <br /> |

### isSensorSupported

```
public boolean isSensorSupported (int sensorType)
```

Tells if given sensor is supported or not.

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ||
|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `sensorType` | `int`: Value is[SENSOR_TYPE_CAR_SPEED](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_CAR_SPEED),[SENSOR_TYPE_RPM](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_RPM),[SENSOR_TYPE_ODOMETER](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_ODOMETER),[SENSOR_TYPE_FUEL_LEVEL](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_FUEL_LEVEL),[SENSOR_TYPE_PARKING_BRAKE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_PARKING_BRAKE),[SENSOR_TYPE_GEAR](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_GEAR),[SENSOR_TYPE_NIGHT](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_NIGHT),[SENSOR_TYPE_ENV_OUTSIDE_TEMPERATURE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_ENV_OUTSIDE_TEMPERATURE),[SENSOR_TYPE_IGNITION_STATE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_IGNITION_STATE),[SENSOR_TYPE_WHEEL_TICK_DISTANCE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_WHEEL_TICK_DISTANCE),[SENSOR_TYPE_ABS_ACTIVE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_ABS_ACTIVE),[SENSOR_TYPE_TRACTION_CONTROL_ACTIVE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_TRACTION_CONTROL_ACTIVE),[SENSOR_TYPE_FUEL_DOOR_OPEN](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_FUEL_DOOR_OPEN),[SENSOR_TYPE_EV_BATTERY_LEVEL](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_EV_BATTERY_LEVEL),[SENSOR_TYPE_EV_CHARGE_PORT_OPEN](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_EV_CHARGE_PORT_OPEN),[SENSOR_TYPE_EV_CHARGE_PORT_CONNECTED](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_EV_CHARGE_PORT_CONNECTED),[SENSOR_TYPE_EV_BATTERY_CHARGE_RATE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_EV_BATTERY_CHARGE_RATE), or[SENSOR_TYPE_ENGINE_OIL_LEVEL](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_ENGINE_OIL_LEVEL) <br /> |

|                      Returns                       ||
|-----------|-----------------------------------------|
| `boolean` | true if the sensor is supported. <br /> |

### registerListener

```
public boolean registerListener (CarSensorManager.OnSensorChangedListener listener, 
                int sensorType, 
                int rate)
```

Register[OnSensorChangedListener](https://developer.android.com/reference/android/car/hardware/CarSensorManager.OnSensorChangedListener)to get repeated sensor updates. Multiple listeners can be registered for a single sensor or the same listener can be used for different sensors. If the same listener is registered again for the same sensor, it will be either ignored or updated depending on the rate.

<br />

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ||
|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `sensorType` | `int`: sensor type to subscribe. Value is[SENSOR_TYPE_CAR_SPEED](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_CAR_SPEED),[SENSOR_TYPE_RPM](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_RPM),[SENSOR_TYPE_ODOMETER](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_ODOMETER),[SENSOR_TYPE_FUEL_LEVEL](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_FUEL_LEVEL),[SENSOR_TYPE_PARKING_BRAKE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_PARKING_BRAKE),[SENSOR_TYPE_GEAR](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_GEAR),[SENSOR_TYPE_NIGHT](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_NIGHT),[SENSOR_TYPE_ENV_OUTSIDE_TEMPERATURE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_ENV_OUTSIDE_TEMPERATURE),[SENSOR_TYPE_IGNITION_STATE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_IGNITION_STATE),[SENSOR_TYPE_WHEEL_TICK_DISTANCE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_WHEEL_TICK_DISTANCE),[SENSOR_TYPE_ABS_ACTIVE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_ABS_ACTIVE),[SENSOR_TYPE_TRACTION_CONTROL_ACTIVE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_TRACTION_CONTROL_ACTIVE),[SENSOR_TYPE_FUEL_DOOR_OPEN](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_FUEL_DOOR_OPEN),[SENSOR_TYPE_EV_BATTERY_LEVEL](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_EV_BATTERY_LEVEL),[SENSOR_TYPE_EV_CHARGE_PORT_OPEN](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_EV_CHARGE_PORT_OPEN),[SENSOR_TYPE_EV_CHARGE_PORT_CONNECTED](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_EV_CHARGE_PORT_CONNECTED),[SENSOR_TYPE_EV_BATTERY_CHARGE_RATE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_EV_BATTERY_CHARGE_RATE), or[SENSOR_TYPE_ENGINE_OIL_LEVEL](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_ENGINE_OIL_LEVEL) <br /> |
| `rate`       | `int`: how fast the sensor events are delivered. It should be one of[SENSOR_RATE_FASTEST](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_RATE_FASTEST),[SENSOR_RATE_FAST](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_RATE_FAST),[SENSOR_RATE_UI](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_RATE_UI),[SENSOR_RATE_NORMAL](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_RATE_NORMAL). Rate may not be respected especially when the same sensor is registered with different listener with different rates. Also, rate might be ignored when vehicle property raises events only when the value is actually changed, for example[SENSOR_TYPE_PARKING_BRAKE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_PARKING_BRAKE)will raise an event only when parking brake was engaged or disengaged. Value is[SENSOR_RATE_ONCHANGE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_RATE_ONCHANGE),[SENSOR_RATE_NORMAL](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_RATE_NORMAL),[SENSOR_RATE_UI](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_RATE_UI),[SENSOR_RATE_FAST](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_RATE_FAST), or[SENSOR_RATE_FASTEST](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_RATE_FASTEST) <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |

|                          Returns                          ||
|-----------|------------------------------------------------|
| `boolean` | if the sensor was successfully enabled. <br /> |

|                              Throws                               ||
|----------------------------|---------------------------------------|
| `IllegalArgumentException` | for wrong argument like wrong rate    |
| `SecurityException`        | if missing the appropriate permission |

### unregisterListener

```
public void unregisterListener (CarSensorManager.OnSensorChangedListener listener, 
                int sensorType)
```

Stop getting sensor update for the given listener and sensor. If the same listener is used for other sensors, those subscriptions will not be affected.

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ||
|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `listener`   | `CarSensorManager.OnSensorChangedListener`: Listener for car sensor data change. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `sensorType` | `int`: Property Id Value is[SENSOR_TYPE_CAR_SPEED](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_CAR_SPEED),[SENSOR_TYPE_RPM](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_RPM),[SENSOR_TYPE_ODOMETER](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_ODOMETER),[SENSOR_TYPE_FUEL_LEVEL](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_FUEL_LEVEL),[SENSOR_TYPE_PARKING_BRAKE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_PARKING_BRAKE),[SENSOR_TYPE_GEAR](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_GEAR),[SENSOR_TYPE_NIGHT](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_NIGHT),[SENSOR_TYPE_ENV_OUTSIDE_TEMPERATURE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_ENV_OUTSIDE_TEMPERATURE),[SENSOR_TYPE_IGNITION_STATE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_IGNITION_STATE),[SENSOR_TYPE_WHEEL_TICK_DISTANCE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_WHEEL_TICK_DISTANCE),[SENSOR_TYPE_ABS_ACTIVE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_ABS_ACTIVE),[SENSOR_TYPE_TRACTION_CONTROL_ACTIVE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_TRACTION_CONTROL_ACTIVE),[SENSOR_TYPE_FUEL_DOOR_OPEN](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_FUEL_DOOR_OPEN),[SENSOR_TYPE_EV_BATTERY_LEVEL](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_EV_BATTERY_LEVEL),[SENSOR_TYPE_EV_CHARGE_PORT_OPEN](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_EV_CHARGE_PORT_OPEN),[SENSOR_TYPE_EV_CHARGE_PORT_CONNECTED](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_EV_CHARGE_PORT_CONNECTED),[SENSOR_TYPE_EV_BATTERY_CHARGE_RATE](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_EV_BATTERY_CHARGE_RATE), or[SENSOR_TYPE_ENGINE_OIL_LEVEL](https://developer.android.com/reference/android/car/hardware/CarSensorManager#SENSOR_TYPE_ENGINE_OIL_LEVEL) <br /> |

### unregisterListener

```
public void unregisterListener (CarSensorManager.OnSensorChangedListener listener)
```

Stop getting sensor update for the given listener. If there are multiple registrations for this listener, all listening will be stopped.

<br />

|                                             Parameters                                              ||
|------------|-----------------------------------------------------------------------------------------|
| `listener` | `CarSensorManager.OnSensorChangedListener`: Listener for car sensor data change. <br /> |