語言

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>

一份套件名稱清單,用來檢查安裝的限制條件。 這個值不可能為零值。

constraints
PackageInstaller.InstallConstraints

安裝的限制條件。 這個值不可能為零值。

callback
IntentSender

當約束條件被滿足或逾時後呼叫。 傳送給此回調的意圖包含:輸入套件名稱的 Intent.EXTRA_PACKAGES,輸入約束的 EXTRA_INSTALL_CONSTRAINTS,EXTRA_INSTALL_CONSTRAINTS_RESULT 結果。 這個值不可能為零值。

timeoutMillis
Int64

等待的最大時間,以毫秒計,直到條件被滿足。 有效範圍是0到一週。 0 表示無論是否滿足約束,回調都會立即被呼叫。 價值是以毫秒為單位的非負持續時間。

屬性

備註

類似於 checkInstallConstraints(List, InstallConstraints, Executor, Consumer),但回調僅在約束條件滿足或逾時後才被呼叫。 注意:裝置閒置約束可能需要很長時間來評估。 系統會確保在處理逾時前,完整評估該限制。

Android 參考資料。android.content.pm.PackageInstaller.waitForInstallConstraints

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於