OemSystemUpdateHandler

public interface OemSystemUpdateHandler


Interface for the OEM's OTA client to implement.

The methods within this interface are called by the Android Management API's on-device component to the OEM's OTA client.

See also com.google.android.managementapi.notification.NotificationReceiverService.getOemSystemUpdateHandler.

Summary

Public methods

abstract @NonNull UpdateControlState

Called by AMAPI to retrieve the current system update control state from the OTA client.

abstract @NonNull ListPendingSystemUpdatesResponse
listPendingSystemUpdates(
    @NonNull ListPendingSystemUpdatesRequest listPendingSystemUpdatesRequest
)

Called by AMAPI to request the current list of pending system updates from the OTA client.

abstract @NonNull NotifySystemUpdatesChangedResponse
onSystemUpdatesChanged(
    @NonNull NotifySystemUpdatesChangedRequest notifySystemUpdatesChangedRequest
)

Called by AMAPI when the instructions for one or more pending system updates have changed.

Public methods

getUpdateControlState

abstract @NonNull UpdateControlState getUpdateControlState(@NonNull GetUpdateControlStateRequest request)

Called by AMAPI to retrieve the current system update control state from the OTA client. The OTA client implementation must return the current system update control state

Returns
@NonNull UpdateControlState

The OTA client's current UpdateControlState.

listPendingSystemUpdates

abstract @NonNull ListPendingSystemUpdatesResponse listPendingSystemUpdates(
    @NonNull ListPendingSystemUpdatesRequest listPendingSystemUpdatesRequest
)

Called by AMAPI to request the current list of pending system updates from the OTA client.

The OTA client should return all pending system updates it is currently aware of. A system update is considered pending if it is in a state where it can potentially be applied (i.e., AVAILABLE, DOWNLOADING, DOWNLOADED, DOWNLOAD_PREVENTED, or APPLY_PREVENTED) and has not yet been successfully applied or aborted. The SystemUpdate objects returned in ListPendingSystemUpdatesResponse.getSystemUpdates must only contain fields owned by the OEM (e.g., id, type, api_level, name, description, state, etc.).

Specifically, fields that are set by AMAPI, such as download_instruction and apply_instruction, are ignored and are not expected to be populated in the response. The returned data corresponds to the SYSTEM_UPDATE_VIEW_BASIC representation.

Parameters
@NonNull ListPendingSystemUpdatesRequest listPendingSystemUpdatesRequest

An empty ListPendingSystemUpdatesRequest.

Returns
@NonNull ListPendingSystemUpdatesResponse

A ListPendingSystemUpdatesResponse containing the list of pending system updates as known by the OTA client.

onSystemUpdatesChanged

abstract @NonNull NotifySystemUpdatesChangedResponse onSystemUpdatesChanged(
    @NonNull NotifySystemUpdatesChangedRequest notifySystemUpdatesChangedRequest
)

Called by AMAPI when the instructions for one or more pending system updates have changed.

The OEM client must process the information contained in the request for the referenced system updates.

Parameters
@NonNull NotifySystemUpdatesChangedRequest notifySystemUpdatesChangedRequest

The NotifySystemUpdatesChangedRequest from AMAPI containing the list of changed system updates.