Android APIs
public static class

PackageInstaller.SessionInfo

extends Object
implements Parcelable
java.lang.Object
   ↳ android.content.pm.PackageInstaller.SessionInfo

Class Overview

Details for an active install session.

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<PackageInstaller.SessionInfo> CREATOR
Public Methods
Intent createDetailsIntent()
Return an Intent that can be started to view details about this install session.
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
Bitmap getAppIcon()
Return an icon representing the app being installed.
CharSequence getAppLabel()
Return a label representing the app being installed.
String getAppPackageName()
Return the package name this session is working with.
String getInstallerPackageName()
Return the package name of the app that owns this session.
float getProgress()
Return current overall progress of this session, between 0 and 1.
int getSessionId()
Return the ID for this session.
boolean isActive()
Return if this session is currently active.
void writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<PackageInstaller.SessionInfo> CREATOR

Added in API level 21

Public Methods

public Intent createDetailsIntent ()

Added in API level 21

Return an Intent that can be started to view details about this install session. This may surface actions such as pause, resume, or cancel.

In some cases, a matching Activity may not exist, so ensure you safeguard against this.

public int describeContents ()

Added in API level 21

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Returns
  • a bitmask indicating the set of special object types marshalled by the Parcelable.

public Bitmap getAppIcon ()

Added in API level 21

Return an icon representing the app being installed. May be null if unavailable.

public CharSequence getAppLabel ()

Added in API level 21

Return a label representing the app being installed. May be null if unavailable.

public String getAppPackageName ()

Added in API level 21

Return the package name this session is working with. May be null if unknown.

public String getInstallerPackageName ()

Added in API level 21

Return the package name of the app that owns this session.

public float getProgress ()

Added in API level 21

Return current overall progress of this session, between 0 and 1.

Note that this progress may not directly correspond to the value reported by setStagingProgress(float), as the system may carve out a portion of the overall progress to represent its own internal installation work.

public int getSessionId ()

Added in API level 21

Return the ID for this session.

public boolean isActive ()

Added in API level 21

Return if this session is currently active.

A session is considered active whenever there is ongoing forward progress being made, such as the installer holding an open PackageInstaller.Session instance while streaming data into place, or the system optimizing code as the result of commit(IntentSender).

If the installer closes the PackageInstaller.Session without committing, the session is considered inactive until the installer opens the session again.

public void writeToParcel (Parcel dest, int flags)

Added in API level 21

Flatten this object in to a Parcel.

Parameters
dest The Parcel in which the object should be written.
flags Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.