PackageInstaller.Session Class

Definition

An installation that is being actively staged.

[Android.Runtime.Register("android/content/pm/PackageInstaller$Session", DoNotGenerateAcw=true)]
public class PackageInstaller.Session : Java.Lang.Object, IDisposable, Java.Interop.IJavaPeerable, Java.IO.ICloseable
[<Android.Runtime.Register("android/content/pm/PackageInstaller$Session", DoNotGenerateAcw=true)>]
type PackageInstaller.Session = class
    inherit Object
    interface ICloseable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Inheritance
PackageInstaller.Session
Attributes
Implements

Remarks

An installation that is being actively staged. For an install to succeed, all existing and new packages must have identical package names, version codes, and signing certificates.

A session may contain any number of split packages. If the application does not yet exist, this session must include a base package.

If an APK included in this session is already defined by the existing installation (for example, the same split name), the APK in this session will replace the existing APK.

In such a case that multiple packages need to be committed simultaneously, multiple sessions can be referenced by a single multi-package session. This session is created with no package name and calling SessionParams#setMultiPackage(). The individual session IDs can be added with #addChildSessionId(int) and commit of the multi-package session will result in all child sessions being committed atomically.

Java documentation for android.content.pm.PackageInstaller.Session.

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.

Constructors

PackageInstaller.Session(IntPtr, JniHandleOwnership)

Properties

AppMetadata

Optionally set the app metadata.

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
IsApplicationEnabledSettingPersistent
IsMultiPackage
IsRequestUpdateOwnership
IsStaged
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
ParentSessionId
PeerReference (Inherited from Object)
ThresholdClass
ThresholdType

Methods

Abandon()

Completely abandon this session, destroying all staged data and rendering it invalid.

AddChildSessionId(Int32)

Adds a session ID to the set of sessions that will be committed atomically when this session is committed.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Close()

Release this session object.

Commit(IntentSender)

Attempt to commit everything staged in this session.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
Fsync(Stream)

Ensure that any outstanding data for given stream has been committed to disk.

GetChildSessionIds()
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetNames()

Return all APK names contained in this session.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
OpenRead(String)

Open a stream to read an APK file from the session.

OpenWrite(String, Int64, Int64)

Open a stream to write an APK file into the session.

RemoveChildSessionId(Int32)

Removes a session ID from the set of sessions that will be committed atomically when this session is committed.

RemoveSplit(String)

Removes a split.

RequestChecksums(String, Int32, IList<Certificate>, IExecutor, PackageManager+IOnChecksumsReadyListener)
RequestUserPreapproval(PackageInstaller+PreapprovalDetails, IntentSender)
SetChecksums(String, IList<Checksum>, Byte[])

Sets installer-provided checksums for the APK file in session.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetStagingProgress(Single)

Set current progress of staging this session.

ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
Transfer(String)

Transfer the session to a new owner.

UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to