Added in API level 34

Builder


class Builder
kotlin.Any
   ↳ android.content.pm.PackageInstaller.PreapprovalDetails.Builder

A builder for PreapprovalDetails

Summary

Public constructors

Creates a new Builder.

Public methods
PackageInstaller.PreapprovalDetails

Builds the instance.

PackageInstaller.PreapprovalDetails.Builder
setIcon(value: Bitmap)

The icon representing the app to be installed.

PackageInstaller.PreapprovalDetails.Builder

The label representing the app to be installed.

PackageInstaller.PreapprovalDetails.Builder

The locale is used to get the app label from the APKs (includes the base APK and split APKs) related to the package to be installed.

PackageInstaller.PreapprovalDetails.Builder

The package name of the app to be installed.

Public constructors

Builder

Added in API level 34
Builder()

Creates a new Builder.

Public methods

build

Added in API level 34
fun build(): PackageInstaller.PreapprovalDetails

Builds the instance. This builder should not be touched after calling this!

Return
PackageInstaller.PreapprovalDetails This value cannot be null.

setIcon

Added in API level 34
fun setIcon(value: Bitmap): PackageInstaller.PreapprovalDetails.Builder

The icon representing the app to be installed.

Parameters
value Bitmap: This value cannot be null.
Return
PackageInstaller.PreapprovalDetails.Builder This value cannot be null.

setLabel

Added in API level 34
fun setLabel(value: CharSequence): PackageInstaller.PreapprovalDetails.Builder

The label representing the app to be installed.

Parameters
value CharSequence: This value cannot be null.
Return
PackageInstaller.PreapprovalDetails.Builder This value cannot be null.

setLocale

Added in API level 34
fun setLocale(value: ULocale): PackageInstaller.PreapprovalDetails.Builder

The locale is used to get the app label from the APKs (includes the base APK and split APKs) related to the package to be installed. The caller needs to make sure the app label is consistent with the app label of PreapprovalDetails when validating the installation. Otherwise, the pre-approval install session will fail.

Parameters
value ULocale: This value cannot be null.
Return
PackageInstaller.PreapprovalDetails.Builder This value cannot be null.

setPackageName

Added in API level 34
fun setPackageName(value: String): PackageInstaller.PreapprovalDetails.Builder

The package name of the app to be installed.

Parameters
value String: This value cannot be null.
Return
PackageInstaller.PreapprovalDetails.Builder This value cannot be null.