# CarPropertyManager.SetPropertyRequest

Summary:[Methods](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.SetPropertyRequest#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.SetPropertyRequest#inhmethods)  

# CarPropertyManager.SetPropertyRequest

`
public
static
final

class
CarPropertyManager.SetPropertyRequest
`  
`

extends Object


``


implements

`[CarPropertyManager.AsyncPropertyRequest](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.AsyncPropertyRequest)`


`

|---|--------------------------------------------------------------------------|
| java.lang.Object                                                            ||
| ↳ | android.car.hardware.property.CarPropertyManager.SetPropertyRequest\<T\> |

<br />

*** ** * ** ***

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

## Summary

|                                                                                                                                               ### Public methods                                                                                                                                               ||
|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` int`     | ` `[getAreaId](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.SetPropertyRequest#getAreaId())`() ` Returns the area ID for the property of this request.                                                                                                 |
| ` int`     | ` `[getPropertyId](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.SetPropertyRequest#getPropertyId())`() ` Returns the ID for the property of this request.                                                                                              |
| ` int`     | ` `[getRequestId](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.SetPropertyRequest#getRequestId())`() ` Returns the unique ID for this request.                                                                                                         |
| ` float`   | ` `[getUpdateRateHz](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.SetPropertyRequest#getUpdateRateHz())`() ` Gets the update rate for listening for property updates.                                                                                  |
| ` T`       | ` `[getValue](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.SetPropertyRequest#getValue())`() ` Gets the property value to set.                                                                                                                         |
| ` boolean` | ` `[isWaitForPropertyUpdate](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.SetPropertyRequest#isWaitForPropertyUpdate())`() ` Gets whether to wait for property update event before calling success callback.                                           |
| ` void`    | ` `[setUpdateRateHz](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.SetPropertyRequest#setUpdateRateHz(float))`(float updateRateHz) ` Sets the update rate in Hz for listening for property updates for continuous property.                             |
| ` void`    | ` `[setWaitForPropertyUpdate](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.SetPropertyRequest#setWaitForPropertyUpdate(boolean))`(boolean waitForPropertyUpdate) ` Sets whether to wait for the property update event before calling success callback. |
| ` String`  | ` `[toString](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.SetPropertyRequest#toString())`() ` Prints out debug message.                                                                                                                               |

| ### Inherited methods |
|-----------------------|---|
| From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||
| From interface` `[android.car.hardware.property.CarPropertyManager.AsyncPropertyRequest](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.AsyncPropertyRequest)` ` |-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract int` | ` `[getAreaId](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.AsyncPropertyRequest#getAreaId())`() ` Returns the area ID for the property of this request.    | | ` abstract int` | ` `[getPropertyId](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.AsyncPropertyRequest#getPropertyId())`() ` Returns the ID for the property of this request. | | ` abstract int` | ` `[getRequestId](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.AsyncPropertyRequest#getRequestId())`() ` Returns the unique ID for this request.            | ||

## Public methods

### getAreaId

```
public int getAreaId ()
```

Returns the area ID for the property of this request.

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

**See also:**

- [CarPropertyManager.AsyncPropertyRequest.getAreaId()](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.AsyncPropertyRequest#getAreaId())  

### getPropertyId

```
public int getPropertyId ()
```

Returns the ID for the property of this request.

The ID must be one of the[VehiclePropertyIds](https://developer.android.com/reference/android/car/VehiclePropertyIds)or vendor property IDs.

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

**See also:**

- [CarPropertyManager.AsyncPropertyRequest.getPropertyId()](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.AsyncPropertyRequest#getPropertyId())  

### getRequestId

```
public int getRequestId ()
```

Returns the unique ID for this request.

Each request must have a unique request ID so the responses can be differentiated.

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

**See also:**

- [CarPropertyManager.AsyncPropertyRequest.getRequestId()](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager.AsyncPropertyRequest#getRequestId())  

### getUpdateRateHz

```
public float getUpdateRateHz ()
```

Gets the update rate for listening for property updates.

<br />

|     Returns     ||
|---------|--------|
| `float` | <br /> |

### getValue

```
public T getValue ()
```

Gets the property value to set.

<br />

|   Returns   ||
|-----|--------|
| `T` | <br /> |

### isWaitForPropertyUpdate

```
public boolean isWaitForPropertyUpdate ()
```

Gets whether to wait for property update event before calling success callback.

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### setUpdateRateHz

```
public void setUpdateRateHz (float updateRateHz)
```

Sets the update rate in Hz for listening for property updates for continuous property.

If`waitForPropertyUpdate`is set to`true`(by default) and if the property is set to a different value than its current value, the success callback will be called when a property update event for the new value arrived. This option controls how frequent the property update event should be reported for continuous property. This is similar to`updateRateHz`in[CarPropertyManager.registerCallback](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager#registerCallback(android.car.hardware.property.CarPropertyManager.CarPropertyEventCallback,%20int,%20float)).

This is ignored for non-continuous properties.

This is ignored if`waitForPropertyUpdate`is set to`false`.

<br />

|           Parameters           ||
|----------------|----------------|
| `updateRateHz` | `float` <br /> |

### setWaitForPropertyUpdate

```
public void setWaitForPropertyUpdate (boolean waitForPropertyUpdate)
```

Sets whether to wait for the property update event before calling success callback.

This arguments controls under what conditions the operation is considered succeeded and the success callback will be called.

If this is set to`true`(by default), the success callback will be called when both of the following conditions are met:

- the set operation is successfully delivered to vehicle bus.
- the`mPropertyId`+`mAreaId`'s value already equal to`mValue`or is successfully updated to the`mValue`through the set operation.

Even if the target value is the same as the current value, we will still send the set operation to the vehicle bus. If caller wants to reduce unnecessary overhead, caller must check existing values before issuing the requests.

If the first condition fails, the error callback will be called. If the second condition fails, which means we don't see the property updated to the target value within a specified timeout, the error callback will be called with[CarPropertyManager.STATUS_ERROR_TIMEOUT](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager#STATUS_ERROR_TIMEOUT).

If this is set to`false`, the success callback will be called after the set operation is successfully delivered to vehicle bus.

Under most cases, client should wait for the property update to verify that the set operation actually succeeded.

For cases when the property is write-only (no way to get property update event) or when the property represents some action, instead of an actual state, e.g. key stroke where the property's current value is not meaningful, caller should set`waitForPropertyUpdate`to`false`.

For`HVAC_TEMPERATURE_VALUE_SUGGESTION`, this must be set to`false`because the updated property value will not be the same as the value to be set.

Note that even if this is set to`true`, it is only guaranteed that the property value is the target value after the success callback is called if no other clients are changing the property at the same time. It is always possible that another client changes the property value after the property is updated to the target value, but before the client success callback runs. We only guarantee that at some point during the period after the client issues the request and before the success callback is called, the property value was set to the target value.

<br />

|                Parameters                 ||
|-------------------------|------------------|
| `waitForPropertyUpdate` | `boolean` <br /> |

### toString

```
public String toString ()
```

Prints out debug message.

<br />

|     Returns      ||
|----------|--------|
| `String` | <br /> |