class UpdateInfoProvider : ContentProvider


A content provider that serves update information for system components.

This class retrieves UpdateInfo stored in JSON format and serves it via a content URI. It only supports the query operation; insert, delete, and update operations are not permitted.

Typically, OTA or other update clients utilize this provider to expose update information to other applications or components within the system that need access to the latest security updates data. The client calls UpdateInfoManager.registerUpdate and UpdateInfoManager.unregisterUpdate to add or remove update information to a local store, from which the content provider serves the data to the applications.

To setup the content provider add the following snippet to the client's manifest:

<provider
android
:name="androidx.security.state.provider.UpdateInfoProvider"
android:authorities="${applicationId}.updateinfoprovider"
android:exported="true" />

Summary

Public constructors

Public functions

open Int
delete(uri: Uri, selection: String?, selectionArgs: Array<String>?)

Unsupported operation.

open String?
getType(uri: Uri)

Returns the MIME type of the data at the given URI.

open Uri?
insert(uri: Uri, values: ContentValues?)

Unsupported operation.

open Boolean

Initializes the content provider by constructing contentUri using the authority listed in the manifest.

open Cursor
query(
    uri: Uri,
    projection: Array<String>?,
    selection: String?,
    selectionArgs: Array<String>?,
    sortOrder: String?
)

Handles queries for the update information.

open Int
update(
    uri: Uri,
    values: ContentValues?,
    selection: String?,
    selectionArgs: Array<String>?
)

Unsupported operation.

Inherited functions

From android.content.ContentProvider
open Array<ContentProviderResult>
open Array<ContentProviderResult>
open Unit
open Int
open Bundle?
call(p0: String, p1: String?, p2: Bundle?)
open Bundle?
call(p0: String, p1: String, p2: String?, p3: Bundle?)
open Uri?
ContentProvider.CallingIdentity
open Int
delete(p0: Uri, p1: Bundle?)
open Unit
AttributionSource?
String?
String?
String?
Array<PathPermission>?
String?
open Array<String>?
open String?
String?
open Uri?
insert(p0: Uri, p1: ContentValues?, p2: Bundle?)
open Boolean
open Unit
open Unit
open Unit

This function is deprecated.

open Unit
open AssetFileDescriptor?
openAssetFile(p0: Uri, p1: String)
open AssetFileDescriptor?
open ParcelFileDescriptor?
openFile(p0: Uri, p1: String)
open ParcelFileDescriptor?
openFile(p0: Uri, p1: String, p2: CancellationSignal?)
ParcelFileDescriptor
open ParcelFileDescriptor
<T : Any> openPipeHelper(
    p0: Uri,
    p1: String,
    p2: Bundle?,
    p3: T?,
    p4: ContentProvider.PipeDataWriter<T>
)
open AssetFileDescriptor?
openTypedAssetFile(p0: Uri, p1: String, p2: Bundle?)
open AssetFileDescriptor?
open Cursor?
query(p0: Uri, p1: Array<String>?, p2: Bundle?, p3: CancellationSignal?)
open Cursor?
query(
    p0: Uri,
    p1: Array<String>?,
    p2: String?,
    p3: Array<String>?,
    p4: String?,
    p5: CancellationSignal?
)
open Boolean
refresh(p0: Uri, p1: Bundle?, p2: CancellationSignal?)
Context
Unit
Unit
Unit
Unit
open Unit
open Uri?
open Int
update(p0: Uri, p1: ContentValues?, p2: Bundle?)

Public constructors

UpdateInfoProvider

Added in 1.0.0-alpha01
UpdateInfoProvider()

Public functions

delete

Added in 1.0.0-alpha01
open fun delete(uri: Uri, selection: String?, selectionArgs: Array<String>?): Int

Unsupported operation. This method will throw an exception if called.

Parameters
uri: Uri

The URI to delete from.

selection: String?

The selection criteria to apply.

selectionArgs: Array<String>?

Arguments for the selection criteria.

Returns
Int

nothing as this operation is not supported.

Throws
kotlin.UnsupportedOperationException

always as this operation is not supported.

getType

Added in 1.0.0-alpha01
open fun getType(uri: Uri): String?

Returns the MIME type of the data at the given URI. This method only handles the content URI for update data.

Parameters
uri: Uri

The URI to query for its MIME type.

Returns
String?

The MIME type of the data at the specified URI, or null if the URI is not handled by this provider.

insert

Added in 1.0.0-alpha01
open fun insert(uri: Uri, values: ContentValues?): Uri?

Unsupported operation. This method will throw an exception if called.

Parameters
uri: Uri

The URI to query.

values: ContentValues?

The new values to insert.

Returns
Uri?

nothing as this operation is not supported.

Throws
kotlin.UnsupportedOperationException

always as this operation is not supported.

onCreate

Added in 1.0.0-alpha01
open fun onCreate(): Boolean

Initializes the content provider by constructing contentUri using the authority listed in the manifest.

Returns
Boolean

true if the provider was successfully created, false otherwise.

query

Added in 1.0.0-alpha01
open fun query(
    uri: Uri,
    projection: Array<String>?,
    selection: String?,
    selectionArgs: Array<String>?,
    sortOrder: String?
): Cursor

Handles queries for the update information.

This method only responds to queries directed at the specific content URI corresponding to update data. It returns a Cursor containing UpdateInfo represented in JSON format.

Parameters
uri: Uri

The URI to query. This must match the expected content URI for update data.

projection: Array<String>?

The list of columns to put into the cursor. If null, all columns are included.

selection: String?

The selection criteria to apply.

selectionArgs: Array<String>?

Arguments for the selection criteria.

sortOrder: String?

The order in which rows are sorted in the returned Cursor.

Returns
Cursor

A Cursor object containing the update data.

Throws
kotlin.IllegalArgumentException

if the provided URI does not match the expected URI for update data.

update

Added in 1.0.0-alpha01
open fun update(
    uri: Uri,
    values: ContentValues?,
    selection: String?,
    selectionArgs: Array<String>?
): Int

Unsupported operation. This method will throw an exception if called.

Parameters
uri: Uri

The URI to update.

values: ContentValues?

The new values to apply.

selection: String?

The selection criteria to apply.

selectionArgs: Array<String>?

Arguments for the selection criteria.

Returns
Int

nothing as this operation is not supported.

Throws
kotlin.UnsupportedOperationException

always as this operation is not supported.