语言

PackageInstaller.WaitForInstallConstraints 方法

定义

类似于 checkInstallConstraints(List,InstallConstraints,Executor,Consumer),但仅当满足约束或在超时后调用回调。

[Android.Runtime.Register("waitForInstallConstraints", "(Ljava/util/List;Landroid/content/pm/PackageInstaller$InstallConstraints;Landroid/content/IntentSender;J)V", "GetWaitForInstallConstraints_Ljava_util_List_Landroid_content_pm_PackageInstaller_InstallConstraints_Landroid_content_IntentSender_JHandler", ApiSince=34)]
public virtual void WaitForInstallConstraints(System.Collections.Generic.IList<string> packageNames, Android.Content.PM.PackageInstaller.InstallConstraints constraints, Android.Content.IntentSender callback, long timeoutMillis);
[<Android.Runtime.Register("waitForInstallConstraints", "(Ljava/util/List;Landroid/content/pm/PackageInstaller$InstallConstraints;Landroid/content/IntentSender;J)V", "GetWaitForInstallConstraints_Ljava_util_List_Landroid_content_pm_PackageInstaller_InstallConstraints_Landroid_content_IntentSender_JHandler", ApiSince=34)>]
abstract member WaitForInstallConstraints : System.Collections.Generic.IList<string> * Android.Content.PM.PackageInstaller.InstallConstraints * Android.Content.IntentSender * int64 -> unit
override this.WaitForInstallConstraints : System.Collections.Generic.IList<string> * Android.Content.PM.PackageInstaller.InstallConstraints * Android.Content.IntentSender * int64 -> unit

参数

packageNames
IList<String>

用于检查安装约束的包名称列表。 此值不能为 null。

constraints
PackageInstaller.InstallConstraints

安装的约束。 此值不能为 null。

callback
IntentSender

满足约束或超时后调用。 发送到此回调的意向包含:输入包名称Intent.EXTRA_PACKAGES,输入约束EXTRA_INSTALL_CONSTRAINTS,结果EXTRA_INSTALL_CONSTRAINTS_RESULT。 此值不能为 null。

timeoutMillis
Int64

等待的最长时间,以毫秒为单位,直到满足约束。 有效范围为 0 到一周。 0 表示无论满足约束,都将立即调用回调。 值为非负持续时间(以毫秒为单位)。

特性

注解

类似于 checkInstallConstraints(List,InstallConstraints,Executor,Consumer),但仅当满足约束或在超时后调用回调。 注意:设备空闲约束可能需要很长时间才能评估。 系统将确保在处理超时之前完全评估约束。

Android 参考。android.content.pm.PackageInstaller.waitForInstallConstraints

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于