CarPropertyConfig

public final class CarPropertyConfig
extends Object implements Parcelable

java.lang.Object
   ↳ android.car.hardware.CarPropertyConfig<T>


Represents general information about car property such as data type and min/max ranges for car areas (if applicable). This class supposed to be immutable, parcelable and could be passed over.

Summary

Constants

int VEHICLE_PROPERTY_ACCESS_NONE

Property Access Unknown

int VEHICLE_PROPERTY_ACCESS_READ

The property is readable

int VEHICLE_PROPERTY_ACCESS_READ_WRITE

The property is readable and writable

int VEHICLE_PROPERTY_ACCESS_WRITE

The property is writable

int VEHICLE_PROPERTY_CHANGE_MODE_CONTINUOUS

Properties of this type change continuously.

int VEHICLE_PROPERTY_CHANGE_MODE_ONCHANGE

Properties of this type must report when there is a change.

int VEHICLE_PROPERTY_CHANGE_MODE_STATIC

Properties of this type must never be changed.

Inherited constants

Fields

public static final Creator<CarPropertyConfig<T>> CREATOR

Public methods

int describeContents()
int getAccess()

Returns the access type of the car property.

AreaIdConfig<T> getAreaIdConfig(int areaId)

Returns the AreaIdConfig for the specified areaId.

List<AreaIdConfig<T>> getAreaIdConfigs()

Returns a list of AreaIdConfig for this property.

int[] getAreaIds()

Returns a list of area IDs supported for the vehicle property.

int getAreaType()

Returns the area type of the car property.

int getChangeMode()

Returns the change mode of the car property.

List<Integer> getConfigArray()

Returns the optional additional configuration parameters.

float getMaxSampleRate()

Returns the max sample rate in Hz.

T getMaxValue(int areaId)

This method was deprecated in API level 34. - use getAreaIdConfigs() or getAreaIdConfig(int) instead.

T getMaxValue()

This method was deprecated in API level 34. - use getAreaIdConfigs() or getAreaIdConfig(int) instead.

float getMinSampleRate()

Returns the min sample rate in Hz.

T getMinValue()

This method was deprecated in API level 34. - use getAreaIdConfigs() or getAreaIdConfig(int) instead.

T getMinValue(int areaId)

This method was deprecated in API level 34. - use getAreaIdConfigs() or getAreaIdConfig(int) instead.

int getPropertyId()

Returns the property identifier.

Class<T> getPropertyType()

Returns the value type of the vehicle property.

boolean isGlobalProperty()

Returns whether this property is area type VehicleAreaType#VEHICLE_AREA_TYPE_GLOBAL.

void writeToParcel(Parcel dest, int flags)

Inherited methods

Constants

VEHICLE_PROPERTY_ACCESS_NONE

Added in API level 29
public static final int VEHICLE_PROPERTY_ACCESS_NONE

Property Access Unknown

Constant Value: 0 (0x00000000)

VEHICLE_PROPERTY_ACCESS_READ

Added in API level 29
public static final int VEHICLE_PROPERTY_ACCESS_READ

The property is readable

Constant Value: 1 (0x00000001)

VEHICLE_PROPERTY_ACCESS_READ_WRITE

Added in API level 29
public static final int VEHICLE_PROPERTY_ACCESS_READ_WRITE

The property is readable and writable

Constant Value: 3 (0x00000003)

VEHICLE_PROPERTY_ACCESS_WRITE

Added in API level 29
public static final int VEHICLE_PROPERTY_ACCESS_WRITE

The property is writable

Constant Value: 2 (0x00000002)

VEHICLE_PROPERTY_CHANGE_MODE_CONTINUOUS

Added in API level 29
public static final int VEHICLE_PROPERTY_CHANGE_MODE_CONTINUOUS

Properties of this type change continuously.

Constant Value: 2 (0x00000002)

VEHICLE_PROPERTY_CHANGE_MODE_ONCHANGE

Added in API level 29
public static final int VEHICLE_PROPERTY_CHANGE_MODE_ONCHANGE

Properties of this type must report when there is a change.

Constant Value: 1 (0x00000001)

VEHICLE_PROPERTY_CHANGE_MODE_STATIC

Added in API level 29
public static final int VEHICLE_PROPERTY_CHANGE_MODE_STATIC

Properties of this type must never be changed.

Constant Value: 0 (0x00000000)

Fields

CREATOR

Added in API level 29
public static final Creator<CarPropertyConfig<T>> CREATOR

Public methods

describeContents

Added in API level 29
public int describeContents ()

Returns
int

getAreaIdConfig

Added in API level 34
public AreaIdConfig<T> getAreaIdConfig (int areaId)

Returns the AreaIdConfig for the specified areaId.

Parameters
areaId int

Returns
AreaIdConfig<T> AreaIdConfig instance for passed areaId

