public static class PackageInstaller.SessionInfo extends Object implements Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
boolean |
active |
Bitmap |
appIcon |
CharSequence |
appLabel |
String |
appPackageName |
static Parcelable.Creator<PackageInstaller.SessionInfo> |
CREATOR |
String |
installerPackageName |
int |
mode |
float |
progress |
String |
resolvedBaseCodePath |
boolean |
sealed |
int |
sessionId |
long |
sizeBytes |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
SessionInfo() |
SessionInfo(Parcel source) |
Modifier and Type | Method and Description |
---|---|
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
instance's marshaled 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.
|
Intent |
getDetailsIntent()
Deprecated.
|
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.
|
boolean |
isOpen()
Deprecated.
|
void |
writeToParcel(Parcel dest,
int flags)
Flatten this object in to a Parcel.
|
public int sessionId
public String installerPackageName
public String resolvedBaseCodePath
public float progress
public boolean sealed
public boolean active
public int mode
public long sizeBytes
public String appPackageName
public Bitmap appIcon
public CharSequence appLabel
public static final Parcelable.Creator<PackageInstaller.SessionInfo> CREATOR
public SessionInfo()
public SessionInfo(Parcel source)
public int getSessionId()
public String getInstallerPackageName()
public float getProgress()
Note that this progress may not directly correspond to the value
reported by
PackageInstaller.Session.setStagingProgress(float)
, as the
system may carve out a portion of the overall progress to represent
its own internal installation work.
public boolean isActive()
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
PackageInstaller.Session.commit(IntentSender)
.
If the installer closes the PackageInstaller.Session
without committing, the
session is considered inactive until the installer opens the session
again.
@Deprecated public boolean isOpen()
public String getAppPackageName()
null
if unknown.public Bitmap getAppIcon()
null
if unavailable.public CharSequence getAppLabel()
null
if unavailable.public Intent createDetailsIntent()
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
PackageInstaller.ACTION_SESSION_DETAILS
@Deprecated public Intent getDetailsIntent()
public int describeContents()
Parcelable
Parcelable.writeToParcel(Parcel, int)
,
the return value of this method must include the
Parcelable.CONTENTS_FILE_DESCRIPTOR
bit.describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR
public void writeToParcel(Parcel dest, int flags)
Parcelable
writeToParcel
in interface Parcelable
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.PARCELABLE_WRITE_RETURN_VALUE
.