# UpdateInfo.Builder

Artifact: [androidx.security:security-state](https://developer.android.com/jetpack/androidx/releases/security) [View Source](https://cs.android.com/search?q=file:androidx/security/state/UpdateInfo.kt+class:androidx.security.state.UpdateInfo.Builder) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/security#1.1.0)

*** ** * ** ***


```
class UpdateInfo.Builder
```

<br />

*** ** * ** ***

Builder class for creating an instance of UpdateInfo.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/security/state/UpdateInfo.Builder#Builder()()` |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/security/state/UpdateInfo` | `https://developer.android.com/reference/kotlin/androidx/security/state/UpdateInfo.Builder#build()()` Builds and returns an UpdateInfo object. |
| `https://developer.android.com/reference/kotlin/androidx/security/state/UpdateInfo.Builder` | `https://developer.android.com/reference/kotlin/androidx/security/state/UpdateInfo.Builder#setComponent(kotlin.String)(component: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Sets the component associated with the update. |
| `https://developer.android.com/reference/kotlin/androidx/security/state/UpdateInfo.Builder` | `https://developer.android.com/reference/kotlin/androidx/security/state/UpdateInfo.Builder#setLastCheckTimeMillis(kotlin.Long)(lastCheckTimeMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets the timestamp when this update was checked or discovered. |
| `https://developer.android.com/reference/kotlin/androidx/security/state/UpdateInfo.Builder` | `https://developer.android.com/reference/kotlin/androidx/security/state/UpdateInfo.Builder#setPublishedDateMillis(kotlin.Long)(publishedDateMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets the publication date of the update. |
| `https://developer.android.com/reference/kotlin/androidx/security/state/UpdateInfo.Builder` | `https://developer.android.com/reference/kotlin/androidx/security/state/UpdateInfo.Builder#setSecurityPatchLevel(androidx.security.state.SecurityPatchState.SecurityPatchLevel)( securityPatchLevel: https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.SecurityPatchLevel )` Sets the security patch level of the update. |

## Public constructors

### Builder

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/security#1.1.0)

```
Builder()
```

## Public functions

### build

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/security#1.1.0)

```
fun build(): UpdateInfo
```

Builds and returns an UpdateInfo object.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/security/state/UpdateInfo` | The constructed UpdateInfo. |

### setComponent

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/security#1.1.0)

```
fun setComponent(component: String): UpdateInfo.Builder
```

Sets the component associated with the update.

| Parameters |
|---|---|
| `component: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The component to set. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/security/state/UpdateInfo.Builder` | The builder instance for chaining. |

### setLastCheckTimeMillis

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/security#1.1.0)

```
fun setLastCheckTimeMillis(lastCheckTimeMillis: Long): UpdateInfo.Builder
```

Sets the timestamp when this update was checked or discovered.

| Parameters |
|---|---|
| `lastCheckTimeMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The timestamp in milliseconds since the epoch. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/security/state/UpdateInfo.Builder` | The builder instance for chaining. |

### setPublishedDateMillis

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/security#1.1.0)

```
fun setPublishedDateMillis(publishedDateMillis: Long): UpdateInfo.Builder
```

Sets the publication date of the update.

| Parameters |
|---|---|
| `publishedDateMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The timestamp in milliseconds since the epoch. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/security/state/UpdateInfo.Builder` | The builder instance for chaining. |

### setSecurityPatchLevel

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/security#1.1.0)

```
fun setSecurityPatchLevel(
    securityPatchLevel: SecurityPatchState.SecurityPatchLevel
): UpdateInfo.Builder
```

Sets the security patch level of the update.

| Parameters |
|---|---|
| `securityPatchLevel: https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.SecurityPatchLevel` | The `https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.SecurityPatchLevel` to set. Depending on the component, this should be a concrete subclass such as `https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel` (for SYSTEM and VENDOR) or `https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.VersionedSecurityPatchLevel` (for KERNEL). |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/security/state/UpdateInfo.Builder` | The builder instance for chaining. |