UpdateCheckResult


class UpdateCheckResult : Parcelable


Container for the result of a security update check from a specific provider.

This class encapsulates the list of available updates along with metadata about the source and freshness of the data. It is returned by the IUpdateInfoService.listAvailableUpdates method.

Summary

Public companion properties

Parcelable.Creator<UpdateCheckResult>

Public constructors

UpdateCheckResult(
    providerPackageName: String,
    updates: List<UpdateInfo>,
    lastCheckTimeMillis: Long,
    componentLastCheckTimesMillis: Map<String, Long>
)

Public functions

open Int
open operator Boolean
equals(other: Any?)
Long

Returns the last successful check time reported for component, in milliseconds since the epoch.

open Int
open String
open Unit
writeToParcel(parcel: Parcel, flags: Int)

Public properties

Map<String, Long>

The last successful check time of each component reported by this provider, in milliseconds since the epoch, keyed by component identifier such as SecurityPatchState.COMPONENT_SYSTEM.

Long

The timestamp of the last successful synchronization with the backend, in milliseconds since the epoch.

String

The package name of the application that provided these update results.

List<UpdateInfo>

The list of UpdateInfo objects representing available updates found during this check.

Public companion properties

Public constructors

UpdateCheckResult

Added in 1.2.0-alpha01
UpdateCheckResult(
    providerPackageName: String,
    updates: List<UpdateInfo>,
    lastCheckTimeMillis: Long,
    componentLastCheckTimesMillis: Map<String, Long> = emptyMap()
)
Parameters
providerPackageName: String

package name of the application that provided these update results

updates: List<UpdateInfo>

available updates found during this check

lastCheckTimeMillis: Long

timestamp of the last successful synchronization with the backend, in milliseconds since the epoch

componentLastCheckTimesMillis: Map<String, Long> = emptyMap()

last successful check time of each component in milliseconds since the epoch, keyed by component identifier; the map is copied, and entries with an empty key or a non-positive time are ignored

Public functions

describeContents

Added in 1.1.0
open fun describeContents(): Int

equals

open operator fun equals(other: Any?): Boolean

getLastCheckTimeMillis

Added in 1.2.0-alpha01
fun getLastCheckTimeMillis(@SecurityPatchState.Component component: String): Long

Returns the last successful check time reported for component, in milliseconds since the epoch.

The result is the later of the entry for component in componentLastCheckTimesMillis and the UpdateInfo.lastCheckTimeMillis of any update for component in updates. It is 0 if this provider reported neither, which means either that component has not been checked or that the provider reports only the provider-wide lastCheckTimeMillis.

Do not use the provider-wide lastCheckTimeMillis in place of a 0 result unless this provider is known to check only component. A provider that checks several components can report a lastCheckTimeMillis that comes from a check of a different component.

Parameters
@SecurityPatchState.Component component: String

component identifier, such as SecurityPatchState.COMPONENT_SYSTEM or SecurityPatchState.COMPONENT_SYSTEM_MODULES

Value is one of the following:

  • SYSTEM
  • SYSTEM_MODULES
  • KERNEL
  • VENDOR

Returns
Long

last check time reported for component in milliseconds since the epoch, or 0 if none was reported

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

writeToParcel

Added in 1.1.0
open fun writeToParcel(parcel: Parcel, flags: Int): Unit

Public properties

componentLastCheckTimesMillis

Added in 1.2.0-alpha01
val componentLastCheckTimesMillis: Map<String, Long>

The last successful check time of each component reported by this provider, in milliseconds since the epoch, keyed by component identifier such as SecurityPatchState.COMPONENT_SYSTEM.

A provider that checks more than one component can report a time for each, so that clients can tell which components were checked when updates is empty. A component has no entry if the provider reported no check time specific to it: either the component has not been checked, or the provider reports only the provider-wide lastCheckTimeMillis. Every value is greater than 0. Use getLastCheckTimeMillis to read the time for a single component.

The map is unmodifiable; attempts to modify it throw UnsupportedOperationException.

lastCheckTimeMillis

Added in 1.1.0
val lastCheckTimeMillis: Long

The timestamp of the last successful synchronization with the backend, in milliseconds since the epoch.

This field is critical for clients to understand the freshness of the result, especially when updates is empty. It allows the UI to display messages like "Last checked: 5 minutes ago" versus "Last checked: Yesterday".

This is a single time for the whole provider. If the provider checks more than one component, it does not show which of them was checked; use getLastCheckTimeMillis to read the check time of one component.

providerPackageName

Added in 1.1.0
val providerPackageName: String

The package name of the application that provided these update results.

This field identifies the authoritative source of the update data (e.g., "com.google.android.gms" for System Updates).

updates

Added in 1.1.0
val updates: List<UpdateInfo>

The list of UpdateInfo objects representing available updates found during this check.