PackageInfoBuilder


class PackageInfoBuilder


Builder for PackageInfo.

Summary

Public functions

PackageInfoBuilder!
addRequestedPermission(
    requestedPermission: String!,
    requestedPermissionFlag: Int
)

Adds a requested permission and its flag for the app.

PackageInfo!

Returns a PackageInfo with the provided data.

java-static PackageInfoBuilder!

Start building a new PackageInfo.

PackageInfoBuilder!

Sets the application info.

PackageInfoBuilder!
setPackageName(packageName: String!)

Sets the package name.

PackageInfoBuilder!
@TargetApi(value = Build.VERSION_CODES.P)
setVersionCode(longVersionCode: Long)

Sets the version code.

PackageInfoBuilder!
setVersionName(versionName: String!)

Sets the version name.

Public functions

addRequestedPermission

fun addRequestedPermission(
    requestedPermission: String!,
    requestedPermissionFlag: Int
): PackageInfoBuilder!

Adds a requested permission and its flag for the app.

This can be called several times to add multiple permissions.

build

fun build(): PackageInfo!

Returns a PackageInfo with the provided data.

newBuilder

java-static fun newBuilder(): PackageInfoBuilder!

Start building a new PackageInfo.

Returns
PackageInfoBuilder!

a new instance of PackageInfoBuilder.

setApplicationInfo

fun setApplicationInfo(applicationInfo: ApplicationInfo!): PackageInfoBuilder!

Sets the application info.

Default is null

See also
applicationInfo

setPackageName

fun setPackageName(packageName: String!): PackageInfoBuilder!

Sets the package name.

Default is null.

See also
packageName

setVersionCode

@TargetApi(value = Build.VERSION_CODES.P)
fun setVersionCode(longVersionCode: Long): PackageInfoBuilder!

Sets the version code.

On SDK P+, this value will be returned for both getLongVersionCode and versionCode. Note that the value of versionCode will be truncated if a value larger than Integer.MAX_VALUE is provided.

Default is 0L.

setVersionName

fun setVersionName(versionName: String!): PackageInfoBuilder!

Sets the version name.

Default is null.

See also
versionName