wm_task_created
调用位置
less
com.android.server.wm.Task#Task
EventLogTags.writeWmTaskCreated(mTaskId, isRootTask() ? INVALID_TASK_ID : getRootTaskId());
说明:task初始化构造task时打印。
参数说明:第一个参数为task的id,例子中为7878,第二个参数为判断是否为根任务栈,如果是则返回-1,不是则返回根任务栈id。
此log应打印在所有相同taskid 相关log之前
wm_task_removed
调用位置1.
arduino
com.android.server.wm.Task#removeChild
EventLogTags.writeWmTaskRemoved(mTaskId,
"removeChild:" + reason + " last r=" + r + " in t=" + this);
说明:task调用removeChild方法时会在特定条件下进入此方法。需满足条件:此栈内无其余activity,且并且没有标记为重用或由任务组织者创建,则删除整个任务栈。
参数说明:第一个参数为task的id,例子中为13,第二个参数为reason,为"removeChild",第三个参数为上一个activityrecord,第四个参数为task信息(sz=childCount)
08-05 10:17:14.981 2434 5514 I wm_task_removed: [579,removeTask]
调用位置2
arduino
com.android.server.wm.Task#removeImmediately(java.lang.String)
EventLogTags.writeWmTaskRemoved(mTaskId, reason);
说明:第一个参数为task的id,例子中为579,第二个参数为reason,为"removeChild"
注:调用1调用后会调用removeIfPossible方法,故正常会有连续两次task_removed打印
08-07 12:27:44.283 2523 7643 I wm_task_removed: [1211,reParentTask:restoreRecentTaskLocked]
调用位置3
arduino
com.android.server.wm.Task#reparent(com.android.server.wm.Task, int, boolean, java.lang.String)
EventLogTags.writeWmTaskRemoved(mTaskId, "reParentTask:" + reason);
说明:第一个参数为task的id,例子中为1211,第二个参数为reason,为"restoreRecentTaskLocked"
wm_task_moved
08-05 10:07:59.398 2434 2641 I wm_task_moved: [2,1,2147483647]
调用位置
arduino
com.android.server.wm.Task#updateTaskMovement
EventLogTags.writeWmTaskMoved(mTaskId, toTop ? 1 : 0, position);
说明:第一个参数为task的id,例子中为2,第二个参数为是否移至顶部,是则为1,反之则为0.第三个参数为task的position,此时为Integer.MAX_VALUE = 2147483647 即移到顶部
wm_task_to_front
08-05 10:07:59.406 2434 2641 I wm_task_to_front: [0,2]
调用位置
ini
com.android.server.wm.TaskDisplayArea#onLeafTaskMoved
EventLogTags.writeWmTaskToFront(t.mUserId, t.mTaskId);
说明:第一个参数为task对应userId,例子中为主用户即user 0,第二个参数为task id,例子中为2
注:task_moved后如过taskDisplayArea已经初始化,且是leaf task则会调用getStartingWindowType方法,进而会连续打印
wm_create_task
08-05 10:02:19.780 2434 2641 I wm_create_task: [0,567]
调用位置
ini
com.android.server.wm.ActivityStarter#startActivityInner
if (newTask) {
EventLogTags.writeWmCreateTask(mStartActivity.mUserId,
mStartActivity.getTask().mTaskId);
}
说明:参数1为用户id此时为主用户,参数2为task id此时为567
此逻辑中为启动activity时判定是否需要新建一个task(第一个activity | 标记new task),有则创建。
wm_focused_root_task
01-01 18:45:06.433 1225 3165 I wm_focused_root_task: [0,0,1,15,bringingFoundTaskToFront]
ini
com.android.server.wm.TaskDisplayArea#updateLastFocusedRootTask
EventLogTags.writeWmFocusedRootTask(mRootWindowContainer.mCurrentUser,
mDisplayContent.mDisplayId,
currentFocusedTask == null ? -1 : currentFocusedTask.getRootTaskId(),
mLastFocusedRootTask == null ? -1 : mLastFocusedRootTask.getRootTaskId(),
updateLastFocusedTaskReason)
说明:参数1为userid,为主用户 user 0.参数2为display id,为0.参数3为当前focus task的根任务栈 task id,如不存在则为-1,此时根任务为1.参数4为上一个focus task的根 task id,例子中为15。参数5为更新focus task原因
即因为原因arg5,从 task arg4 切到了 arg3.
wm_create_activity
调用位置
less
com.android.server.wm.ActivityStarter#startActivityInner
mStartActivity.logStartActivity(
EventLogTags.WM_CREATE_ACTIVITY, mStartActivity.getTask());
com.android.server.wm.ActivityRecord#logStartActivity
EventLog.writeEvent(tag,
mUserId, System.identityHashCode(this), task.mTaskId,
shortComponentName, intent.getAction(),
intent.getType(), strData, intent.getFlags());
说明:参数1为userID,为主用户0.参数2为activityRecord的id,例子中为254242640。参数3为taskid,例子中为570。参数4为启动activity的component name ,例子中为com.coloros.logkit/.activity.MainActivity。参数5为intent的action,例子中为android.intent.action.MAIN。参数6为intent的type,例子中为null,即没有设定type。参数7为intent data,例子中为null。参数8为intent flags,例子中为270532608
createactivity打印点只有startActivityInner之下,且紧随createTask之后。即新建task打印后会打印createActivitylog,往往是连续的。
wm_new_intent
08-04 05:55:03.451 4371 4736 I wm_new_intent: [0,251431399,7,com.android.launcher/.Launcher,android.intent.action.MAIN,NULL,NULL,268435712]
调用位置
less
com.android.server.wm.ActivityStarter#deliverNewIntent
activity.logStartActivity(EventLogTags.WM_NEW_INTENT, activity.getTask());
com.android.server.wm.ActivityRecord#logStartActivity
EventLog.writeEvent(tag,
mUserId, System.identityHashCode(this), task.mTaskId,
shortComponentName, intent.getAction(),
intent.getType(), strData, intent.getFlags());
说明:参数1为userID,为主用户0.参数2为activityRecord的id,例子中为251431399。参数3为taskid,例子中为7。参数4为启动activity的component name ,例子中为com.android.launcher/.Launcher。参数5为intent的action,例子中为android.intent.action.MAIN。参数6为intent的type,例子中为null,即没有设定type。参数7为intent data,例子中为null。参数8为intent flags,例子中为268435712
与createActivity不同的是,new intent 是对已存在的activity 发出新的intent。
wm_pause_activity
01-01 00:43:15.615 2061 5457 I wm_pause_activity: [0,86240204,com.heytap.brows
er/com.android.browser.BrowserActivity,userLeaving=false,pauseBackTasks]
调用位置
less
com.android.server.wm.Task#startPausingLocked
EventLogTags.writeWmPauseActivity(prev.mUserId, System.identityHashCode(prev),
prev.shortComponentName, "userLeaving=" + userLeaving, reason);
说明:参数一为被pauseActivity的userId 例子中为主用户 0,参数2为被pauseActivity的id。参数3为activity的component name,例子中为com.heytap.brows
er/com.android.browser.BrowserActivity.参数4 为是否为userleaving,如果这应该导致 onUserLeaving 到当前activity则为true,例子中为false。参数5为reason,例子中为pauseBackTasks,即为com.android.server.wm.TaskDisplayArea#pauseBackTasks调用而来
wm_stop_activity
01-01 00:43:15.651 2061 2301 I wm_stop_activity: [0,86240204,com.heytap.browse
r/com.android.browser.BrowserActivity]
调用位置
csharp
com.android.server.wm.ActivityRecord#stopIfPossible
EventLogTags.writeWmStopActivity(
mUserId, System.identityHashCode(this), shortComponentName);
说明:参数1为userId,例子中为user 0.参数2为Activity id,例子中为86240204.参数3为activity component name, 即com.heytap.browse
r/com.android.browser.BrowserActivity
wm_finish_activity
调用位置1
csharp
com.android.server.wm.ActivityRecord#finishIfPossible
EventLogTags.writeWmFinishActivity(mUserId, System.identityHashCode(this),
task.mTaskId, shortComponentName, reason);
说明:参数1为userId,参数2为activity id,参数3为taskId,参数4为 activity对应component name。参数5 为 finish 原因, 例子中为remove-task
根据reason可知是从ATMS.removeTask调用下来的
08-13 17:05:49.158 2046 3659 I wm_finish_activity: [0,137657178,7682,cn.swiftpass.enterprise.ceb/cn.swiftpass.enterprise.ui.activity.WelcomeActivity,proc died without state saved]
调用位置2
csharp
com.android.server.wm.ActivityRecord#handleAppDied
EventLogTags.writeWmFinishActivity(mUserId, System.identityHashCode(this),
task != null ? task.mTaskId : -1, shortComponentName,
"proc died without state saved");
说明:参数1为userId,参数2为activity id,参数3为taskId 或task不存在时默认值 -1,参数4为 activity对应component name。参数5 为 finish 原因,此时为app died 特殊原因proc died without state saved
wm_resume_activity
调用位置
python
com.android.server.wm.Task#resumeTopActivityInnerLocked
EventLogTags.writeWmResumeActivity(next.mUserId, System.identityHashCode(next),
next.getTask().mTaskId, next.shortComponentName);
说明:参数1为userId,参数2为activity id,参数3为taskId,参数4为 activity对应component name。
wm_restart_actvity
01-01 18:45:08.766 1225 8548 I wm_restart_activity: [0,119100940,16,com.google.android.apps.tachyon/.ui.main.MainActivity]
ini
com.android.server.wm.ActivityTaskSupervisor#realStartActivityLocked
EventLogTags.writeWmRestartActivity(r.mUserId, System.identityHashCode(r),
task.mTaskId, r.shortComponentName);
说明:参数1为userId,参数2为activity id,参数3为taskId,参数4为 activity对应component name。
wm_destory_activity
调用位置
csharp
com.android.server.wm.ActivityRecord#destroyImmediately
EventLogTags.writeWmDestroyActivity(mUserId, System.identityHashCode(this),
task.mTaskId, shortComponentName, reason);
说明:参数1为userId,参数2为activity id,参数3为taskId,参数4为 activity对应component name。参数5为调用原因,此处可以为调用了destroyIfPossible-->processStoppingAndFinishingActivities
-->activityIdleInternal
wm_relaunch_activity
08-05 10:15:23.397 2434 4391 I wm_relaunch_activity: [0,162043357,536,com.tencent.mm/.ui.LauncherUI]
调用位置
csharp
com.android.server.wm.ActivityRecord#relaunchActivityLocked
EventLogTags.writeWmRelaunchActivity(mUserId, System.identityHashCode(this),
task.mTaskId, shortComponentName);
说明:参数1为userId,参数2为activity id,参数3为taskId,参数4为 activity对应component name。
wm_relaunch_resume_activity
08-05 10:15:23.397 2434 4391 I wm_relaunch_resume_activity: [0,162043357,536,com.tencent.mm/.ui.LauncherUI]
调用位置
kotlin
EventLogTags.writeWmRelaunchResumeActivity(mUserId, System.identityHashCode(this),
task.mTaskId, shortComponentName);
说明:参数1为userId,参数2为activity id,参数3为taskId,参数4为 activity对应component name。与上一条区别详见com.android.server.wm.ActivityRecord#shouldBeResumed
wm_set_resumed_activity
08-05 11:07:36.792 1810 1864 I wm_set_resumed_activity: [0,com.android.launcher/.Launcher,APP TRANSITION DELAY!]
调用位置
ini
com.android.server.wm.ActivityTaskManagerService#setResumedActivityUncheckLocked
EventLogTags.writeWmSetResumedActivity(
r == null ? -1 : r.mUserId,
r == null ? "NULL" : r.shortComponentName,
reason);
说明:参数1为activityRecord对应的userId,如果activityrecord为空则为-1,参数2为component name,如果activityrecord为空则为NULL。最后是reason,例子中为APP TRANSITION DELAY!
wm_add_to_stopping
08-04 05:12:32.563 2146 2167 I wm_add_to_stopping: [0,265727524,com.android.launcher/.Launcher,completePauseLocked]
调用位置
kotlin
com.android.server.wm.ActivityRecord#addToStopping
if (!mTaskSupervisor.mStoppingActivities.contains(this)) {
EventLogTags.writeWmAddToStopping(mUserId, System.identityHashCode(this),
shortComponentName, reason);
mTaskSupervisor.mStoppingActivities.add(this);
}
说明:参数1为userId,参数2为activity id,参数3 activity对应component name。参数4是原因completePauseLocked,则可知是从下方逻辑调用
arduino
com.android.server.wm.Task#completePauseLocked
prev.addToStopping(true /* scheduleIdle */, false /* idleDelayed */,
"completePauseLocked");
wm_boot_animation_done
08-04 05:47:33.235 4371 4394 I wm_boot_animation_done: 26687
调用位置
ini
com.android.server.wm.WindowManagerService#performEnableScreen
EventLogTags.writeWmBootAnimationDone(SystemClock.uptimeMillis());
参数说明,启动动画完成时间。在亮屏时调用
wm_no_surface_memory
调用位置
vbscript
com.android.server.wm.RootWindowContainer#reclaimSomeSurfaceMemory
EventLogTags.writeWmNoSurfaceMemory(winAnimator.mWin.toString(),
winAnimator.mSession.mPid, operation);
说明:参数1输入windowAnimator的window信息,pid,后续执行的操作,如create。surfaces内存不足时调用此方法
wm_set_keyguard_shown
08-04 06:08:22.112 4371 9135 I wm_set_keyguard_shown: [0,0,1,setKeyguardShown]
调用位置1
yaml
com.android.server.wm.KeyguardController#setKeyguardShown
EventLogTags.writeWmSetKeyguardShown(
displayId,
keyguardShowing ? 1 : 0,
aodShowing ? 1 : 0,
state.mKeyguardGoingAway ? 1 : 0,
state.mOccluded ? 1 : 0,
"setKeyguardShown");
说明:参数1为判断keyguard是否显示,为1则在显示,为0则未显示。参数2为AOD界面是否显示,为1则在显示,为0则未显示。参数3为判断keyguard是否going away,为1则在正在离开。
08-04 06:08:22.050 4371 4388 I wm_set_keyguard_shown: [1,0,1,keyguardGoingAway]
调用位置2
csharp
com.android.server.wm.KeyguardController#keyguardGoingAway
EventLogTags.writeWmSetKeyguardShown(
displayId,
state.mKeyguardShowing ? 1 : 0,
state.mAodShowing ? 1 : 0,
1 /* keyguardGoingAway */,
state.mOccluded ? 1 : 0,
"keyguardGoingAway");
说明:参数2为判断是否aod显示。此时处于keyguardgoingaway时调用的
调用位置3
yaml
com.android.server.wm.KeyguardController#updateVisibility
EventLogTags.writeWmSetKeyguardShown(
mDisplayId,
mKeyguardShowing ? 1 : 0,
mAodShowing ? 1 : 0,
mKeyguardGoingAway ? 1 : 0,
mOccluded ? 1 : 0,
"updateVisibility");
wm_failed_to_pause
08-10 23:20:39.329 1798 4037 I wm_failed_to_pause: [0,104975833,com.android.launcher/.Launcher,(none)]
调用位置
csharp
com.android.server.wm.ActivityRecord#activityPaused
EventLogTags.writeWmFailedToPause(mUserId, System.identityHashCode(this),
shortComponentName, pausingActivity != null
? pausingActivity.shortComponentName : "(none)");
说明:参数1为userId,参数2为activity id,参数3 activity对应component name。参数4是pausingactivity 的 component name
当调用activityPaused后,当前pausing activity不等于此需要pause的activity或为空时会打印
wm_on_create_called
调用位置
less
android.app.Activity#performCreate(android.os.Bundle, android.os.PersistableBundle)
EventLogTags.writeWmOnCreateCalled(mIdent, getComponentName().getClassName(),
"performCreate");
说明:参数1activityRecord id。参数2 创建activity的component name。pid 25388为应用进程pid。有此打印说明调用了activity.onCreate 方法
wm_on_start_called
调用位置
less
android.app.Activity#performStart
EventLogTags.writeWmOnStartCalled(mIdent, getComponentName().getClassName(), reason);
说明:参数1activityRecord id。参数2 启动activity的component name。pid 15483为应用进程pid。有此打印说明调用了activity.onStart 方法。
参数3为启动原因,例子中为handleStartActivity,则可知是从handleStartActivity方法调用启动
wm_on_restart_called
08-04 09:25:39.964 5479 5479 I wm_on_restart_called: [251431399,com.android.launcher.Launcher,performRestartActivity]
调用位置
less
android.app.Activity#performRestart
EventLogTags.writeWmOnRestartCalled(mIdent, getComponentName().getClassName(), reason);
说明:参数1activityRecord id。参数2 重新启动activity的component name。pid 5479为应用进程pid。参数3为启动原因,例子中为performRestartActivity,则可知是从ActivityThread.performRestartActivity方法调用启用。
wm_on_paused_called
08-04 09:25:41.609 5479 5479 I wm_on_paused_called: [251431399,com.android.launcher.Launcher,performPause]
调用位置
less
android.app.Activity#performPause
EventLogTags.writeWmOnPausedCalled(mIdent, getComponentName().getClassName(),
"performPause");
说明:参数1activityRecord id。参数2 暂停activity的component name。pid 5479为应用进程pid。有此打印说明调用了activity.onPause 方法。
wm_on_stop_called
08-04 09:25:42.096 5479 5479 I wm_on_stop_called: [251431399,com.android.launcher.Launcher,STOP_ACTIVITY_ITEM]
调用位置
less
android.app.Activity#performStop
EventLogTags.writeWmOnStopCalled(mIdent, getComponentName().getClassName(), reason);
说明:参数1activityRecord id。参数2 停止activity的component name。pid 5479为应用进程pid。有此打印说明调用了activity.onStop 方法。
参数3为停止原因,例子中为STOP_ACTIVITY_ITEM,则可知调用逻辑为调用停止activity
arduino
android.app.servertransaction.StopActivityItem#execute
public void excute(ClientTransactionHandler client, ActivityClientRecord r,
PendingTransactionActions pendingActions) {
Trace.traceBegin(TRACE_TAG_ACTIVITY_MANAGER, "activityStop");
client.handleStopActivity(r, mConfigChanges, pendingActions,
true /* finalStateRequest */, "STOP_ACTIVITY_ITEM");
Trace.traceEnd(TRACE_TAG_ACTIVITY_MANAGER);
}
wm_on_resume_called
调用位置
less
android.app.Activity#performResume
EventLogTags.writeWmOnResumeCalled(mIdent, getComponentName().getClassName(), reason);
说明:参数1activityRecord id。参数2 resume activity的component name。pid 15483为应用进程pid。有此打印说明调用了activity.onPostResume 方法。
参数3为resume原因,此处为RESUME_ACTIVITY,调用逻辑为
.app.servertransaction.ResumeActivityItem#execute
wm_on_destroy_called
调用位置
less
android.app.Activity#performDestroy
EventLogTags.writeWmOnDestroyCalled(mIdent, getComponentName().getClassName(),
"performDestroy");
说明:参数1activityRecord id。参数2 销毁activity的component name。pid 17597为应用进程pid。有此打印说明调用了activity.onDestroy 方法。
wm_on_activity_result_called
09-19 04:38:52.455 7784 7784 I wm_on_activity_result_called: [158026077,com.android.camera.CameraLauncher,ACTIVITY_RESULT]
调用位置
less
android.app.Activity#dispatchActivityResult
EventLogTags.writeWmOnActivityResultCalled(mIdent, getComponentName().getClassName(),
reason);
说明:参数1activityRecord id。参数2 activity的component name。pid 7784为应用进程pid。有此打印说明调用了Fragment.onActivityResult 方法。
参数3为原因,此处为ACTIVITY_RESULT, 故调用了
android.app.servertransaction.ActivityResultItem#execute
wm_on_top_resumed_gained_called
调用位置
less
android.app.Activity#performTopResumedActivityChanged
if (isTopResumedActivity) {
EventLogTags.writeWmOnTopResumedGainedCalled(mIdent, getComponentName().getClassName(),
reason);
}
说明:参数1activityRecord id。参数2 activity的component name。pid 20874为应用进程pid。参数3为原因为topStateChangedWhenResumed
wm_on_top_resumed_lost_called
08-04 10:01:29.069 20874 20874 I wm_on_top_resumed_lost_called: [233723568,com.google.android.apps.gsa.staticplugins.opa.OpaActivity,topStateChangedWhenResumed]
调用位置
less
android.app.Activity#performTopResumedActivityChanged
else {
EventLogTags.writeWmOnTopResumedLostCalled(mIdent, getComponentName().getClassName(),
reason);
}
说明:参数1activityRecord id。参数2 activity的component name。pid 20874为应用进程pid。参数3为原因为topStateChangedWhenResumed
wm_on_top_resumed_gained_called与wm_on_top_resumed_lost_called都是调用
android.app.Activity#performTopResumedActivityChanged。区别在于输入参数
boolean isTopResumedActivity,即是否为顶部resumed activity。
am_proc_start
less
com.android.server.am.ProcessList#handleProcessStartedLocked(com.android.server.am.ProcessRecord, int, boolean, long, boolean)
EventLog.writeEvent(EventLogTags.AM_PROC_START,
UserHandle.getUserId(app.getStartUid()), pid, app.getStartUid(),
app.processName, app.getHostingRecord().getType(),
app.getHostingRecord().getName() != null ? app.getHostingRecord().getName() : "");
说明:参数1为userId,参数2为app分配的到的进程pid,参数3为app uid,参数4为app进程名。参数5为app启动类型,此时为service。参数6为启动内容。