ApplicationStartInfo
class ApplicationStartInfo : Parcelable
kotlin.Any | |
↳ | android.app.ApplicationStartInfo |
Describes information related to an application process's startup.
Many aspects concerning why and how an applications process was started are valuable for apps both for logging and for potential behavior changes. Reason for process start, start type, start times, throttling, and other useful diagnostic data can be obtained from ApplicationStartInfo
records.
ApplicationStartInfo objects can be retrieved via: - ActivityManager#getHistoricalProcessStartReasons
, which can be called during or after a application's startup. Using this method, an app can retrieve information about an in-progress app start. - ActivityManager#addApplicationStartInfoCompletionListener
, which returns an ApplicationStartInfo object via a callback when the startup is complete, or immediately if requested after the startup is complete.
Summary
Constants | |
---|---|
static Int |
The system creates the activity at the root of a new task or locates the activity on an existing task with the same affinity. |
static Int |
The activity can only be running as the root activity of the task, the first activity that created the task, and therefore there will only be one instance of this activity in a task; but activity can be instantiated multiple times in different tasks. |
static Int |
Same as "singleTask", except that the system doesn't launch any other activities into the task holding the instance. |
static Int |
If an instance of the activity already exists at the top of the target task, the system routes the intent to that instance through a call to its onNewIntent() method, rather than creating a new instance of the activity. |
static Int |
Default. |
static Int |
State indicating process startup has failed. |
static Int |
State indicating process startup has made it to first frame draw. |
static Int |
State indicating process startup has started. |
static Int |
Process started due to alarm. |
static Int |
Process started to run backup. |
static Int |
Process started due to boot complete. |
static Int |
Process started due to broadcast received. |
static Int |
Process started due to access of ContentProvider |
static Int |
* Process started to run scheduled job. |
static Int |
Process started due to click app icon or widget from launcher. |
static Int |
Process started from launcher recents. |
static Int |
Process started not for any of the listed reasons. |
static Int |
Process started due to push message. |
static Int |
Process service started. |
static Int |
Process started due to Activity started for any reason not explicitly listed. |
static Int |
Clock monotonic timestamp of Application onCreate called. |
static Int |
Clock monotonic timestamp of bindApplication called. |
static Int |
Clock monotonic timestamp of first frame drawn. |
static Int |
Clock monotonic timestamp of process fork. |
static Int |
Clock monotonic timestamp of reportFullyDrawn called by application. |
static Int |
Clock monotonic timestamp of initial renderthread frame. |
static Int |
Clock monotonic timestamp of launch started. |
static Int |
The end of the range reserved for developer supplied timestamps. |
static Int |
The beginning of the range reserved for developer supplied timestamps. |
static Int |
The end of the range, beginning with 0, reserved for system timestamps. |
static Int |
Clock monotonic timestamp of surfaceflinger composition complete. |
static Int |
Process started from scratch. |
static Int |
Process brought back to foreground. |
static Int |
Start type not yet set. |
static Int |
Process retained minimally SavedInstanceState. |
Inherited constants | |
---|---|
Public methods | |
---|---|
Int | |
Int |
Return the defining kernel user identifier, maybe different from |
Intent? |
The intent used to launch the application. |
Int |
An instruction on how the activity should be launched. |
Int |
Similar to |
Int |
getPid() The process id. |
String |
The actual process name it was running with. |
Int |
The kernel user identifier of the process, most of the time the system uses this to do access control checks. |
Int |
The reason code of what triggered the process's start. |
Int |
The state of the app at startup. |
Int |
Current state of startup. |
MutableMap<Int!, Long!> |
Various clock monotonic timestamps in nanoseconds throughout the startup process. |
Int |
hashCode() |
Boolean |
Informs whether this is the first process launch for an app since it was |
Unit |
writeToParcel(dest: Parcel, flags: Int) Flatten this object in to a Parcel. |
Properties | |
---|---|
static Parcelable.Creator<ApplicationStartInfo!> |
Constants
LAUNCH_MODE_SINGLE_INSTANCE
static val LAUNCH_MODE_SINGLE_INSTANCE: Int
The system creates the activity at the root of a new task or locates the activity on an existing task with the same affinity. If an instance of the activity already exists and is at the root of the task, the system routes the intent to existing instance through a call to its onNewIntent() method, rather than creating a new one.
Value: 2
LAUNCH_MODE_SINGLE_INSTANCE_PER_TASK
static val LAUNCH_MODE_SINGLE_INSTANCE_PER_TASK: Int
The activity can only be running as the root activity of the task, the first activity that created the task, and therefore there will only be one instance of this activity in a task; but activity can be instantiated multiple times in different tasks.
Value: 4
LAUNCH_MODE_SINGLE_TASK
static val LAUNCH_MODE_SINGLE_TASK: Int
Same as "singleTask", except that the system doesn't launch any other activities into the task holding the instance. The activity is always the single and only member of its task.
Value: 3
LAUNCH_MODE_SINGLE_TOP
static val LAUNCH_MODE_SINGLE_TOP: Int
If an instance of the activity already exists at the top of the target task, the system routes the intent to that instance through a call to its onNewIntent() method, rather than creating a new instance of the activity.
Value: 1
LAUNCH_MODE_STANDARD
static val LAUNCH_MODE_STANDARD: Int
Default. The system always creates a new instance of the activity in the target task and routes the intent to it.
Value: 0
STARTUP_STATE_ERROR
static val STARTUP_STATE_ERROR: Int
State indicating process startup has failed. Startup information in ApplicationStartInfo
is incomplete, but no more will be added.
Value: 1
STARTUP_STATE_FIRST_FRAME_DRAWN
static val STARTUP_STATE_FIRST_FRAME_DRAWN: Int
State indicating process startup has made it to first frame draw. Startup information in ApplicationStartInfo
is complete with potential exception of fully drawn timestamp which is not guaranteed to be set.
Value: 2
STARTUP_STATE_STARTED
static val STARTUP_STATE_STARTED: Int
State indicating process startup has started. Some information is available in ApplicationStartInfo
and more will be added.
Value: 0
START_REASON_ALARM
static val START_REASON_ALARM: Int
Process started due to alarm.
Value: 0
START_REASON_BACKUP
static val START_REASON_BACKUP: Int
Process started to run backup.
Value: 1
START_REASON_BOOT_COMPLETE
static val START_REASON_BOOT_COMPLETE: Int
Process started due to boot complete.
Value: 2
START_REASON_BROADCAST
static val START_REASON_BROADCAST: Int
Process started due to broadcast received.
Value: 3
START_REASON_CONTENT_PROVIDER
static val START_REASON_CONTENT_PROVIDER: Int
Process started due to access of ContentProvider
Value: 4
START_REASON_JOB
static val START_REASON_JOB: Int
* Process started to run scheduled job.
Value: 5
START_REASON_LAUNCHER
static val START_REASON_LAUNCHER: Int
Process started due to click app icon or widget from launcher.
Value: 6
START_REASON_LAUNCHER_RECENTS
static val START_REASON_LAUNCHER_RECENTS: Int
Process started from launcher recents.
Value: 7
START_REASON_OTHER
static val START_REASON_OTHER: Int
Process started not for any of the listed reasons.
Value: 8
START_REASON_PUSH
static val START_REASON_PUSH: Int
Process started due to push message.
Value: 9
START_REASON_SERVICE
static val START_REASON_SERVICE: Int
Process service started.
Value: 10
START_REASON_START_ACTIVITY
static val START_REASON_START_ACTIVITY: Int
Process started due to Activity started for any reason not explicitly listed.
Value: 11
START_TIMESTAMP_APPLICATION_ONCREATE
static val START_TIMESTAMP_APPLICATION_ONCREATE: Int
Clock monotonic timestamp of Application onCreate called.
Value: 2
START_TIMESTAMP_BIND_APPLICATION
static val START_TIMESTAMP_BIND_APPLICATION: Int
Clock monotonic timestamp of bindApplication called.
Value: 3
START_TIMESTAMP_FIRST_FRAME
static val START_TIMESTAMP_FIRST_FRAME: Int
Clock monotonic timestamp of first frame drawn.
Value: 4
START_TIMESTAMP_FORK
static val START_TIMESTAMP_FORK: Int
Clock monotonic timestamp of process fork.
Value: 1
START_TIMESTAMP_FULLY_DRAWN
static val START_TIMESTAMP_FULLY_DRAWN: Int
Clock monotonic timestamp of reportFullyDrawn called by application.
Value: 5
START_TIMESTAMP_INITIAL_RENDERTHREAD_FRAME
static val START_TIMESTAMP_INITIAL_RENDERTHREAD_FRAME: Int
Clock monotonic timestamp of initial renderthread frame.
Value: 6
START_TIMESTAMP_LAUNCH
static val START_TIMESTAMP_LAUNCH: Int
Clock monotonic timestamp of launch started.
Value: 0
START_TIMESTAMP_RESERVED_RANGE_DEVELOPER
static val START_TIMESTAMP_RESERVED_RANGE_DEVELOPER: Int
The end of the range reserved for developer supplied timestamps.
Value: 30
START_TIMESTAMP_RESERVED_RANGE_DEVELOPER_START
static val START_TIMESTAMP_RESERVED_RANGE_DEVELOPER_START: Int
The beginning of the range reserved for developer supplied timestamps.
Value: 21
START_TIMESTAMP_RESERVED_RANGE_SYSTEM
static val START_TIMESTAMP_RESERVED_RANGE_SYSTEM: Int
The end of the range, beginning with 0, reserved for system timestamps.
Value: 20
START_TIMESTAMP_SURFACEFLINGER_COMPOSITION_COMPLETE
static val START_TIMESTAMP_SURFACEFLINGER_COMPOSITION_COMPLETE: Int
Clock monotonic timestamp of surfaceflinger composition complete.
Value: 7
START_TYPE_COLD
static val START_TYPE_COLD: Int
Process started from scratch.
Value: 1
START_TYPE_HOT
static val START_TYPE_HOT: Int
Process brought back to foreground.
Value: 3
START_TYPE_UNSET
static val START_TYPE_UNSET: Int
Start type not yet set.
Value: 0
START_TYPE_WARM
static val START_TYPE_WARM: Int
Process retained minimally SavedInstanceState.
Value: 2
Public methods
describeContents
fun describeContents(): Int
Return | |
---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
getDefiningUid
fun getDefiningUid(): Int
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 android.content.Context#BIND_EXTERNAL_SERVICE
- in this case, this field here will be the kernel user identifier of the external service provider.
Note: field will be set for any getStartupState
value.
getIntent
fun getIntent(): Intent?
The intent used to launch the application.
Note: Intent is stripped and does not include extras.
Note: field will be set for any getStartupState
value.
Return | |
---|---|
Intent? |
This value may be null . |
getLaunchMode
fun getLaunchMode(): Int
An instruction on how the activity should be launched. There are five modes that work in conjunction with activity flags in Intent objects to determine what should happen when the activity is called upon to handle an intent. Modes: LAUNCH_MODE_STANDARD
LAUNCH_MODE_SINGLE_TOP
LAUNCH_MODE_SINGLE_INSTANCE
LAUNCH_MODE_SINGLE_TASK
LAUNCH_MODE_SINGLE_INSTANCE_PER_TASK
Note: field will be set for any getStartupState
value.
getPackageUid
fun getPackageUid(): Int
Similar to getRealUid
, it's the kernel user identifier that is assigned at the package installation time.
Note: field will be set for any getStartupState
value.
getPid
fun getPid(): Int
The process id.
Note: field will be set for any getStartupState
value.
getProcessName
fun getProcessName(): String
The actual process name it was running with.
Note: field will be set for any getStartupState
value.
Return | |
---|---|
String |
This value cannot be null . |
getRealUid
fun getRealUid(): Int
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.
Note: field will be set for any getStartupState
value.
getReason
fun getReason(): Int
The reason code of what triggered the process's start.
Note: field will be set for any getStartupState
value.
getStartType
fun getStartType(): Int
The state of the app at startup.
Note: field will be set for getStartupState
value STARTUP_STATE_FIRST_FRAME_DRAWN
. Not guaranteed for other states.
getStartupState
fun getStartupState(): Int
Current state of startup. Can be used to determine whether the object will have additional fields added as it may be queried before all data is collected.
Note: field will always be set and available.
Return | |
---|---|
Int |
Value is android.app.ApplicationStartInfo#STARTUP_STATE_STARTED , android.app.ApplicationStartInfo#STARTUP_STATE_ERROR , or android.app.ApplicationStartInfo#STARTUP_STATE_FIRST_FRAME_DRAWN |
getStartupTimestamps
fun getStartupTimestamps(): MutableMap<Int!, Long!>
Various clock monotonic timestamps in nanoseconds throughout the startup process.
Note: different timestamps will be available for different values of getStartupState
: (Subsequent rows contain all timestamps of proceding states.) For STARTUP_STATE_STARTED
, timestamp START_TIMESTAMP_LAUNCH
will be available. For STARTUP_STATE_ERROR
, no additional timestamps are guaranteed available. For STARTUP_STATE_FIRST_FRAME_DRAWN
, timestamps START_TIMESTAMP_APPLICATION_ONCREATE
, START_TIMESTAMP_BIND_APPLICATION
, and START_TIMESTAMP_FIRST_FRAME
will additionally be available. Timestamp START_TIMESTAMP_FULLY_DRAWN
is never guaranteed to be available as it is dependant on devloper calling Activity#reportFullyDrawn
.
Return | |
---|---|
MutableMap<Int!, Long!> |
This value cannot be null . |
wasForceStopped
fun wasForceStopped(): Boolean
Informs whether this is the first process launch for an app since it was force-stopped
for some reason. This allows the app to know if it should re-register for any alarms, jobs and other callbacks that were cleared when the app was force-stopped.
Return | |
---|---|
Boolean |
true if this is the first process launch of the app after having been stopped, false otherwise. |
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
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_WRITE_RETURN_VALUE . Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |