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
Constants | |
|---|---|
int | 
        
          STATUS_AVAILABLE
          
  | 
    
int | 
        
          STATUS_ERROR
          
  | 
    
int | 
        
          STATUS_UNAVAILABLE
          
  | 
    
Inherited constants | 
|---|
Fields | |
|---|---|
    public
    static
    final
    Creator<CarPropertyValue<T>> | 
    
      CREATOR
      
  | 
  
Public methods | |
|---|---|
        
        
        
        
        
        int
     | 
  
    
      
      describeContents()
      
      
     | 
  
        
        
        
        
        
        boolean
     | 
  
    
      
      equals(Object object)
      
      
        Checks equality with passed   | 
  
        
        
        
        
        
        int
     | 
  
    
      
      getAreaId()
      
      
        Returns the area identifier.  | 
  
        
        
        
        
        
        int
     | 
  
    
      
      getPropertyId()
      
      
        Returns the property identifier.  | 
  
        
        
        
        
        
        int
     | 
  
    
      
      getPropertyStatus()
      
      
     | 
  
        
        
        
        
        
        int
     | 
  
    
      
      getStatus()
      
      
        
      This method is deprecated.
    Use   | 
  
        
        
        
        
        
        long
     | 
  
    
      
      getTimestamp()
      
      
        Returns the timestamp in nanoseconds at which the   | 
  
        
        
        
        
        
        T
     | 
  
    
      
      getValue()
      
      
        Returns the value for   | 
  
        
        
        
        
        
        int
     | 
  
    
      
      hashCode()
      
      
        Generates hash code for this instance.  | 
  
        
        
        
        
        
        void
     | 
  
    
      
      writeToParcel(Parcel dest, int flags)
      
      
     | 
  
Inherited methods | |
|---|---|
Constants
STATUS_AVAILABLE
public static final int STATUS_AVAILABLE
CarPropertyValue is available.
Constant Value: 0 (0x00000000)
STATUS_ERROR
public static final int STATUS_ERROR
CarPropertyValue has an error.
Constant Value: 2 (0x00000002)
STATUS_UNAVAILABLE
public static final int STATUS_UNAVAILABLE
CarPropertyValue is unavailable.
Constant Value: 1 (0x00000001)
Fields
Public methods
describeContents
public int describeContents ()
| Returns | |
|---|---|
int | 
        |
equals
public boolean equals (Object object)
Checks equality with passed object.
| Parameters | |
|---|---|
object | 
        
          Object  | 
      
| Returns | |
|---|---|
boolean | 
        |
getAreaId
public int getAreaId ()
Returns the area identifier.
| Returns | |
|---|---|
int | 
        The area identifier of CarPropertyValue, If property is
         VehicleAreaType.VEHICLE_AREA_TYPE_GLOBAL, it will be 0.
         Otherwise, it will be on or more OR'd together constants of this property's
         VehicleAreaType:
           
  | 
      
getPropertyId
public int getPropertyId ()
Returns the property identifier.
| Returns | |
|---|---|
int | 
        The property identifier of CarPropertyValue. See constants in
         VehiclePropertyIds for some system defined possible values. | 
      
getPropertyStatus
public int getPropertyStatus ()
| Returns | |
|---|---|
int | 
        The property status of CarPropertyValue
 Value is STATUS_AVAILABLE, STATUS_UNAVAILABLE, or STATUS_ERROR | 
      
getStatus
public int getStatus ()
      This method is deprecated.
    Use getPropertyStatus() instead.
  
| Returns | |
|---|---|
int | 
        Status of CarPropertyValue
 Value is STATUS_AVAILABLE, STATUS_UNAVAILABLE, or STATUS_ERROR | 
      
getTimestamp
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.
 Location and SensorEvent instances).
 Ideally, timestamp synchronization error should be below 1 millisecond.
| Returns | |
|---|---|
long | 
        |
getValue
public T getValue ()
Returns the value for CarPropertyValue.
 
 Note:Caller must check the value of getPropertyStatus(). Only use
 getValue() when getPropertyStatus() is STATUS_AVAILABLE. If not,
 getValue() is meaningless.
| Returns | |
|---|---|
T | 
        |
hashCode
public int hashCode ()
Generates hash code for this instance.
| Returns | |
|---|---|
int | 
        |
writeToParcel
public void writeToParcel (Parcel dest, 
                int flags)| Parameters | |
|---|---|
dest | 
        
          Parcel  | 
      
flags | 
        
          int  |