CarPropertyValue

public final class CarPropertyValue
extends Object implements Parcelable

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


Stores a value for a vehicle property ID and area ID combination. Client should use android.car.* types when dealing with property ID, area ID or property value and MUST NOT use android.hardware.automotive.vehicle.* types directly.

Summary

Nested classes

@interface CarPropertyValue.PropertyStatus

Value is CarPropertyValue.STATUS_AVAILABLE, CarPropertyValue.STATUS_UNAVAILABLE, or CarPropertyValue.STATUS_ERROR 

Constants

int STATUS_AVAILABLE

CarPropertyValue is available.

int STATUS_ERROR

CarPropertyValue has an error.

int STATUS_UNAVAILABLE

CarPropertyValue is unavailable.

Inherited constants

Fields

public static final Creator<CarPropertyValue> CREATOR

Public methods

int describeContents()
int getAreaId()
int getPropertyId()
int getStatus()
long getTimestamp()

Returns the timestamp in nanoseconds at which the CarPropertyValue happened.

T getValue()
void writeToParcel(Parcel dest, int flags)

Inherited methods

Constants

STATUS_AVAILABLE

Added in API level 29
public static final int STATUS_AVAILABLE

CarPropertyValue is available.

Constant Value: 0 (0x00000000)

STATUS_ERROR

Added in API level 29
public static final int STATUS_ERROR

CarPropertyValue has an error.

Constant Value: 2 (0x00000002)

STATUS_UNAVAILABLE

Added in API level 29
public static final int STATUS_UNAVAILABLE

CarPropertyValue is unavailable.

Constant Value: 1 (0x00000001)

Fields

CREATOR

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

Public methods

describeContents

Added in API level 29
public int describeContents ()

Returns
int

getAreaId

Added in API level 29
public int getAreaId ()

Returns
int Area id of CarPropertyValue, must be one of enums in one of the following classes: or 0 for global property.

getPropertyId

Added in API level 29
public int getPropertyId ()

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

getStatus

Added in API level 29
public int getStatus ()

Returns
int Status of CarPropertyValue Value is STATUS_AVAILABLE, STATUS_UNAVAILABLE, or STATUS_ERROR

getTimestamp

Added in API level 29
public long getTimestamp ()

Returns the timestamp in nanoseconds at which the CarPropertyValue happened. For a given car property, each new CarPropertyValue should be monotonically increasing using the same time base as SystemClock.elapsedRealtimeNanos().

NOTE: Timestamp should be synchronized with other signals from the platform (e.g. android.location.Location and SensorEvent instances). Ideally, timestamp synchronization error should be below 1 millisecond.

Returns
long

getValue

Added in API level 29
public T getValue ()

Returns
T Value of CarPropertyValue

writeToParcel

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

Parameters
dest Parcel

flags int