SystemUpdate.Builder

public abstract class SystemUpdate.Builder


Builder for SystemUpdate.

Summary

Public methods

abstract SystemUpdate
SystemUpdate.Builder

Clears instruction.

SystemUpdate.Builder

Clears systemUpdateState.

abstract SystemUpdate.Builder

Required.

abstract SystemUpdate.Builder

Required.

SystemUpdate.Builder

Output-only.

abstract SystemUpdate.Builder
setName(String value)

Required.

abstract SystemUpdate.Builder

Required.

abstract SystemUpdate.Builder

Required.

abstract SystemUpdate.Builder

The estimated download size of the update package in bytes.

SystemUpdate.Builder

Output-only.

Public methods

build

public abstract SystemUpdate build()

clearInstruction

public SystemUpdate.Builder clearInstruction()

Clears instruction.

clearSystemUpdateState

public SystemUpdate.Builder clearSystemUpdateState()

Clears systemUpdateState.

setApiLevel

public abstract SystemUpdate.Builder setApiLevel(Integer value)

Required. The target Android API level after this update is applied. For example, this would be 35 if the update upgrades the device to Android 15.

setApiLevelChange

public abstract SystemUpdate.Builder setApiLevelChange(SystemUpdate.ApiLevelChange value)

Required. Whether this system update changes the Android API level.

setInstruction

public SystemUpdate.Builder setInstruction(Instruction value)

Output-only. Instructions on how the update should be handled by the device. These instructions are determined and set by the Android Management API based on enterprise policy, not by the OEM. The OTA client receives these instructions that determine how to proceed with the update stages (e.g., download, apply). This field is not updatable by the OTA client.

setName

public abstract SystemUpdate.Builder setName(String value)

Required. The unique identifier for this specific system update. This name is generated and owned by the OEM's OTA client and must not be an empty string.

The name must be stable and unique for the content of the update. This means the same update content must always have the same name. This is crucial to prevent race conditions and ensure idempotency in API calls. Using a content hash (e.g., SHA-256) of the update package or a unique version string is recommended.

This name is used to deduplicate update notifications and track the status of the update. It has a maximum length of 128 characters.

setReceivedTime

public abstract SystemUpdate.Builder setReceivedTime(Instant value)

Required. The timestamp indicating when the device first became aware of this SystemUpdate. This time is used to evaluate policies based on the update's pending duration on the device.

setSecurityPatchLevel

public abstract SystemUpdate.Builder setSecurityPatchLevel(String value)

Required. The security patch level date of this update. The date must be represented as a string in 'YYYY-MM-DD' format. Example: "2025-07-05".

setSizeBytes

public abstract SystemUpdate.Builder setSizeBytes(Long value)

The estimated download size of the update package in bytes.

setSystemUpdateState

public SystemUpdate.Builder setSystemUpdateState(SystemUpdate.SystemUpdateState value)

Output-only. The current state of the system update.