# UpdatePolicy

Summary:[Nested Classes](https://developer.android.com/reference/com/google/android/things/update/UpdatePolicy#nestedclasses)\|[Constants](https://developer.android.com/reference/com/google/android/things/update/UpdatePolicy#constants)\|[Inherited Methods](https://developer.android.com/reference/com/google/android/things/update/UpdatePolicy#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/com/google/android/things/update/UpdatePolicy#)  

# UpdatePolicy

`
public


class
UpdatePolicy
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|-----------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | com.google.android.things.update.UpdatePolicy |

<br />

*** ** * ** ***

The UpdatePolicy is an immutable object that represents the combination of an[UpdateManager](https://developer.android.com/reference/com/google/android/things/update/UpdateManager)policy and its options.

## Summary

|                                                                                     ### Nested classes                                                                                     ||
|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [UpdatePolicy.Builder](https://developer.android.com/reference/com/google/android/things/update/UpdatePolicy.Builder) The Builder is used to construct new UpdatePolicy objects. |

|                                                                                                                                                                                                                                                ### Constants                                                                                                                                                                                                                                                ||
|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [POLICY_APPLY_AND_REBOOT](https://developer.android.com/reference/com/google/android/things/update/UpdatePolicy#POLICY_APPLY_AND_REBOOT) Use with[setPolicy(int)](https://developer.android.com/reference/com/google/android/things/update/UpdatePolicy.Builder#setPolicy(int))and[performUpdateNow(int)](https://developer.android.com/reference/com/google/android/things/update/UpdateManager#performUpdateNow(int))to download and apply updates, followed by an automatic reboot of the device. |
| `int` | [POLICY_APPLY_ONLY](https://developer.android.com/reference/com/google/android/things/update/UpdatePolicy#POLICY_APPLY_ONLY) Use with[setPolicy(int)](https://developer.android.com/reference/com/google/android/things/update/UpdatePolicy.Builder#setPolicy(int))and[performUpdateNow(int)](https://developer.android.com/reference/com/google/android/things/update/UpdateManager#performUpdateNow(int))to download and apply updates.                                                            |
| `int` | [POLICY_CHECKS_ONLY](https://developer.android.com/reference/com/google/android/things/update/UpdatePolicy#POLICY_CHECKS_ONLY) Use with[setPolicy(int)](https://developer.android.com/reference/com/google/android/things/update/UpdatePolicy.Builder#setPolicy(int))and[performUpdateNow(int)](https://developer.android.com/reference/com/google/android/things/update/UpdateManager#performUpdateNow(int))to check for software updates.                                                          |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/com/google/android/things/update/UpdatePolicy#)From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                                                                                                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                                                                                                                                                                                                                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                                                                                                                                                                                                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                                                                                                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                                                                                                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                                                                                                                                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                                                                                                                                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                                                                                                                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long, int))`(long millis, int nanos) ` Causes the current thread to wait until another thread invokes the[notify()](https://developer.android.com/reference/java/lang/Object.html#notify())method or the[notifyAll()](https://developer.android.com/reference/java/lang/Object.html#notifyAll())method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long millis) ` Causes the current thread to wait until either another thread invokes the[notify()](https://developer.android.com/reference/java/lang/Object.html#notify())method or the[notifyAll()](https://developer.android.com/reference/java/lang/Object.html#notifyAll())method for this object, or a specified amount of time has elapsed.                                                                 | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until another thread invokes the[notify()](https://developer.android.com/reference/java/lang/Object.html#notify())method or the[notifyAll()](https://developer.android.com/reference/java/lang/Object.html#notifyAll())method for this object.                                                                                                                                  | ||

## Constants

### POLICY_APPLY_AND_REBOOT

```
int POLICY_APPLY_AND_REBOOT
```

Use with[setPolicy(int)](https://developer.android.com/reference/com/google/android/things/update/UpdatePolicy.Builder#setPolicy(int))and[performUpdateNow(int)](https://developer.android.com/reference/com/google/android/things/update/UpdateManager#performUpdateNow(int))to download and apply updates, followed by an automatic reboot of the device.

<br />

**See also:**

- [setPolicy(UpdatePolicy)](https://developer.android.com/reference/com/google/android/things/update/UpdateManager#setPolicy(com.google.android.things.update.UpdatePolicy))
- [performUpdateNow(int)](https://developer.android.com/reference/com/google/android/things/update/UpdateManager#performUpdateNow(int))

Constant Value: 1 (0x00000001)  

### POLICY_APPLY_ONLY

```
int POLICY_APPLY_ONLY
```

Use with[setPolicy(int)](https://developer.android.com/reference/com/google/android/things/update/UpdatePolicy.Builder#setPolicy(int))and[performUpdateNow(int)](https://developer.android.com/reference/com/google/android/things/update/UpdateManager#performUpdateNow(int))to download and apply updates. The device is ready to be rebooted using[reboot()](https://developer.android.com/reference/com/google/android/things/device/DeviceManager#reboot())when[onStatusUpdate(UpdateManagerStatus)](https://developer.android.com/reference/com/google/android/things/update/StatusListener#onStatusUpdate(com.google.android.things.update.UpdateManagerStatus))is called with a status of[STATE_UPDATED_NEEDS_REBOOT](https://developer.android.com/reference/com/google/android/things/update/UpdateManagerStatus#STATE_UPDATED_NEEDS_REBOOT).

<br />

**See also:**

- [setPolicy(UpdatePolicy)](https://developer.android.com/reference/com/google/android/things/update/UpdateManager#setPolicy(com.google.android.things.update.UpdatePolicy))
- [performUpdateNow(int)](https://developer.android.com/reference/com/google/android/things/update/UpdateManager#performUpdateNow(int))

Constant Value: 2 (0x00000002)  

### POLICY_CHECKS_ONLY

```
int POLICY_CHECKS_ONLY
```

Use with[setPolicy(int)](https://developer.android.com/reference/com/google/android/things/update/UpdatePolicy.Builder#setPolicy(int))and[performUpdateNow(int)](https://developer.android.com/reference/com/google/android/things/update/UpdateManager#performUpdateNow(int))to check for software updates. A software update is available when[onStatusUpdate(UpdateManagerStatus)](https://developer.android.com/reference/com/google/android/things/update/StatusListener#onStatusUpdate(com.google.android.things.update.UpdateManagerStatus))is called with a status of[STATE_UPDATE_AVAILABLE](https://developer.android.com/reference/com/google/android/things/update/UpdateManagerStatus#STATE_UPDATE_AVAILABLE).

<br />

**See also:**

- [setPolicy(UpdatePolicy)](https://developer.android.com/reference/com/google/android/things/update/UpdateManager#setPolicy(com.google.android.things.update.UpdatePolicy))
- [performUpdateNow(int)](https://developer.android.com/reference/com/google/android/things/update/UpdateManager#performUpdateNow(int))

Constant Value: 3 (0x00000003)  
-

  ## Interfaces

  - [StatusListener](https://developer.android.com/reference/com/google/android/things/update/StatusListener)
-

  ## Classes

  - [PendingUpdateInfo](https://developer.android.com/reference/com/google/android/things/update/PendingUpdateInfo)
  - [UpdateManager](https://developer.android.com/reference/com/google/android/things/update/UpdateManager)
  - [UpdateManagerStatus](https://developer.android.com/reference/com/google/android/things/update/UpdateManagerStatus)
  - [UpdatePolicy](https://developer.android.com/reference/com/google/android/things/update/UpdatePolicy)
  - [UpdatePolicy.Builder](https://developer.android.com/reference/com/google/android/things/update/UpdatePolicy.Builder)
  - [VersionInfo](https://developer.android.com/reference/com/google/android/things/update/VersionInfo)