Google 致力于为黑人社区推动种族平等。查看具体举措
Added in API level 29

CarPropertyManager.CarPropertyEventCallback

public static interface CarPropertyManager.CarPropertyEventCallback

android.car.hardware.property.CarPropertyManager.CarPropertyEventCallback


Application registers CarPropertyEventCallback object to receive updates and changes to subscribed Vehicle specific properties.

Summary

Public methods

abstract void onChangeEvent(CarPropertyValue value)

Called when a property is updated

default void onErrorEvent(int propId, int areaId, int errorCode)

Called when an error is detected when setting a property.

abstract void onErrorEvent(int propId, int zone)

Called when an error is detected when setting a property.

Public methods

onChangeEvent

Added in API level 29
public abstract void onChangeEvent (CarPropertyValue value)

Called when a property is updated

Parameters
value CarPropertyValue: Property that has been updated.

onErrorEvent

public void onErrorEvent (int propId, 
                int areaId, 
                int errorCode)

Called when an error is detected when setting a property.

Clients which changed the property value in the areaId most recently will receive this callback. If multiple clients set a property for the same area id simultaneously, which one takes precedence is undefined. Typically, the last set operation (in the order that they are issued to car's ECU) overrides the previous set operations. The delivered error reflects the error happened in the last set operation.

Parameters
propId int: Property ID which is detected an error.

areaId int: AreaId which is detected an error.

errorCode int: Error code is raised in the car. Value is CarPropertyManager.CAR_SET_PROPERTY_ERROR_CODE_TRY_AGAIN, CarPropertyManager.CAR_SET_PROPERTY_ERROR_CODE_INVALID_ARG, CarPropertyManager.CAR_SET_PROPERTY_ERROR_CODE_PROPERTY_NOT_AVAILABLE, CarPropertyManager.CAR_SET_PROPERTY_ERROR_CODE_ACCESS_DENIED, or CarPropertyManager.CAR_SET_PROPERTY_ERROR_CODE_UNKNOWN

onErrorEvent

Added in API level 29
public abstract void onErrorEvent (int propId, 
                int zone)

Called when an error is detected when setting a property.

Parameters
propId int: Property ID which is detected an error.

zone int: Zone which is detected an error.