public final class UpdateInfo implements Parcelable


Represents information about an available update for a component.

Summary

Nested types

public final class UpdateInfo.Builder

Builder class for creating an instance of UpdateInfo.

Public fields

static final @NonNull Parcelable.Creator<@NonNull UpdateInfo>

Public constructors

UpdateInfo(
    @NonNull String component,
    @NonNull String securityPatchLevel,
    long publishedDateMillis,
    long lastCheckTimeMillis
)

Public methods

int
boolean
equals(Object other)

Compares this UpdateInfo with another object for equality.

final @NonNull String

Component for which the update information is provided.

final long

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

final long

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

final @NonNull String

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

int

Provides a hash code for an UpdateInfo object.

@NonNull String

Returns a string representation of the update information.

void
writeToParcel(@NonNull Parcel parcel, int flags)

Public fields

CREATOR

public static final @NonNull Parcelable.Creator<@NonNull UpdateInfoCREATOR

Public constructors

UpdateInfo

Added in 1.1.0-alpha01
public UpdateInfo(
    @NonNull String component,
    @NonNull String securityPatchLevel,
    long publishedDateMillis,
    long lastCheckTimeMillis
)

Public methods

describeContents

Added in 1.1.0-alpha01
public int describeContents()

equals

public boolean equals(Object other)

Compares this UpdateInfo with another object for equality.

Parameters
Object 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-alpha01
@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 SecurityPatchState.Component, such as SecurityPatchState.COMPONENT_SYSTEM.

getLastCheckTimeMillis

Added in 1.1.0-alpha01
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-alpha01
public final long getPublishedDateMillis()

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

getSecurityPatchLevel

Added in 1.1.0-alpha01
public final @NonNull String getSecurityPatchLevel()

Security patch level of the available update ready to be applied by the reporting client. Use SecurityPatchState.getComponentSecurityPatchLevel method to get encapsulated value.

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
@NonNull String

A string that describes the update details.

writeToParcel

Added in 1.1.0-alpha01
public void writeToParcel(@NonNull Parcel parcel, int flags)