Language

PackageInstaller.CommitSessionAfterInstallConstraintsAreMet Method

Definition

Commit the session when all constraints are satisfied.

[Android.Runtime.Register("commitSessionAfterInstallConstraintsAreMet", "(ILandroid/content/IntentSender;Landroid/content/pm/PackageInstaller$InstallConstraints;J)V", "GetCommitSessionAfterInstallConstraintsAreMet_ILandroid_content_IntentSender_Landroid_content_pm_PackageInstaller_InstallConstraints_JHandler", ApiSince=34)]
public virtual void CommitSessionAfterInstallConstraintsAreMet(int sessionId, Android.Content.IntentSender statusReceiver, Android.Content.PM.PackageInstaller.InstallConstraints constraints, long timeoutMillis);
[<Android.Runtime.Register("commitSessionAfterInstallConstraintsAreMet", "(ILandroid/content/IntentSender;Landroid/content/pm/PackageInstaller$InstallConstraints;J)V", "GetCommitSessionAfterInstallConstraintsAreMet_ILandroid_content_IntentSender_Landroid_content_pm_PackageInstaller_InstallConstraints_JHandler", ApiSince=34)>]
abstract member CommitSessionAfterInstallConstraintsAreMet : int * Android.Content.IntentSender * Android.Content.PM.PackageInstaller.InstallConstraints * int64 -> unit
override this.CommitSessionAfterInstallConstraintsAreMet : int * Android.Content.IntentSender * Android.Content.PM.PackageInstaller.InstallConstraints * int64 -> unit

Parameters

sessionId
Int32

the session ID to commit when all constraints are satisfied.

statusReceiver
IntentSender

Called when the state of the session changes. Intents sent to this receiver contain EXTRA_STATUS. Refer to the individual status codes on how to handle them. This value cannot be null.

constraints
PackageInstaller.InstallConstraints

The requirements to satisfy before committing the session. This value cannot be null.

timeoutMillis
Int64

The maximum time to wait, in milliseconds until the constraints are satisfied. The caller will be notified via statusReceiver if timeout happens before commit. Value is a non-negative duration in milliseconds.

Attributes

Remarks

Commit the session when all constraints are satisfied. This is a convenient method to combine waitForInstallConstraints(List,InstallConstraints,IntentSender,long) and Session.commit(IntentSender). Once this method is called, the session is sealed and no additional mutations may be performed on the session. In the case of timeout, you may commit the session again using this method or Session.commit(IntentSender) for retries.

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

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