PackageInfoBuilder
public final class PackageInfoBuilder
Builder for PackageInfo.
Summary
Public methods |
|
|---|---|
PackageInfoBuilder |
addRequestedPermission(Adds a requested permission and its flag for the app. |
PackageInfo |
build()Returns a |
static PackageInfoBuilder |
Start building a new |
PackageInfoBuilder |
setApplicationInfo(ApplicationInfo applicationInfo)Sets the application info. |
PackageInfoBuilder |
setPackageName(String packageName)Sets the package name. |
PackageInfoBuilder |
@TargetApi(value = Build.VERSION_CODES.P)Sets the version code. |
PackageInfoBuilder |
setVersionName(String versionName)Sets the version name. |
Public methods
addRequestedPermission
public PackageInfoBuilder addRequestedPermission(
String requestedPermission,
int requestedPermissionFlag
)
Adds a requested permission and its flag for the app.
This can be called several times to add multiple permissions.
newBuilder
public static PackageInfoBuilder newBuilder()
Start building a new PackageInfo.
| Returns | |
|---|---|
PackageInfoBuilder |
a new instance of |
setApplicationInfo
public PackageInfoBuilder setApplicationInfo(ApplicationInfo applicationInfo)
Sets the application info.
Default is null
| See also | |
|---|---|
applicationInfo |
setPackageName
public PackageInfoBuilder setPackageName(String packageName)
Sets the package name.
Default is null.
| See also | |
|---|---|
packageName |
setVersionCode
@TargetApi(value = Build.VERSION_CODES.P)
public PackageInfoBuilder setVersionCode(long longVersionCode)
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.
| See also | |
|---|---|
setLongVersionCode |
|
versionCode |
setVersionName
public PackageInfoBuilder setVersionName(String versionName)
Sets the version name.
Default is null.
| See also | |
|---|---|
versionName |