Builder
class Builder
| kotlin.Any | |
| ↳ | android.content.pm.PackageInstaller.InstallConstraints.Builder |
Builder class for constructing InstallConstraints.
Summary
| Public constructors | |
|---|---|
Builder() |
|
| Public methods | |
|---|---|
| PackageInstaller.InstallConstraints |
build()Builds a new |
| PackageInstaller.InstallConstraints.Builder |
This constraint requires the app in question is not in the foreground. |
| PackageInstaller.InstallConstraints.Builder |
This constraint requires the app in question is not interacting with the user. |
| PackageInstaller.InstallConstraints.Builder |
This constraint requires the app in question is not top-visible to the user. |
| PackageInstaller.InstallConstraints.Builder |
This constraint requires the device is idle. |
| PackageInstaller.InstallConstraints.Builder |
This constraint requires there is no ongoing call in the device. |
Public constructors
Builder
Builder()
Public methods
build
fun build(): PackageInstaller.InstallConstraints
Builds a new InstallConstraints instance.
| Return | |
|---|---|
PackageInstaller.InstallConstraints |
This value cannot be null. |
setAppNotForegroundRequired
fun setAppNotForegroundRequired(): PackageInstaller.InstallConstraints.Builder
This constraint requires the app in question is not in the foreground.
| Return | |
|---|---|
PackageInstaller.InstallConstraints.Builder |
This value cannot be null. |
setAppNotInteractingRequired
fun setAppNotInteractingRequired(): PackageInstaller.InstallConstraints.Builder
This constraint requires the app in question is not interacting with the user. User interaction includes:
- playing or recording audio/video
- sending or receiving network data
- being visible to the user
| Return | |
|---|---|
PackageInstaller.InstallConstraints.Builder |
This value cannot be null. |
setAppNotTopVisibleRequired
fun setAppNotTopVisibleRequired(): PackageInstaller.InstallConstraints.Builder
This constraint requires the app in question is not top-visible to the user. A top-visible app is showing UI at the top of the screen that the user is interacting with. Note this constraint is a subset of setAppNotForegroundRequired() because a top-visible app is also a foreground app. This is also a subset of setAppNotInteractingRequired() because a top-visible app is interacting with the user.
| Return | |
|---|---|
PackageInstaller.InstallConstraints.Builder |
This value cannot be null. |
setDeviceIdleRequired
fun setDeviceIdleRequired(): PackageInstaller.InstallConstraints.Builder
This constraint requires the device is idle.
| Return | |
|---|---|
PackageInstaller.InstallConstraints.Builder |
This value cannot be null. |
setNotInCallRequired
fun setNotInCallRequired(): PackageInstaller.InstallConstraints.Builder
This constraint requires there is no ongoing call in the device.
| Return | |
|---|---|
PackageInstaller.InstallConstraints.Builder |
This value cannot be null. |