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> CREATOR

Public methods

int describeContents()
int getAccess()

Return the access type of the car property.

int[] getAreaIds()
int getAreaType()

Return the area type of the car property.

int getChangeMode()

Return the change mode of the car property.

List<Integer> getConfigArray()
float getMaxSampleRate()
T getMaxValue(int areaId)
T getMaxValue()
float getMinSampleRate()
T getMinValue()
T getMinValue(int areaId)
int getPropertyId()
Class<T> getPropertyType()

Returns the value type of the vehicle property.

boolean isGlobalProperty()
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> CREATOR

Public methods

describeContents

Added in API level 29
public int describeContents ()

Returns
int

getAreaIds

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

Returns
int[] Array of areaIds. An AreaID is a combination of one or more areas, and is represented using a bitmask of Area enums. Different AreaTypes may not be mixed in a single AreaID. For instance, a window area cannot be combined with a seat area in an AreaID. Rules for mapping a zoned property to AreaIDs: - A property must be mapped to an array of AreaIDs that are impacted when the property value changes. - Each element in the array must represent an AreaID, in which, the property value can only be changed together in all the areas within an AreaID and never independently. That is, when the property value changes in one of the areas in an AreaID in the array, then it must automatically change in all other areas in the AreaID. - The property value must be independently controllable in any two different AreaIDs in the array. - An area must only appear once in the array of AreaIDs. That is, an area must only be part of a single AreaID in the array.

getChangeMode

Added in API level 29
public int getChangeMode ()

Return 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
List<Integer> Additional configuration parameters. For different properties, configArrays have different information.

getMaxSampleRate

Added in API level 29
public float getMaxSampleRate ()

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
public T getMaxValue (int areaId)

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

getMaxValue

Added in API level 29
public T getMaxValue ()

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

getMinSampleRate

Added in API level 29
public float getMinSampleRate ()

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
public T getMinValue ()

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

getMinValue

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

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
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
boolean true if this property doesn't hold car area-specific configuration.

writeToParcel

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

Parameters
dest Parcel

flags int