# CarPropertyManager.SetPropertyCallback

# CarPropertyManager.SetPropertyCallback

`
public
static


interface
CarPropertyManager.SetPropertyCallback
`  
`


`

|----------------------------------------------------------------------|
| android.car.hardware.property.CarPropertyManager.SetPropertyCallback |

<br />

*** ** * ** ***

A callback[CarPropertyManager.setPropertiesAsync](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager#setPropertiesAsync(java.util.List<android.car.hardware.property.CarPropertyManager.SetPropertyRequest<?>>,%20android.os.CancellationSignal,%20java.util.concurrent.Executor,%20android.car.hardware.property.CarPropertyManager.SetPropertyCallback))when succeeded or failed.

## Summary

|                                                                                                                                                                                                                                                                                     ### Public methods                                                                                                                                                                                                                                                                                     ||
|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract void` | ` `[onFailure](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.SetPropertyCallback#onFailure(android.car.hardware.property.CarPropertyManager.PropertyAsyncError))`(`[CarPropertyManager.PropertyAsyncError](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.PropertyAsyncError)` propertyAsyncError) ` Method called when[SetPropertyRequest](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.SetPropertyRequest)returns an error.           |
| ` abstract void` | ` `[onSuccess](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.SetPropertyCallback#onSuccess(android.car.hardware.property.CarPropertyManager.SetPropertyResult))`(`[CarPropertyManager.SetPropertyResult](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.SetPropertyResult)` setPropertyResult) ` Method called when the[SetPropertyRequest](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.SetPropertyRequest)successfully set the value. |

## Public methods

### onFailure

```
public abstract void onFailure (CarPropertyManager.PropertyAsyncError propertyAsyncError)
```

Method called when[SetPropertyRequest](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.SetPropertyRequest)returns an error.

<br />

|                              Parameters                              ||
|----------------------|------------------------------------------------|
| `propertyAsyncError` | `CarPropertyManager.PropertyAsyncError` <br /> |

### onSuccess

```
public abstract void onSuccess (CarPropertyManager.SetPropertyResult setPropertyResult)
```

Method called when the[SetPropertyRequest](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.SetPropertyRequest)successfully set the value.

This means: the set value request is successfully sent to vehicle

and

either the current property value is already the target value, or we have received a property update event indicating the value is updated to the target value.

If multiple clients set a property for the same area ID simultaneously with different values, the order is undefined. One possible case is that both requests are sent to the vehicle bus, which causes two property update events. As a result, the success callback would be called for both clients, but in an undefined order. This means that even if the success callback is called, it doesn't necessarily mean getting the property would return the same value you just set. Another client might have changed the value after you set it.

If only one requests is successfully processed by the vehicle bus, overwriting the other request, then only one success callback would be called for one client. The other client would get the failure callback with[CarPropertyManager.STATUS_ERROR_TIMEOUT](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager#STATUS_ERROR_TIMEOUT)error code.

If multiple clients set a property for the same area ID simultaneously with the same value. The success callback for both clients would be called in an undefined order.

<br />

|                             Parameters                             ||
|---------------------|-----------------------------------------------|
| `setPropertyResult` | `CarPropertyManager.SetPropertyResult` <br /> |