# UpdateInfo

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) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/security#1.1.0)

*** ** * ** ***


```
public final class UpdateInfo implements Parcelable
```

<br />

*** ** * ** ***

Represents information about an available update for a component.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/security/state/UpdateInfo.Builder` Builder class for creating an instance of UpdateInfo. |

| ### Public fields |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Parcelable.Creator.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/security/state/UpdateInfo>` | `https://developer.android.com/reference/androidx/security/state/UpdateInfo#CREATOR()` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/security/state/UpdateInfo#UpdateInfo(kotlin.String,androidx.security.state.SecurityPatchState.SecurityPatchLevel,kotlin.Long,kotlin.Long)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html component, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/security/state/SecurityPatchState.SecurityPatchLevel securityPatchLevel, long publishedDateMillis, long lastCheckTimeMillis )` |

| ### Public methods |
|---|---|
| `int` | `https://developer.android.com/reference/androidx/security/state/UpdateInfo#describeContents()()` |
| `boolean` | `https://developer.android.com/reference/androidx/security/state/UpdateInfo#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` Compares this UpdateInfo with another object for equality. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `@https://developer.android.com/reference/androidx/security/state/SecurityPatchState.Component https://developer.android.com/reference/androidx/security/state/UpdateInfo#getComponent()()` Component for which the update information is provided. |
| `final long` | `https://developer.android.com/reference/androidx/security/state/UpdateInfo#getLastCheckTimeMillis()()` The timestamp when this specific update was checked or discovered, in milliseconds since the epoch. |
| `final long` | `https://developer.android.com/reference/androidx/security/state/UpdateInfo#getPublishedDateMillis()()` Timestamp when the available update was published, in milliseconds since the epoch. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/security/state/SecurityPatchState.SecurityPatchLevel` | `https://developer.android.com/reference/androidx/security/state/UpdateInfo#getSecurityPatchLevel()()` Security patch level of the available update ready to be applied by the reporting client. |
| `int` | `https://developer.android.com/reference/androidx/security/state/UpdateInfo#hashCode()()` Provides a hash code for an UpdateInfo object. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/security/state/UpdateInfo#toString()()` Returns a string representation of the update information. |
| `void` | `https://developer.android.com/reference/androidx/security/state/UpdateInfo#writeToParcel(android.os.Parcel,kotlin.Int)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Parcel.html parcel, int flags)` |

## Public fields

### CREATOR

```
public static final @NonNull Parcelable.Creator<@NonNull UpdateInfo> CREATOR
```

## Public constructors

### UpdateInfo

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

```
public UpdateInfo(
    @NonNull String component,
    @NonNull SecurityPatchState.SecurityPatchLevel securityPatchLevel,
    long publishedDateMillis,
    long lastCheckTimeMillis
)
```

## Public methods

### describeContents

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

```
public int describeContents()
```

### equals

```
public boolean equals(Object other)
```

Compares this UpdateInfo with another object for equality.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/Object.html other` | The object to compare with this instance. |

| Returns |
|---|---|
| `boolean` | true if the other object is an instance of UpdateInfo and all properties match, false otherwise. |

### getComponent

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

```
@SecurityPatchState.Component
public final @NonNull String getComponent()
```

Component for which the update information is provided.

The value should be one of the constants allowed by `https://developer.android.com/reference/androidx/security/state/SecurityPatchState.Component`, such as `https://developer.android.com/reference/androidx/security/state/SecurityPatchState#COMPONENT_SYSTEM()`.

Value is one of the following:

- `SYSTEM`
- `SYSTEM_MODULES`
- `KERNEL`
- `VENDOR`

<br />

### getLastCheckTimeMillis

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

```
public final long getLastCheckTimeMillis()
```

The timestamp when this specific update was checked or discovered, in milliseconds since the epoch.

This timestamp allows the system to track the freshness of individual update records, which is useful when different components are checked on different schedules.

### getPublishedDateMillis

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

```
public final long getPublishedDateMillis()
```

Timestamp when the available update was published, in milliseconds since the epoch.

### getSecurityPatchLevel

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

```
public final @NonNull SecurityPatchState.SecurityPatchLevel getSecurityPatchLevel()
```

Security patch level of the available update ready to be applied by the reporting client.

This is represented as a `https://developer.android.com/reference/androidx/security/state/SecurityPatchState.SecurityPatchLevel` object (e.g., `https://developer.android.com/reference/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel` or `https://developer.android.com/reference/androidx/security/state/SecurityPatchState.VersionedSecurityPatchLevel`) appropriate for the component.

### hashCode

```
public int hashCode()
```

Provides a hash code for an UpdateInfo object.

| Returns |
|---|---|
| `int` | A hash code produced by the properties of the update info. |

### toString

```
public @NonNull String toString()
```

Returns a string representation of the update information.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | A string that describes the update details. |

### writeToParcel

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

```
public void writeToParcel(@NonNull Parcel parcel, int flags)
```