PackageInstaller.PreapprovalDetails.Builder


public static final class PackageInstaller.PreapprovalDetails.Builder
extends Object

java.lang.Object
   ↳ android.content.pm.PackageInstaller.PreapprovalDetails.Builder


A builder for PreapprovalDetails

Summary

Public constructors

Builder()

Creates a new Builder.

Public methods

PackageInstaller.PreapprovalDetails build()

Builds the instance.

PackageInstaller.PreapprovalDetails.Builder setIcon(Bitmap value)

The icon representing the app to be installed.

PackageInstaller.PreapprovalDetails.Builder setLabel(CharSequence value)

The label representing the app to be installed.

PackageInstaller.PreapprovalDetails.Builder setLocale(ULocale value)

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 setPackageName(String value)

The package name of the app to be installed.

Inherited methods

Public constructors

Builder

Added in API level 34
public Builder ()

Creates a new Builder.

Public methods

build

Added in API level 34
public PackageInstaller.PreapprovalDetails build ()

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

Returns
PackageInstaller.PreapprovalDetails This value cannot be null.

setIcon

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

The icon representing the app to be installed.

Parameters
value Bitmap: This value cannot be null.

Returns
PackageInstaller.PreapprovalDetails.Builder This value cannot be null.

setLabel

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

The label representing the app to be installed.

Parameters
value CharSequence: This value cannot be null.

Returns
PackageInstaller.PreapprovalDetails.Builder This value cannot be null.

setLocale

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

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.

Returns
PackageInstaller.PreapprovalDetails.Builder This value cannot be null.

setPackageName

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

The package name of the app to be installed.

Parameters
value String: This value cannot be null.

Returns
PackageInstaller.PreapprovalDetails.Builder This value cannot be null.