Class Overview
Events for observing session lifecycle.
A typical session lifecycle looks like this:
- An installer creates a session to indicate pending app delivery. All
install details are available at this point.
- The installer opens the session to deliver APK data. Note that a
session may be opened and closed multiple times as network connectivity
changes. The installer may deliver periodic progress updates.
- The installer commits or abandons the session, resulting in the
session being finished.
Summary
Public Methods |
abstract
void
|
onActiveChanged(int sessionId, boolean active)
Active state for session has been changed.
|
abstract
void
|
onBadgingChanged(int sessionId)
Badging details for an existing session has changed.
|
abstract
void
|
onCreated(int sessionId)
New session has been created.
|
abstract
void
|
onFinished(int sessionId, boolean success)
Session has completely finished, either with success or failure.
|
abstract
void
|
onProgressChanged(int sessionId, float progress)
Progress for given session has been updated.
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
|
Public Constructors
public
PackageInstaller.SessionCallback
()
Public Methods
public
abstract
void
onActiveChanged
(int sessionId, boolean active)
Active state for session has been changed.
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
abstract
void
onBadgingChanged
(int sessionId)
Badging details for an existing session has changed. For example, the
app icon or label has been updated.
public
abstract
void
onCreated
(int sessionId)
New session has been created. Details about the session can be
obtained from getSessionInfo(int)
.
public
abstract
void
onFinished
(int sessionId, boolean success)
Session has completely finished, either with success or failure.
public
abstract
void
onProgressChanged
(int sessionId, float progress)
Progress for given session has been updated.
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.