Throws
IllegalArgumentException if areaId is not supported for property

getAreaIdConfigs

Added in API level 34
public List<AreaIdConfig<T>> getAreaIdConfigs ()

Returns a list of AreaIdConfig for this property.

Returns
List<AreaIdConfig<T>> list of AreaIdConfig instances for this property.

getAreaIds

Added in API level 29
public int[] getAreaIds ()

Returns a list of area IDs supported for the vehicle property.

An area represents a unique element of a VehicleAreaType. For instance, if the VehicleAreaType is VehicleAreaType#VEHICLE_AREA_TYPE_SEAT, then an example area is VehicleAreaSeat.SEAT_ROW_1_LEFT.

An area ID is a combination of one or more areas, and is created by bitwise "OR"ing the areas together. Areas from different VehicleAreaType values will not be mixed in a single area ID. For example, a VehicleAreaWheel area cannot be combined with a VehicleAreaSeat area in an area ID.

For properties that return VehicleAreaType#VEHICLE_AREA_TYPE_GLOBAL for getAreaType(), they only support a single area ID of 0.

Rules for mapping a non VehicleAreaType#VEHICLE_AREA_TYPE_GLOBAL property to area IDs:

  • A property is mapped to a set of area IDs that are impacted when the property value changes.
  • An area cannot be part of multiple area IDs, it will only be part of a single area ID.
  • When the property value changes in one of the areas in an area ID, then it will automatically change in all other areas in the area ID.
  • The property value will be independently controllable in any two different area IDs.

Returns
int[] the array of supported area IDs.

getChangeMode

Added in API level 29
public int getChangeMode ()

Returns the change mode of the car property.

The change mode could be one of the following:

Returns
int the change mode of properties. Value is VEHICLE_PROPERTY_CHANGE_MODE_STATIC, VEHICLE_PROPERTY_CHANGE_MODE_ONCHANGE, or VEHICLE_PROPERTY_CHANGE_MODE_CONTINUOUS

getConfigArray

Added in API level 29
public List<Integer> getConfigArray ()

Returns the optional additional configuration parameters.

Returns
List<Integer> Additional configuration parameters. For different properties, configArrays have different information.

getMaxSampleRate

Added in API level 29
public float getMaxSampleRate ()

Returns the max sample rate in Hz.

Returns
float Max sample rate in Hz. Must be defined for VEHICLE_PROPERTY_CHANGE_MODE_CONTINUOUS return 0 if change mode is not continuous.

getMaxValue

Added in API level 29
Deprecated in API level 34
public T getMaxValue (int areaId)

This method was deprecated in API level 34.
- use getAreaIdConfigs() or getAreaIdConfig(int) instead.

Parameters
areaId int: the area ID

Returns
T max value in given areaId. Null if not have max value in given area

getMaxValue

Added in API level 29
Deprecated in API level 34
public T getMaxValue ()

This method was deprecated in API level 34.
- use getAreaIdConfigs() or getAreaIdConfig(int) instead.

Returns
T Max value in areaId 0. Null if not have max value.

getMinSampleRate

Added in API level 29
public float getMinSampleRate ()

Returns the min sample rate in Hz.

Returns
float Min sample rate in Hz. Must be defined for VEHICLE_PROPERTY_CHANGE_MODE_CONTINUOUS return 0 if change mode is not continuous.

getMinValue

Added in API level 29
Deprecated in API level 34
public T getMinValue ()

This method was deprecated in API level 34.
- use getAreaIdConfigs() or getAreaIdConfig(int) instead.

Returns
T Min value in areaId 0. Null if not have min value.

getMinValue

Added in API level 29
Deprecated in API level 34
public T getMinValue (int areaId)

This method was deprecated in API level 34.
- use getAreaIdConfigs() or getAreaIdConfig(int) instead.

Parameters
areaId int: the area ID

Returns
T min value in given areaId. Null if not have min value in given area

getPropertyId

Added in API level 29
public int getPropertyId ()

Returns the property identifier.

Returns
int Property identifier, must be one of enums in VehiclePropertyIds.

getPropertyType

Added in API level 30
public Class<T> getPropertyType ()

Returns the value type of the vehicle property.

The value type could be one of the following:

  • Boolean
  • Float
  • Float[]
  • Integer
  • Integer[]
  • Long
  • Long[]
  • String
  • byte[]
  • Object[]

Returns
Class<T> the value type of the vehicle property.

isGlobalProperty

Added in API level 29
public boolean isGlobalProperty ()

Returns whether this property is area type VehicleAreaType#VEHICLE_AREA_TYPE_GLOBAL.

Returns
boolean true if this property is area type VehicleAreaType#VEHICLE_AREA_TYPE_GLOBAL.

writeToParcel

Added in API level 29
public void writeToParcel (Parcel dest, 
                int flags)

Parameters
dest Parcel

flags int