# Print output for @column tags ?>
public
final
class
ApplicationExitInfo
extends Object
implements
Parcelable
java.lang.Object | |
↳ | android.app.ApplicationExitInfo |
Describes the information of an application process's death.
Application process could die for many reasons, for example REASON_LOW_MEMORY
when it was killed by the ystem because it was running low on memory. Reason
of the death can be retrieved via getReason()
. Besides the reason, there are a few other
auxiliary APIs like getStatus()
and getImportance()
to help the caller with
additional diagnostic information.
Constants | |
---|---|
int |
REASON_ANR
Application process was killed due to being unresponsive (ANR). |
int |
REASON_CRASH
Application process died because of an unhandled exception in Java code. |
int |
REASON_CRASH_NATIVE
Application process died because of a native code crash. |
int |
REASON_DEPENDENCY_DIED
Application process was killed because its dependency was going away, for example, a stable content provider connection's client will be killed if the provider is killed. |
int |
REASON_EXCESSIVE_RESOURCE_USAGE
Application process was killed by the system due to excessive resource usage. |
int |
REASON_EXIT_SELF
Application process exit normally by itself, for example,
via |
int |
REASON_INITIALIZATION_FAILURE
Application process was killed because of initialization failure, for example, it took too long to attach to the system during the start, or there was an error during initialization. |
int |
REASON_LOW_MEMORY
Application process was killed by the system low memory killer, meaning the system was under memory pressure at the time of kill. |
int |
REASON_OTHER
Application process was killed by the system for various other reasons which are
not by problems in apps and not actionable by apps, for example, the system just
finished updates; |
int |
REASON_PERMISSION_CHANGE
Application process was killed due to a runtime permission change. |
int |
REASON_SIGNALED
Application process died due to the result of an OS signal; for example,
|
int |
REASON_UNKNOWN
Application process died due to unknown reason. |
int |
REASON_USER_REQUESTED
Application process was killed because of the user request, for example, user clicked the "Force stop" button of the application in the Settings, or removed the application away from Recents. |
int |
REASON_USER_STOPPED
Application process was killed, because the user it is running as on devices with mutlple users, was stopped. |
Inherited constants |
---|
Fields | |
---|---|
public
static
final
Creator<ApplicationExitInfo> |
CREATOR
|
Public methods | |
---|---|
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
boolean
|
equals(Object other)
Indicates whether some other object is "equal to" this one. |
int
|
getDefiningUid()
Return the defining kernel user identifier, maybe different from |
String
|
getDescription()
The human readable description of the process's death, given by the system; could be null. |
int
|
getImportance()
The importance of the process that it used to have before the death. |
int
|
getPackageUid()
Similar to |
int
|
getPid()
The process id of the process that died. |
String
|
getProcessName()
The actual process name it was running with. |
byte[]
|
getProcessStateSummary()
Return the state data set by calling
|
long
|
getPss()
Last proportional set size of the memory that the process had used in kB. |
int
|
getRealUid()
The kernel user identifier of the process, most of the time the system uses this to do access control checks. |
int
|
getReason()
The reason code of the process's death. |
long
|
getRss()
Last resident set size of the memory that the process had used in kB. |
int
|
getStatus()
The exit status argument of exit() if the application calls it, or the signal number if the application is signaled. |
long
|
getTimestamp()
The timestamp of the process's death, in milliseconds since the epoch,
as returned by |
InputStream
|
getTraceInputStream()
Return the InputStream to the traces that was taken by the system
prior to the death of the process; typically it'll be available when
the reason is |
UserHandle
|
getUserHandle()
Return the user id of the record on a multi-user system. |
int
|
hashCode()
Returns a hash code value for the object. |
String
|
toString()
Returns a string representation of the object. |
void
|
writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel. |
Inherited methods | |
---|---|
public static final int REASON_ANR
Application process was killed due to being unresponsive (ANR).
Constant Value: 6 (0x00000006)
public static final int REASON_CRASH
Application process died because of an unhandled exception in Java code.
Constant Value: 4 (0x00000004)
public static final int REASON_CRASH_NATIVE
Application process died because of a native code crash.
Constant Value: 5 (0x00000005)
public static final int REASON_DEPENDENCY_DIED
Application process was killed because its dependency was going away, for example, a stable content provider connection's client will be killed if the provider is killed.
Constant Value: 12 (0x0000000c)
public static final int REASON_EXCESSIVE_RESOURCE_USAGE
Application process was killed by the system due to excessive resource usage.
Constant Value: 9 (0x00000009)
public static final int REASON_EXIT_SELF
Application process exit normally by itself, for example,
via System.exit(int)
; getStatus()
will specify the exit code.
Applications should normally not do this, as the system has a better knowledge in terms of process management.
Constant Value: 1 (0x00000001)
public static final int REASON_INITIALIZATION_FAILURE
Application process was killed because of initialization failure, for example, it took too long to attach to the system during the start, or there was an error during initialization.
Constant Value: 7 (0x00000007)
public static final int REASON_LOW_MEMORY
Application process was killed by the system low memory killer, meaning the system was under memory pressure at the time of kill.
Not all devices support reporting REASON_LOW_MEMORY
; on a device with no such
support, when a process is killed due to memory pressure, the getReason()
will return
REASON_SIGNALED
and getStatus()
will return
the value OsConstants.SIGKILL
.
Application should use ActivityManager.isLowMemoryKillReportSupported()
to check
if the device supports reporting REASON_LOW_MEMORY
or not.
Constant Value: 3 (0x00000003)
public static final int REASON_OTHER
Application process was killed by the system for various other reasons which are
not by problems in apps and not actionable by apps, for example, the system just
finished updates; getDescription()
will specify the cause given by the system.
Constant Value: 13 (0x0000000d)
public static final int REASON_PERMISSION_CHANGE
Application process was killed due to a runtime permission change.
Constant Value: 8 (0x00000008)
public static final int REASON_SIGNALED
Application process died due to the result of an OS signal; for example,
OsConstants.SIGKILL
; getStatus()
will specify the signal
number.
Constant Value: 2 (0x00000002)
public static final int REASON_UNKNOWN
Application process died due to unknown reason.
Constant Value: 0 (0x00000000)
public static final int REASON_USER_REQUESTED
Application process was killed because of the user request, for example, user clicked the "Force stop" button of the application in the Settings, or removed the application away from Recents.
Constant Value: 10 (0x0000000a)
public static final int REASON_USER_STOPPED
Application process was killed, because the user it is running as on devices with mutlple users, was stopped.
Constant Value: 11 (0x0000000b)
public int describeContents ()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of writeToParcel(android.os.Parcel, int)
,
the return value of this method must include the
CONTENTS_FILE_DESCRIPTOR
bit.
Returns | |
---|---|
int |
a bitmask indicating the set of special object types marshaled
by this Parcelable object instance.
Value is either 0 or CONTENTS_FILE_DESCRIPTOR |
public boolean equals (Object other)
Indicates whether some other object is "equal to" this one.
The equals
method implements an equivalence relation
on non-null object references:
x
, x.equals(x)
should return
true
.
x
and y
, x.equals(y)
should return true
if and only if
y.equals(x)
returns true
.
x
, y
, and z
, if
x.equals(y)
returns true
and
y.equals(z)
returns true
, then
x.equals(z)
should return true
.
x
and y
, multiple invocations of
x.equals(y)
consistently return true
or consistently return false
, provided no
information used in equals
comparisons on the
objects is modified.
x
,
x.equals(null)
should return false
.
The equals
method for class Object
implements
the most discriminating possible equivalence relation on objects;
that is, for any non-null reference values x
and
y
, this method returns true
if and only
if x
and y
refer to the same object
(x == y
has the value true
).
Note that it is generally necessary to override the hashCode
method whenever this method is overridden, so as to maintain the
general contract for the hashCode
method, which states
that equal objects must have equal hash codes.
Parameters | |
---|---|
other |
Object : the reference object with which to compare. |
Returns | |
---|---|
boolean |
true if this object is the same as the obj
argument; false otherwise. |
public int getDefiningUid ()
Return the defining kernel user identifier, maybe different from getRealUid()
and
getPackageUid()
, if an external service has the
android:useAppZygote
set
to true
and was bound with the flag
Context.BIND_EXTERNAL_SERVICE
- in this case, this field here will
be the kernel user identifier of the external service provider.
Returns | |
---|---|
int |
public String getDescription ()
The human readable description of the process's death, given by the system; could be null.
Note: only intended to be human-readable and the system provides no guarantees that the format is stable across devices or Android releases.
Returns | |
---|---|
String |
public int getImportance ()
The importance of the process that it used to have before the death.
public int getPackageUid ()
Similar to getRealUid()
, it's the kernel user identifier that is assigned at the
package installation time.
Returns | |
---|---|
int |
public int getPid ()
The process id of the process that died.
Returns | |
---|---|
int |
public String getProcessName ()
The actual process name it was running with.
Returns | |
---|---|
String |
This value cannot be null . |
public byte[] getProcessStateSummary ()
Return the state data set by calling
ActivityManager.setProcessStateSummary(byte[])
from the process before its death.
Returns | |
---|---|
byte[] |
The process-customized data
This value may be null . |
public long getPss ()
Last proportional set size of the memory that the process had used in kB.
Note: This is the value from last sampling on the process, it's NOT the exact memory information prior to its death; and it'll be zero if the process died before system had a chance to take the sample.
Returns | |
---|---|
long |
public int getRealUid ()
The kernel user identifier of the process, most of the time the system uses this
to do access control checks. It's typically the uid of the package where the component is
running from, except the case of isolated process, where this field identifies the kernel
user identifier that this process is actually running with, while the getPackageUid()
identifies the kernel user identifier that is assigned at the package installation time.
Returns | |
---|---|
int |
public int getReason ()
The reason code of the process's death.
public long getRss ()
Last resident set size of the memory that the process had used in kB.
Note: This is the value from last sampling on the process, it's NOT the exact memory information prior to its death; and it'll be zero if the process died before system had a chance to take the sample.
Returns | |
---|---|
long |
public int getStatus ()
The exit status argument of exit() if the application calls it, or the signal number if the application is signaled.
Returns | |
---|---|
int |
public long getTimestamp ()
The timestamp of the process's death, in milliseconds since the epoch,
as returned by System.currentTimeMillis()
.
Value is a non-negative timestamp measured as the number of
milliseconds since 1970-01-01T00:00:00Z.
Returns | |
---|---|
long |
Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z. |
public InputStream getTraceInputStream ()
Return the InputStream to the traces that was taken by the system
prior to the death of the process; typically it'll be available when
the reason is REASON_ANR
, though if the process gets an ANR
but recovers, and dies for another reason later, this trace will be included
in the record of ApplicationExitInfo
still.
Returns | |
---|---|
InputStream |
The input stream to the traces that was taken by the system
prior to the death of the process.
This value may be null . |
Throws | |
---|---|
IOException |
public UserHandle getUserHandle ()
Return the user id of the record on a multi-user system.
Returns | |
---|---|
UserHandle |
This value cannot be null . |
public int hashCode ()
Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
HashMap
.
The general contract of hashCode
is:
hashCode
method
must consistently return the same integer, provided no information
used in equals
comparisons on the object is modified.
This integer need not remain consistent from one execution of an
application to another execution of the same application.
equals(Object)
method, then calling the hashCode
method on each of
the two objects must produce the same integer result.
equals(java.lang.Object)
method, then calling the hashCode
method on each of the
two objects must produce distinct integer results. However, the
programmer should be aware that producing distinct integer results
for unequal objects may improve the performance of hash tables.
As much as is reasonably practical, the hashCode method defined by
class Object
does return distinct integers for distinct
objects. (This is typically implemented by converting the internal
address of the object into an integer, but this implementation
technique is not required by the
Java™ programming language.)
Returns | |
---|---|
int |
a hash code value for this object. |
public String toString ()
Returns a string representation of the object. In general, the
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
Returns | |
---|---|
String |
a string representation of the object. |
public void writeToParcel (Parcel dest, int flags)
Flatten this object in to a Parcel.
Parameters | |
---|---|
dest |
Parcel : This value cannot be null . |
flags |
int : Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE .
Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |