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 |
List<AreaIdConfig<T>>
|
getAreaIdConfigs()
Returns a list of |
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 is deprecated.
- use |
T
|
getMaxValue()
This method is deprecated.
- use |
float
|
getMinSampleRate()
Returns the min sample rate in Hz. |
T
|
getMinValue()
This method is deprecated.
- use |
T
|
getMinValue(int areaId)
This method is deprecated.
- use |
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 |
void
|
writeToParcel(Parcel dest, int flags)
|
Inherited methods | |
|---|---|
Constants
VEHICLE_PROPERTY_ACCESS_NONE
public static final int VEHICLE_PROPERTY_ACCESS_NONE
Property Access Unknown
Constant Value: 0 (0x00000000)
VEHICLE_PROPERTY_ACCESS_READ
public static final int VEHICLE_PROPERTY_ACCESS_READ
The property is readable
Constant Value: 1 (0x00000001)
VEHICLE_PROPERTY_ACCESS_READ_WRITE
public static final int VEHICLE_PROPERTY_ACCESS_READ_WRITE
The property is readable and writable
Constant Value: 3 (0x00000003)
VEHICLE_PROPERTY_ACCESS_WRITE
public static final int VEHICLE_PROPERTY_ACCESS_WRITE
The property is writable
Constant Value: 2 (0x00000002)
VEHICLE_PROPERTY_CHANGE_MODE_CONTINUOUS
public static final int VEHICLE_PROPERTY_CHANGE_MODE_CONTINUOUS
Properties of this type change continuously.
Constant Value: 2 (0x00000002)
VEHICLE_PROPERTY_CHANGE_MODE_ONCHANGE
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
public static final int VEHICLE_PROPERTY_CHANGE_MODE_STATIC
Properties of this type must never be changed.
Constant Value: 0 (0x00000000)
Fields
Public methods
describeContents
public int describeContents ()
| Returns | |
|---|---|
int |
|
getAccess
public int getAccess ()
Returns the access type of the car property.
The access type could be one of the following:
CarPropertyConfig.VEHICLE_PROPERTY_ACCESS_NONECarPropertyConfig.VEHICLE_PROPERTY_ACCESS_READCarPropertyConfig.VEHICLE_PROPERTY_ACCESS_WRITECarPropertyConfig.VEHICLE_PROPERTY_ACCESS_READ_WRITE
| Returns | |
|---|---|
int |
the access type of the car property.
Value is VEHICLE_PROPERTY_ACCESS_NONE, VEHICLE_PROPERTY_ACCESS_READ, VEHICLE_PROPERTY_ACCESS_WRITE, or VEHICLE_PROPERTY_ACCESS_READ_WRITE |
getAreaIdConfig
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
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
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. |
getAreaType
public int getAreaType ()
Returns the area type of the car property.
The area type could be one of the following:
VehicleAreaType.VEHICLE_AREA_TYPE_GLOBALVehicleAreaType.VEHICLE_AREA_TYPE_WINDOWVehicleAreaType.VEHICLE_AREA_TYPE_SEATVehicleAreaType.VEHICLE_AREA_TYPE_DOORVehicleAreaType.VEHICLE_AREA_TYPE_MIRRORVehicleAreaType.VEHICLE_AREA_TYPE_WHEELVehicleAreaType.VEHICLE_AREA_TYPE_VENDOR
| Returns | |
|---|---|
int |
the area type of the car property.
Value is VehicleAreaType.VEHICLE_AREA_TYPE_GLOBAL, VehicleAreaType.VEHICLE_AREA_TYPE_WINDOW, VehicleAreaType.VEHICLE_AREA_TYPE_SEAT, VehicleAreaType.VEHICLE_AREA_TYPE_DOOR, VehicleAreaType.VEHICLE_AREA_TYPE_MIRROR, VehicleAreaType.VEHICLE_AREA_TYPE_WHEEL, or VehicleAreaType.VEHICLE_AREA_TYPE_VENDOR |
getChangeMode
public int getChangeMode ()
Returns the change mode of the car property.
The change mode could be one of the following:
CarPropertyConfig.VEHICLE_PROPERTY_CHANGE_MODE_STATICCarPropertyConfig.VEHICLE_PROPERTY_CHANGE_MODE_ONCHANGECarPropertyConfig.VEHICLE_PROPERTY_CHANGE_MODE_CONTINUOUS
| 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
public List<Integer> getConfigArray ()
Returns the optional additional configuration parameters.
| Returns | |
|---|---|
List<Integer> |
Additional configuration parameters. For different properties, configArrays have different information. |
getMaxSampleRate
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
public T getMaxValue (int areaId)
This method is deprecated.
- 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
public T getMaxValue ()
This method is deprecated.
- use getAreaIdConfigs() or getAreaIdConfig(int) instead.
| Returns | |
|---|---|
T |
Max value in areaId 0. Null if not have max value. |
getMinSampleRate
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
public T getMinValue ()
This method is deprecated.
- use getAreaIdConfigs() or getAreaIdConfig(int) instead.
| Returns | |
|---|---|
T |
Min value in areaId 0. Null if not have min value. |
getMinValue
public T getMinValue (int areaId)
This method is deprecated.
- 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
public int getPropertyId ()
Returns the property identifier.
| Returns | |
|---|---|
int |
Property identifier, must be one of enums in
VehiclePropertyIds. |
getPropertyType
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
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
public void writeToParcel (Parcel dest,
int flags)| Parameters | |
|---|---|
dest |
Parcel |
flags |
int |