Code: Select all
adb shell dumpsys activity activities
output: (system that has just started will only have Launcher in its main stack)
Code: Select all
ACTIVITY MANAGER ACTIVITIES (dumpsys activity activities)
Main stack:
* TaskRecord{4126da80 #2 A com.android.launcher}
numActivities=1 rootWasReset=false
affinity=com.android.launcher
intent={act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000000 cmp=com.android.launcher/com.android.launcher2.Launcher}
realActivity=com.android.launcher/com.android.launcher2.Launcher
askedCompatMode=false
lastThumbnail=null lastDescription=null
lastActiveTime=65826 (inactive for 16s)
* Hist #0: ActivityRecord{413cf978 com.android.launcher/com.android.launcher2.Launcher}
packageName=com.android.launcher processName=com.android.launcher
launchedFromUid=0 app=ProcessRecord{4126df70 347:com.android.launcher/10024}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000000 cmp=com.android.launcher/com.android.launcher2.Launcher }
frontOfTask=true task=TaskRecord{4126da80 #2 A com.android.launcher}
taskAffinity=com.android.launcher
realActivity=com.android.launcher/com.android.launcher2.Launcher
base=/system/app/Launcher2.apk/system/app/Launcher2.apk data=/data/data/com.android.launcher
labelRes=0x7f0c0000 icon=0x7f020026 theme=0x7f0d0001
stateNotNeeded=true componentSpecified=false isHomeActivity=true
config={0.85 0mcc0mnc en_US layoutdir=0 sw480dp w800dp h432dp nrml land finger -keyb/v/h -nav/h s.4}
compat={160dpi always-compat}
launchFailed=false haveState=false icicle=null
state=RESUMED stopped=false delayedResume=false finishing=false
keysPaused=false inHistory=true visible=true sleeping=false idle=true
fullscreen=true noDisplay=false immersive=false launchMode=2
frozenBeforeDestroy=false thumbnailNeeded=false forceNewConfig=false
thumbHolder=TaskRecord{4126da80 #2 A com.android.launcher}
lastVisibleTime=+1m6s587ms
waitingVisible=false nowVisible=true
Running activities (most recent first):
TaskRecord{4126da80 #2 A com.android.launcher}
Run #0: ActivityRecord{413cf978 com.android.launcher/com.android.launcher2.Launcher}
mResumedActivity: ActivityRecord{413cf978 com.android.launcher/com.android.launcher2.Launcher}
mFocusedActivity: ActivityRecord{413cf978 com.android.launcher/com.android.launcher2.Launcher}
mLastPausedActivity: ActivityRecord{4148c5a8 com.intelli/.Login}
mSleepTimeout: false
mDismissKeyguardOnNextActivity: false
Recent tasks:
* Recent #0: TaskRecord{4126da80 #2 A com.android.launcher}
numActivities=1 rootWasReset=false
affinity=com.android.launcher
intent={act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000000 cmp=com.android.launcher/com.android.launcher2.Launcher}
realActivity=com.android.launcher/com.android.launcher2.Launcher
askedCompatMode=false
lastThumbnail=null lastDescription=null
lastActiveTime=65826 (inactive for 16s)
* Recent #1: TaskRecord{413b4e10 #4 A com.google.android.gsf}
affinity=com.google.android.gsf
intent={flg=0x10800000 cmp=com.google.android.gsf/.update.SystemUpdateDownloadDialog}
realActivity=com.google.android.gsf/.update.SystemUpdateDownloadDialog
askedCompatMode=false
lastThumbnail=null lastDescription=null
lastActiveTime=53428 (inactive for 28s)
mCurTask: 5
Lets try to list done the meaning of each section and its relevant items.
From the above output If you look at mainstack, there is only one task record and that is of launcher
Code: Select all
TaskRecord
A taskrecord is a collection of activities that users interact with when performing a certain job. The activities are arranged in a stack (the "back stack"), in the order in which each activity is opened. When the current activity starts another, the new activity is pushed on the top of the stack and takes focus. The previous activity remains in the stack, but is stopped.
Code: Select all
TaskRecord Details
FIELD
Description
Example Value
numActivities
Current number of activities in this task.
1
rootWasReset
True if the intent at the root of the task had the FLAG_ACTIVITY_RESET_TASK_IF_NEEDED flag.
false
affinity
The affinity name for this task, or null.
com.android.launcher
intent
The original intent that started the task.
{act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000000 cmp=com.android.launcher/com.android.launcher2.Launcher}
realActivity
The actual activity component that started the task. Two pieces of information, encapsulated here, are required to identify a component: the package (a String) it exists in, and the class (a String) name inside of that package.
com.android.launcher/com.android.launcher2.Launcher
askedCompatMode
Have asked the user about compat mode for this task.
false
lastThumbnail
Last thumbnail captured for this item.
null
lastActiveTime
Last time this task was active, including sleep.
null
Code: Select all
ActivityRecord
An entry in the history stack (Task record), representing an activity.
Code: Select all
ActivityRecord Details
FIELD
Description
Example Value
packageName
the package implementing intent's component
com.android.launcher
Intent
the original intent that generated us
same as task record
frontOfTask
is this the root activity of its task.The device Home screen is the starting place for most tasks. When the user touches an icon in the application launcher (or a shortcut on the Home screen), that application's task comes to the foreground. If no task exists for the application (the application has not been used recently), then a new task is created and the "main" activity for that application opens as the root activity in the stack.
true
taskAffinity
as per ActivityInfo.taskAffinity. Specify a task name that activities have an "affinity" to. Use with the application tag (to supply a default affinity for all activities in the application), or with the activity tag (to supply a specific affinity for that component).
The default value for this attribute is the same as the package name, indicating that all activities in the manifest should generally be considered a single "application" to the user. You can use this attribute to modify that behavior: either giving them an affinity for another task, if the activities are intended to be part of that task from the user's perspective, or using an empty string for activities that have no affinity to a task.
com.android.launcher
realActivity
the intent component, or target of an alias.
com.android.launcher/com.android.launcher2.Launcher
base
where activity source (resources etc) located
/system/app/Launcher2.apk/system/app/Launcher2.apk data=/data/data/com.android.launcher
labelRes
the label information from the package mgr
0x7f0c0000
stateNotNeeded
s per ActivityInfo.flags. Indicates that an Activity does not need to have its freeze state. When this flag is set, if for some reason the activity is killed before it has a chance to save its state, then the system will not remove it from the activity stack like it normally would. Instead, the next time the user navigates to it its onCreate(Bundle) method will be called with a null icicle, just like it was starting for the first time.
true
componentSpecified
did caller specifiy an explicit component
false
isHomeActivity
do we consider this to be a home activity?
true
config
configuration activity was last running in. This describes all device configuration information that can impact the resources the application retrieves. This includes both user-specified configuration options (locale and scaling) as well as device configurations (such as input modes, screen size and screen orientation).
0.85 0mcc0mnc en_US layoutdir=0 sw480dp w800dp h432dp nrml land finger -keyb/v/h -nav/h s.4
compat
last used compatibility mode. compatibility info includes MAXIMUM_ASPECT_RATIO, SCALING_REQUIRED, effective screen density etc
160dpi always-compat
launchFailed
set if a launched failed, to abort on 2nd try
false
icicle
last saved activity state
null
state
Current Activity state. ActivityState can be any one of the following {INITIALIZING,RESUMED,PAUSING,PAUSED,STOPPING,STOPPED,FINISHING,DESTROYING,DESTROYED}
RESUMED
stopped
is activity pause finished
false
delayedResume
not yet resumed because of stopped app switches. If the caller has asked not to resume at this point, android makes note of this in the record so that it can skip it when trying to find the top running activity.
false
finishing
activity in pending finish list
false
keysPaused
has key dispatching been paused for it
false
inHistory
are we in the history stack
true
[color=#FF4040]visible
does this activity's window need to be shown
true
sleeping
have we told the activity to sleep
false
idle
has the activity gone idle
true
fullscreen
covers the full screen
true
noDisplay
activity is not displayed
false[/color]
immersive
immersive mode (don't interrupt if possible). Immersive activities should not be interrupted with other activities or notifications.
false
launchMode
the launch mode activity attribute. Specifies how an activity should be launched. following are the modes standard, single instance, single task, single top.
2
thumbHolder
Current
TaskRecord{4126da80 #2 A com.android.launcher}
lastVisibleTime
last time this activity became visible
+1m6s587ms
waitingVisible
rue if waiting for a new activity to become visible
false
nowVisible
is this activity's window visible
true
frozenBeforeDestroy
has been frozen but not yet destroyed
false
thumbnailNeeded
has someone requested a thumbnail
false
forceNewConfig
force re-create with new config next time. if there was a config change for example.
false