Language

PackageInstaller.CheckInstallConstraints Method

Definition

Check if install constraints are satisfied for the given packages.

[Android.Runtime.Register("checkInstallConstraints", "(Ljava/util/List;Landroid/content/pm/PackageInstaller$InstallConstraints;Ljava/util/concurrent/Executor;Ljava/util/function/Consumer;)V", "GetCheckInstallConstraints_Ljava_util_List_Landroid_content_pm_PackageInstaller_InstallConstraints_Ljava_util_concurrent_Executor_Ljava_util_function_Consumer_Handler", ApiSince=34)]
public virtual void CheckInstallConstraints(System.Collections.Generic.IList<string> packageNames, Android.Content.PM.PackageInstaller.InstallConstraints constraints, Java.Util.Concurrent.IExecutor executor, Java.Util.Functions.IConsumer callback);
[<Android.Runtime.Register("checkInstallConstraints", "(Ljava/util/List;Landroid/content/pm/PackageInstaller$InstallConstraints;Ljava/util/concurrent/Executor;Ljava/util/function/Consumer;)V", "GetCheckInstallConstraints_Ljava_util_List_Landroid_content_pm_PackageInstaller_InstallConstraints_Ljava_util_concurrent_Executor_Ljava_util_function_Consumer_Handler", ApiSince=34)>]
abstract member CheckInstallConstraints : System.Collections.Generic.IList<string> * Android.Content.PM.PackageInstaller.InstallConstraints * Java.Util.Concurrent.IExecutor * Java.Util.Functions.IConsumer -> unit
override this.CheckInstallConstraints : System.Collections.Generic.IList<string> * Android.Content.PM.PackageInstaller.InstallConstraints * Java.Util.Concurrent.IExecutor * Java.Util.Functions.IConsumer -> unit

Parameters

packageNames
IList<String>

a list of package names to check the constraints for installation. This value cannot be null.

constraints
PackageInstaller.InstallConstraints

the constraints for installation. This value cannot be null.

executor
IExecutor

the Executor on which to invoke the callback. This value cannot be null. Callback and listener events are dispatched through this Executor, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor(). Otherwise, provide an Executor that dispatches to an appropriate thread.

callback
IConsumer

called when the InstallConstraintsResult is ready. This value cannot be null.

Attributes

Remarks

Check if install constraints are satisfied for the given packages. Note this query result is just a hint and subject to race because system states could change anytime in-between this query and committing the session. The result is returned by a callback because some constraints might take a long time to evaluate.

Android reference for android.content.pm.PackageInstaller.checkInstallConstraints.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to