system_server内存泄漏

卡顿原因:

用android Device Monitor 获取的文件中:
ddms8967132311110557686.trace

windowContainer.ForAllWindows 超过2.7秒

抓取 hprof文件分析:
找到和ForAllWindows函数相关的对象:

adb shell ps | grep -i system_server

ps = 923

adb shell am dumpheap 923 /data/local/tmp/923.hprof

hprof-conv 923.hprof 923_mat.hprof

Class Name | Objects | Shallow Heap | Retained Heap

com.android.server.wm.WindowState | 855 | 376,200 | >= 2,204,304
com.android.server.wm.WindowStateAnimator | 855 | 191,520 | >= 465,872
com.android.server.wm.WindowState$WindowId | 855 | 27,360 | >= 48,280
com.android.server.wm.WindowState$UpdateReportedVisibilityResults| 911 | 21,864 | >= 22,056

com.android.server.wm.WindowState$DeathRecipient | 855 | 13,680 | >= 13,912

Class Name | Objects | Shallow Heap | Retained Heap

com.android.server.am.ActivityRecord | 921 | 353,664 | >= 2,144,720

com.android.server.am.ActivityRecord$Token| 955 | 30,560 | >= 53,848

Type|Name |Value

ref |appToken|com.android.server.am.ActivityRecord$Token @ 0x16f12f88

Type|Name |Value

ref |appInfo |android.content.pm.ApplicationInfo @ 0x1542e100
ref |appToken|com.android.server.am.ActivityRecord$Token @ 0x16f12f88

ref |compat |android.content.res.CompatibilityInfo @ 0x17065af0

Class Name | Objects | Shallow Heap | Retained Heap

android.content.res.CompatibilityInfo| 945 | 22,680 | >= 22,952

ActivityRecord 也有泄漏?????

PATH TO GC ROOT

Class Name | Shallow Heap | Retained Heap

com.android.server.wm.WindowState @ 0x15826d18 | 440 | 3,664
‘- [0] com.android.server.wm.WindowState[20] @ 0x15825c10 | 96 | 96

‘- mPendingRemoveTmp com.android.server.wm.WindowManagerService @ 0x12cd2950 Native Stack| 512 | 5,064

Merge GC ROOT:

Class Name | Ref. Objects | Shallow Heap | Ref. Shallow Heap | Retained Heap

com.android.server.wm.WindowManagerService @ 0x12cd2950 Native Stack | 1 | 512 | 440 | 5,064
‘- mPendingRemoveTmp com.android.server.wm.WindowState[20] @ 0x15825c10| 1 | 96 | 440 | 96

‘- [0] com.android.server.wm.WindowState @ 0x15826d18 | 1 | 440 | 440 | 3,664

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
PATH TO GC ROOT

Class Name | Shallow Heap | Retained Heap

com.android.server.wm.WindowState @ 0x14be1080 | 440 | 2,536
‘- mWin com.android.server.wm.WindowStateAnimator @ 0x14be0e78 | 224 | 544
‘- [0] java.lang.Object[10] @ 0x14be0e40 | 56 | 56
‘- elementData java.util.ArrayList @ 0x14be0d98 | 24 | 80
‘- mAllAppWinAnimators com.android.server.wm.AppWindowAnimator @ 0x14be0b80 | 96 | 288
‘- mAppAnimator com.android.server.wm.AppWindowToken @ 0x14be0810 | 200 | 1,272
‘- value java.util.HashMap$Node @ 0x12dbe658 | 24 | 24
‘- [1511] java.util.HashMap$Node[2048] @ 0x12db91f8 | 8,208 | 30,192
‘- table java.util.HashMap @ 0x12db86a0 | 40 | 30,248
‘- mTokenMap com.android.server.wm.DisplayContent @ 0x12db7bd0 | 312 | 58,344
|- mDisplayContent com.android.server.wm.AppWindowToken @ 0x14bc22d8 | 200 | 1,256
| |- mFocusedApp com.android.server.wm.WindowManagerService @ 0x12cd2950 Native Stack | 512 | 5,064
| |- mAppToken, mToken, mParent com.android.server.wm.WindowState @ 0x12db24d8 | 440 | 3,064
| | |- mCurrentFocus, mLastFocus com.android.server.wm.WindowManagerService @ 0x12cd2950 Native Stack| 512 | 5,064
| | |- this$0 com.android.server.wm.WindowState$DeathRecipient @ 0x12d9d5d0 Native Stack | 16 | 16
| | |- mInputFocus com.android.server.wm.InputMonitor @ 0x15501a98 | 56 | 728

|  |  |  '- mInputMonitor com.android.server.wm.WindowManagerService @ 0x12cd2950 Native Stack         |          512 |         5,064

Merge GC ROOT:

Class Name | Ref. Objects | Shallow Heap | Ref. Shallow Heap | Retained Heap

com.android.server.wm.WindowManagerService @ 0x12cd2950 Native Stack | 1 | 512 | 440 | 5,064
‘- mFocusedApp com.android.server.wm.AppWindowToken @ 0x14bc22d8 | 1 | 200 | 440 | 1,256
‘- mDisplayContent com.android.server.wm.DisplayContent @ 0x12db7bd0 | 1 | 312 | 440 | 58,344
‘- mTokenMap java.util.HashMap @ 0x12db86a0 | 1 | 40 | 440 | 30,248
‘- table java.util.HashMap$Node[2048] @ 0x12db91f8 | 1 | 8,208 | 440 | 30,192
‘- [1511] java.util.HashMap$Node @ 0x12dbe658 | 1 | 24 | 440 | 24
‘- value com.android.server.wm.AppWindowToken @ 0x14be0810 | 1 | 200 | 440 | 1,272
‘- mAppAnimator com.android.server.wm.AppWindowAnimator @ 0x14be0b80 | 1 | 96 | 440 | 288
‘- mAllAppWinAnimators java.util.ArrayList @ 0x14be0d98 | 1 | 24 | 440 | 80
‘- elementData java.lang.Object[10] @ 0x14be0e40 | 1 | 56 | 440 | 56
‘- [0] com.android.server.wm.WindowStateAnimator @ 0x14be0e78| 1 | 224 | 440 | 544

'- mWin com.android.server.wm.WindowState @ 0x14be1080    |            1 |          440 |               440 |         2,536

对象实例:mAppAnimator com.android.server.wm.AppWindowAnimator @ 0x14be0b80
说明:
都是mDisplayContent的mTokenMap持有.没有释放.

Class Name | Ref. Objects | Shallow Heap | Ref. Shallow Heap | Retained Heap

com.android.server.wm.WindowManagerService @ 0x12cd2950 Native Stack | 1 | 512 | 96 | 5,064
‘- mFocusedApp com.android.server.wm.AppWindowToken @ 0x14bc22d8 | 1 | 200 | 96 | 1,256
‘- mDisplayContent com.android.server.wm.DisplayContent @ 0x12db7bd0 | 1 | 312 | 96 | 58,344
‘- mTokenMap java.util.HashMap @ 0x12db86a0 | 1 | 40 | 96 | 30,248
‘- table java.util.HashMap$Node[2048] @ 0x12db91f8 | 1 | 8,208 | 96 | 30,192
‘- [1511] java.util.HashMap$Node @ 0x12dbe658 | 1 | 24 | 96 | 24
‘- value com.android.server.wm.AppWindowToken @ 0x14be0810 | 1 | 200 | 96 | 1,272

'- mAppAnimator com.android.server.wm.AppWindowAnimator @ 0x14be0b80|            1 |           96 |                96 |           288

Class Name | Ref. Objects | Shallow Heap | Ref. Shallow Heap | Retained Heap

com.android.server.wm.WindowManagerService @ 0x12cd2950 Native Stack | 1 | 512 | 96 | 5,064
‘- mFocusedApp com.android.server.wm.AppWindowToken @ 0x14bc22d8 | 1 | 200 | 96 | 1,256
‘- mDisplayContent com.android.server.wm.DisplayContent @ 0x12db7bd0 | 1 | 312 | 96 | 58,344
‘- mTokenMap java.util.HashMap @ 0x12db86a0 | 1 | 40 | 96 | 30,248
‘- table java.util.HashMap$Node[2048] @ 0x12db91f8 | 1 | 8,208 | 96 | 30,192
‘- [792] java.util.HashMap$Node @ 0x12dbccc0 | 1 | 24 | 96 | 48
‘- value com.android.server.wm.AppWindowToken @ 0x12ead060 | 1 | 200 | 96 | 1,296

'- mAppAnimator com.android.server.wm.AppWindowAnimator @ 0x12eada90|            1 |           96 |                96 |           288

Class Name | Shallow Heap | Retained Heap | Percentage

com.android.server.wm.AppWindowAnimator @ 0x14be0b80| 96 | 288 | 0.00%

应用died的时候会主动释放:

01-02 12:44:01.223 746 1581 W jackywei: removeWindowToken
01-02 12:44:01.225 746 1581 W jackywei: java.lang.Throwable
01-02 12:44:01.225 746 1581 W jackywei: at com.android.server.wm.DisplayContent.removeWindowToken(DisplayContent.java:832)
01-02 12:44:01.225 746 1581 W jackywei: at com.android.server.wm.DisplayContent.removeAppToken(DisplayContent.java:858)
01-02 12:44:01.225 746 1581 W jackywei: at com.android.server.wm.AppWindowContainerController.removeContainer(AppWindowContainerController.java:246)
01-02 12:44:01.225 746 1581 W jackywei: at com.android.server.am.ActivityRecord.removeWindowContainer(ActivityRecord.java:1001)
01-02 12:44:01.225 746 1581 W jackywei: at com.android.server.am.ActivityStack.removeActivityFromHistoryLocked(ActivityStack.java:4169)
01-02 12:44:01.225 746 1581 W jackywei: at com.android.server.am.ActivityStack.removeHistoryRecordsForAppLocked(ActivityStack.java:4544)
01-02 12:44:01.225 746 1581 W jackywei: at com.android.server.am.ActivityStack.handleAppDiedLocked(ActivityStack.java:5095)
01-02 12:44:01.225 746 1581 W jackywei: at com.android.server.am.ActivityStackSupervisor.handleAppDiedLocked(ActivityStackSupervisor.java:2008)
01-02 12:44:01.225 746 1581 W jackywei: at com.android.server.am.ActivityManagerService.handleAppDiedLocked(ActivityManagerService.java:5413)
01-02 12:44:01.225 746 1581 W jackywei: at com.android.server.am.ActivityManagerService.appDiedLocked(ActivityManagerService.java:5594)
01-02 12:44:01.225 746 1581 W jackywei: at com.android.server.am.ActivityManagerService$AppDeathRecipient.binderDied(ActivityManagerService.java:1641)
01-02 12:44:01.225 746 1581 W jackywei: at android.os.BinderProxy.sendDeathNotice(Binder.java:844)
01-02 12:44:01.226 746 1581 W jackywei: ++++++++++++++++++++removeWindowToken++++++++++++++++++++
01-02 12:44:01.227 746 1581 W jackywei: removeWindowToken
01-02 12:44:01.228 746 1581 W jackywei: java.lang.Throwable
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.wm.DisplayContent.removeWindowToken(DisplayContent.java:832)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.wm.WindowToken.removeImmediately(WindowToken.java:239)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.wm.AppWindowToken.removeImmediately(AppWindowToken.java:528)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.wm.AppWindowToken.removeIfPossible(AppWindowToken.java:535)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.wm.AppWindowToken.onRemovedFromDisplay(AppWindowToken.java:601)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.wm.DisplayContent.removeAppToken(DisplayContent.java:871)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.wm.AppWindowContainerController.removeContainer(AppWindowContainerController.java:246)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.am.ActivityRecord.removeWindowContainer(ActivityRecord.java:1001)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.am.ActivityStack.removeActivityFromHistoryLocked(ActivityStack.java:4169)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.am.ActivityStack.removeHistoryRecordsForAppLocked(ActivityStack.java:4544)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.am.ActivityStack.handleAppDiedLocked(ActivityStack.java:5095)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.am.ActivityStackSupervisor.handleAppDiedLocked(ActivityStackSupervisor.java:2008)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.am.ActivityManagerService.handleAppDiedLocked(ActivityManagerService.java:5413)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.am.ActivityManagerService.appDiedLocked(ActivityManagerService.java:5594)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.am.ActivityManagerService$AppDeathRecipient.binderDied(ActivityManagerService.java:1641)
01-02 12:44:01.228 746 1581 W jackywei: at android.os.BinderProxy.sendDeathNotice(Binder.java:844)
01-02 12:44:01.228 746 1581 W jackywei: ++++++++++++++++++++removeWindowToken++++++++++++++++++++

ActivityManagerService.java:

private final void handleAppDiedLocked(ProcessRecord app,
boolean restarting, boolean allowRestart) {

// Remove this application’s activities from active lists.
boolean hasVisibleActivities = mStackSupervisor.handleAppDiedLocked(app);

——–>

ActivityStackSupervisor.java:
boolean handleAppDiedLocked(ProcessRecord app) {
boolean hasVisibleActivities = false;
for (int displayNdx = mActivityDisplays.size() - 1; displayNdx >= 0; –displayNdx) {
final ArrayList stacks = mActivityDisplays.valueAt(displayNdx).mStacks;
for (int stackNdx = stacks.size() - 1; stackNdx >= 0; –stackNdx) {
hasVisibleActivities |= stacks.get(stackNdx).handleAppDiedLocked(app);
}
}
return hasVisibleActivities;
}

mActivityDisplays ? 大小:mSize = 1

Type|Name |Value

ref |mActivityDisplays|android.util.SparseArray @ 0x14bc0ad0

Type |Name |Value

boolean|mGarbage |false
ref |mKeys |int[11] @ 0x14bd1160
int |mSize |1
ref |mValues |java.lang.Object[11] @ 0x14bd1198
ref |shadow$klass |class android.util.SparseArray @ 0x7036c860

int |shadow$monitor|0

大小:mSize = 1
boolean handleAppDiedLocked(ProcessRecord app) {
boolean hasVisibleActivities = false;
for (int displayNdx = mActivityDisplays.size() - 1; displayNdx >= 0; –displayNdx) {
final ArrayList stacks = mActivityDisplays.valueAt(displayNdx).mStacks;
for (int stackNdx = stacks.size() - 1; stackNdx >= 0; –stackNdx) {
hasVisibleActivities |= stacks.get(stackNdx).handleAppDiedLocked(app);
}
}
return hasVisibleActivities;
}

Type|Name |Value

ref |mStacks|java.util.ArrayList @ 0x12dc5ec0

mStacks: size 3

Type|Name |Value

ref |elementData |java.lang.Object[10] @ 0x12dc61c0
int |size |3
int |modCount |12097
ref |shadow$klass |class java.util.ArrayList @ 0x6ff70c38

int |shadow$monitor|0

———>

ActivityStack.java :

boolean handleAppDiedLocked(ProcessRecord app) {
if (mPausingActivity != null && mPausingActivity.app == app) {
if (DEBUG_PAUSE || DEBUG_CLEANUP) Slog.v(TAG_PAUSE,
“App died while pausing: “ + mPausingActivity);
mPausingActivity = null;
}
if (mLastPausedActivity != null && mLastPausedActivity.app == app) {
mLastPausedActivity = null;
mLastNoHistoryActivity = null;
}

return removeHistoryRecordsForAppLocked(app);

}

private boolean removeHistoryRecordsForAppLocked(ProcessRecord app) {
removeHistoryRecordsForAppLocked(mLRUActivities, app, “mLRUActivities”);
removeHistoryRecordsForAppLocked(mStackSupervisor.mStoppingActivities, app,
“mStoppingActivities”);
removeHistoryRecordsForAppLocked(mStackSupervisor.mGoingToSleepActivities, app,
“mGoingToSleepActivities”);
removeHistoryRecordsForAppLocked(mStackSupervisor.mActivitiesWaitingForVisibleActivity, app,
“mActivitiesWaitingForVisibleActivity”);
removeHistoryRecordsForAppLocked(mStackSupervisor.mFinishingActivities, app,
“mFinishingActivities”);

boolean hasVisibleActivities = false;

// Clean out the history list.
int i = numActivities();
if (DEBUG_CLEANUP) Slog.v(TAG_CLEANUP,
        "Removing app " + app + " from history with " + i + " entries");
for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
    final ArrayList<ActivityRecord> activities = mTaskHistory.get(taskNdx).mActivities;
    for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
        final ActivityRecord r = activities.get(activityNdx);
        --i;
        if (DEBUG_CLEANUP) Slog.v(TAG_CLEANUP,
                "Record #" + i + " " + r + ": app=" + r.app);
        if (r.app == app) {//如果这里没有相等的APP实例,remove 就一直是 false.
            if (r.visible) {
                hasVisibleActivities = true;
            }
            final boolean remove;
            if ((!r.haveState && !r.stateNotNeeded) || r.finishing) {//这里的三个状态
                // Don't currently have state for the activity, or
                // it is finishing -- always remove it.
                remove = true;
            } else if (!r.visible && r.launchCount > 2 &&
                    r.lastLaunchTime > (SystemClock.uptimeMillis() - 60000)) {
                // We have launched this activity too many times since it was
                // able to run, so give up and remove it.
                // (Note if the activity is visible, we don't remove the record.
                // We leave the dead window on the screen but the process will
                // not be restarted unless user explicitly tap on it.)
                remove = true;
            } else {
                // The process may be gone, but the activity lives on!
                remove = false;
            }
            if (remove) {
                if (DEBUG_ADD_REMOVE || DEBUG_CLEANUP) Slog.i(TAG_ADD_REMOVE,
                        "Removing activity " + r + " from stack at " + i
                        + ": haveState=" + r.haveState
                        + " stateNotNeeded=" + r.stateNotNeeded
                        + " finishing=" + r.finishing
                        + " state=" + r.state + " callers=" + Debug.getCallers(5));
                if (!r.finishing) {
                    Slog.w(TAG, "Force removing " + r + ": app died, no saved state");
                    EventLog.writeEvent(EventLogTags.AM_FINISH_ACTIVITY,
                            r.userId, System.identityHashCode(r),
                            r.getTask().taskId, r.shortComponentName,
                            "proc died without state saved");
                    if (r.state == ActivityState.RESUMED) {
                        mService.updateUsageStats(r, false);
                    }
                }
            } else {
                // We have the current state for this activity, so
                // it can be restarted later when needed.
                if (DEBUG_ALL) Slog.v(TAG, "Keeping entry, setting app to null");
                if (DEBUG_APP) Slog.v(TAG_APP,
                        "Clearing app during removeHistory for activity " + r);
                r.app = null;
                // Set nowVisible to previous visible state. If the app was visible while
                // it died, we leave the dead window on screen so it's basically visible.
                // This is needed when user later tap on the dead window, we need to stop
                // other apps when user transfers focus to the restarted activity.
                r.nowVisible = r.visible;
                if (!r.haveState) {
                    if (DEBUG_SAVED_STATE) Slog.i(TAG_SAVED_STATE,
                            "App died, clearing saved state of " + r);
                    r.icicle = null;
                }
            }
            cleanUpActivityLocked(r, true, true);
            if (remove) {
                removeActivityFromHistoryLocked(r, "appDied");//在这里会释放removeWindowToken
            }
        }
    }
}

return hasVisibleActivities;

}

private void removeHistoryRecordsForAppLocked(ArrayList list,
ProcessRecord app, String listName) {
int i = list.size();
if (DEBUG_CLEANUP) Slog.v(TAG_CLEANUP,
“Removing app “ + app + “ from list “ + listName + “ with “ + i + “ entries”);
while (i > 0) {
i–;
ActivityRecord r = list.get(i);
if (DEBUG_CLEANUP) Slog.v(TAG_CLEANUP, “Record #” + i + “ “ + r);
if (r.app == app) {
if (DEBUG_CLEANUP) Slog.v(TAG_CLEANUP, “—> REMOVING this entry!”);
list.remove(i);
removeTimeoutsForActivityLocked(r);
}
}
}

Class Name | Shallow Heap | Retained Heap | Percentage

com.android.server.am.ActivityRecord @ 0x14bf1378| 384 | 3,208 | 0.01%

Type |Name |Value

ref |app |null
ref |appInfo |android.content.pm.ApplicationInfo @ 0x12de8bb8
ref |appTimeTracker |null
ref |appToken |com.android.server.am.ActivityRecord$Token @ 0x14bf0340
ref |compat |android.content.res.CompatibilityInfo @ 0x14bf1548
boolean|componentSpecified |false
int |configChangeFlags |0
ref |connections |null
long |cpuTimeAtResume |0
long |createTime |1529665655297
boolean|deferRelaunchUntilPaused |false
boolean|delayedResume |false
long |displayStartTime |0
boolean|finishing |false
boolean|forceNewConfig |false
boolean|frontOfTask |false
boolean|frozenBeforeDestroy |false
boolean|fullscreen |true
long |fullyDrawnStartTime |0
boolean|hasBeenLaunched |true
boolean|haveState |true
ref |icicle |android.os.Bundle @ 0x14bf1560
int |icon |2130903043
boolean|idle |true
boolean|immersive |false
boolean|inHistory |true
ref |info |android.content.pm.ActivityInfo @ 0x149cd150
ref |intent |android.content.Intent @ 0x14bf1578
boolean|keysPaused |false
int |labelRes |2131954418
long |lastLaunchTime |82773638
long |lastVisibleTime |82780913
int |launchCount |0
boolean|launchFailed |false
int |launchMode |0
long |launchTickTime |0
ref |launchedFromPackage |java.lang.String @ 0x14bf15b8
int |launchedFromPid |-1
int |launchedFromUid |10036
boolean|launching |true
int |logo |2130903043
int |mActivityType |0
ref |mBounds |android.graphics.Rect @ 0x14bf15e0
boolean|mDeferHidingClient |false
ref |mHorizontalSizeConfigurations |int[5] @ 0x14bf15f8
ref |mLastReportedConfiguration |android.util.MergedConfiguration @ 0x14bf1618
int |mLastReportedDisplayId |0
boolean|mLastReportedMultiWindowMode |false
boolean|mLastReportedPictureInPictureMode|false
boolean|mLaunchTaskBehind |false
ref |mPerf |android.util.BoostFramework @ 0x14bf1630
ref |mPerf_iop |android.util.BoostFramework @ 0x14bf1640
int |mRotationAnimationHint |-1
boolean|mShowWhenLocked |false
ref |mSmallestSizeConfigurations |int[8] @ 0x14bf1650
ref |mStackSupervisor |com.android.server.am.ActivityStackSupervisor @ 0x12dc5dd8
int |mStartingWindowState |2
boolean|mTaskOverlay |false
ref |mTmpBounds |android.graphics.Rect @ 0x14bf1680
ref |mTmpConfig |android.content.res.Configuration @ 0x14bf1698
boolean|mTurnScreenOn |false
boolean|mUpdateTaskThumbnailWhenHidden |false
ref |mUxPerf |android.util.BoostFramework @ 0x14bf1708
ref |mVerticalSizeConfigurations |int[4] @ 0x14bf1718
ref |mWindowContainerController |com.android.server.wm.AppWindowContainerController @ 0x14bf00e0
ref |newIntents |null
boolean|noDisplay |false
ref |nonLocalizedLabel |null
boolean|nowVisible |false
ref |packageName |java.lang.String @ 0x12dd83d8
long |pauseTime |82807597
ref |pendingOptions |android.app.ActivityOptions @ 0x14bf1738
ref |pendingResults |null
boolean|pendingVoiceInteractionStart |false
int |perfActivityBoostHandler |-1
ref |persistentState |null
ref |pictureInPictureArgs |android.app.PictureInPictureParams @ 0x14bf17b0
boolean|preserveWindowOnDeferredRelaunch |false
ref |processName |java.lang.String @ 0x12dd83d8
ref |realActivity |android.content.ComponentName @ 0x14bf17c8
int |realTheme |2132017768
int |requestCode |0
ref |requestedVrComponent |null
ref |resolvedType |java.lang.String @ 0x14bf17d8
ref |resultTo |null
ref |resultWho |null
ref |results |null
ref |returningOptions |null
boolean|rootVoiceInteraction |false
ref |service |com.android.server.am.ActivityManagerService @ 0x12cd3f10
ref |shortComponentName |java.lang.String @ 0x14bf17f8
boolean|sleeping |false
long |startTime |0
ref |state |com.android.server.am.ActivityStack$ActivityState @ 0x12dc97b0
boolean|stateNotNeeded |false
boolean|stopped |true
ref |stringName |java.lang.String @ 0x14bf1848
boolean|supportsEnterPipOnTaskSwitch |true
ref |task |com.android.server.am.TaskRecord @ 0x14bd2bf0
ref |taskAffinity |java.lang.String @ 0x12dd83d8
ref |taskDescription |android.app.ActivityManager$TaskDescription @ 0x14bf18b0
int |theme |2132017768
ref |uriPermissions |com.android.server.am.UriPermissionOwner @ 0x14bf18d8
int |userId |0
boolean|visible |false
boolean|visibleIgnoringKeyguard |false
ref |voiceSession |null
int |windowFlags |16777216
ref |mFullConfiguration |android.content.res.Configuration @ 0x14bf18f8
ref |mMergedOverrideConfiguration |android.content.res.Configuration @ 0x14bf1968
ref |mOverrideConfiguration |android.content.res.Configuration @ 0x14bf19d8
ref |shadow$klass |class com.android.server.am.ActivityRecord @ 0x75a57328

int |shadow$monitor |-1950625590

android@NSGWD180021:/data/workspace/issueAnalysis/system_server_memory_leak/0625$ adb shell ps | grep -i process
u0_a18 499 276 1063700 24232 SyS_epoll_wait aa9e3658 S com.google.process.gservices
u0_a55 2683 276 1056528 21044 SyS_epoll_wait aa9e3658 S com.google.process.gapps
u0_a18 2693 276 1059040 25804 SyS_epoll_wait aa9e3658 S com.google.process.gapps
u0_a1 2871 276 1056696 26984 SyS_epoll_wait aa9e3658 S android.process.acore
u0_i460 3264 276 1062668 22268 SyS_epoll_wait aa9e3658 S com.android.chrome:sandboxed_process0
u0_a12 3977 276 1072972 32456 SyS_epoll_wait aa9e3658 S android.process.media

#################################################################################################################

Class Name | Ref. Objects | Shallow Heap | Ref. Shallow Heap | Retained Heap

com.android.server.wm.WindowManagerService @ 0x12cd2950 Native Stack | 1 | 512 | 440 | 5,064
‘- mFocusedApp com.android.server.wm.AppWindowToken @ 0x14bc22d8 | 1 | 200 | 440 | 1,256
‘- mDisplayContent com.android.server.wm.DisplayContent @ 0x12db7bd0 | 1 | 312 | 440 | 58,344
‘- mTokenMap java.util.HashMap @ 0x12db86a0 | 1 | 40 | 440 | 30,248
‘- table java.util.HashMap$Node[2048] @ 0x12db91f8 | 1 | 8,208 | 440 | 30,192
‘- [1941] java.util.HashMap$Node @ 0x12dbf468 | 1 | 24 | 440 | 24
‘- value com.android.server.wm.AppWindowToken @ 0x12e960b0 | 1 | 200 | 440 | 1,272
‘- mAppAnimator com.android.server.wm.AppWindowAnimator @ 0x12e96a70 | 1 | 96 | 440 | 288
‘- mAllAppWinAnimators java.util.ArrayList @ 0x12e96c88 | 1 | 24 | 440 | 80
‘- elementData java.lang.Object[10] @ 0x12e96d30 | 1 | 56 | 440 | 56
‘- [0] com.android.server.wm.WindowStateAnimator @ 0x12e96d68| 1 | 224 | 440 | 544

'- mWin com.android.server.wm.WindowState @ 0x12e96f70    |            1 |          440 |               440 |         2,496

mTokenMap

Class Name | Shallow Heap | Retained Heap

mPidsSelfLocked com.android.server.am.ActivityManagerService @ 0x12cd3f10 Native Stack| 800 | 329,472

Class Name | Shallow Heap | Retained Heap

[36] java.lang.Object[95] @ 0x1563f618| 392 | 392

I use the sdk tools catch the systrace log ,the log indicate that the android.anim thread spend a lot of cpu time.
And I catch the traceview log, the log indicate that the com.android.server.wm.WindowContainer.forAllWindows function spend a lot of time to run in the android.anim thread.

And I catch the window service log,show that there are so lot of AppWindowToken is not released.

直接debug system_server 看能否释放

sudo mount -t cifs -o username=”android”,password=”mobile#5” //10.1.6.36/android /mnt/10.1.6.36

用eclipse远程调试

删除一个APP 看能否 正常释放:

01-02 12:44:01.223 746 1581 W jackywei: removeWindowToken
01-02 12:44:01.225 746 1581 W jackywei: java.lang.Throwable
01-02 12:44:01.225 746 1581 W jackywei: at com.android.server.wm.DisplayContent.removeWindowToken(DisplayContent.java:832)
01-02 12:44:01.225 746 1581 W jackywei: at com.android.server.wm.DisplayContent.removeAppToken(DisplayContent.java:858)
01-02 12:44:01.225 746 1581 W jackywei: at com.android.server.wm.AppWindowContainerController.removeContainer(AppWindowContainerController.java:246)
01-02 12:44:01.225 746 1581 W jackywei: at com.android.server.am.ActivityRecord.removeWindowContainer(ActivityRecord.java:1001)
01-02 12:44:01.225 746 1581 W jackywei: at com.android.server.am.ActivityStack.removeActivityFromHistoryLocked(ActivityStack.java:4169)
01-02 12:44:01.225 746 1581 W jackywei: at com.android.server.am.ActivityStack.removeHistoryRecordsForAppLocked(ActivityStack.java:4544)
01-02 12:44:01.225 746 1581 W jackywei: at com.android.server.am.ActivityStack.handleAppDiedLocked(ActivityStack.java:5095)
01-02 12:44:01.225 746 1581 W jackywei: at com.android.server.am.ActivityStackSupervisor.handleAppDiedLocked(ActivityStackSupervisor.java:2008)
01-02 12:44:01.225 746 1581 W jackywei: at com.android.server.am.ActivityManagerService.handleAppDiedLocked(ActivityManagerService.java:5413)
01-02 12:44:01.225 746 1581 W jackywei: at com.android.server.am.ActivityManagerService.appDiedLocked(ActivityManagerService.java:5594)
01-02 12:44:01.225 746 1581 W jackywei: at com.android.server.am.ActivityManagerService$AppDeathRecipient.binderDied(ActivityManagerService.java:1641)
01-02 12:44:01.225 746 1581 W jackywei: at android.os.BinderProxy.sendDeathNotice(Binder.java:844)
01-02 12:44:01.226 746 1581 W jackywei: ++++++++++++++++++++removeWindowToken++++++++++++++++++++
01-02 12:44:01.227 746 1581 W jackywei: removeWindowToken
01-02 12:44:01.228 746 1581 W jackywei: java.lang.Throwable
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.wm.DisplayContent.removeWindowToken(DisplayContent.java:832)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.wm.WindowToken.removeImmediately(WindowToken.java:239)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.wm.AppWindowToken.removeImmediately(AppWindowToken.java:528)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.wm.AppWindowToken.removeIfPossible(AppWindowToken.java:535)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.wm.AppWindowToken.onRemovedFromDisplay(AppWindowToken.java:601)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.wm.DisplayContent.removeAppToken(DisplayContent.java:871)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.wm.AppWindowContainerController.removeContainer(AppWindowContainerController.java:246)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.am.ActivityRecord.removeWindowContainer(ActivityRecord.java:1001)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.am.ActivityStack.removeActivityFromHistoryLocked(ActivityStack.java:4169)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.am.ActivityStack.removeHistoryRecordsForAppLocked(ActivityStack.java:4544)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.am.ActivityStack.handleAppDiedLocked(ActivityStack.java:5095)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.am.ActivityStackSupervisor.handleAppDiedLocked(ActivityStackSupervisor.java:2008)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.am.ActivityManagerService.handleAppDiedLocked(ActivityManagerService.java:5413)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.am.ActivityManagerService.appDiedLocked(ActivityManagerService.java:5594)
01-02 12:44:01.228 746 1581 W jackywei: at com.android.server.am.ActivityManagerService$AppDeathRecipient.binderDied(ActivityManagerService.java:1641)
01-02 12:44:01.228 746 1581 W jackywei: at android.os.BinderProxy.sendDeathNotice(Binder.java:844)
01-02 12:44:01.228 746 1581 W jackywei: ++++++++++++++++++++removeWindowToken++++++++++++++++++++

DisplayContent.forAllWindows(ToBooleanFunction, boolean) line: 1525
DisplayContent.findFocusedWindow() line: 2265
RootWindowContainer.computeFocusedWindow() line: 170
WindowManagerService.updateFocusedWindowLocked(int, boolean) line: 5993
DisplayContent.layoutAndAssignWindowLayersIfNeeded() line: 2289
StackWindowController.positionChildAtTop(TaskWindowContainerController, boolean) line: 159
ActivityStack.insertTaskAtTop(TaskRecord, ActivityRecord) line: 2844
ActivityStack.moveTaskToFrontLocked(TaskRecord, boolean, ActivityOptions, AppTimeTracker, String) line: 4620
ActivityStarter.setTargetStackAndMoveToFrontIfNeeded(ActivityRecord) line: 1613
ActivityStarter.startActivityUnchecked(ActivityRecord, ActivityRecord, IVoiceInteractionSession, IVoiceInteractor, int, boolean, ActivityOptions, TaskRecord, ActivityRecord[]) line: 1096
ActivityStarter.startActivity(ActivityRecord, ActivityRecord, IVoiceInteractionSession, IVoiceInteractor, int, boolean, ActivityOptions, TaskRecord, ActivityRecord[]) line: 1000
ActivityStarter.startActivity(IApplicationThread, Intent, Intent, String, ActivityInfo, ResolveInfo, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, int, String, int, int, int, ActivityOptions, boolean, boolean, ActivityRecord[], TaskRecord) line: 577
ActivityStarter.startActivityLocked(IApplicationThread, Intent, Intent, String, ActivityInfo, ResolveInfo, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, int, String, int, int, int, ActivityOptions, boolean, boolean, ActivityRecord[], TaskRecord, String) line: 283
ActivityStarter.startActivityMayWait(IApplicationThread, int, String, Intent, String, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, ProfilerInfo, WaitResult, Configuration, Bundle, boolean, int, TaskRecord, String) line: 822
ActivityManagerService.startActivityAsUser(IApplicationThread, String, Intent, String, IBinder, String, int, int, ProfilerInfo, Bundle, int) line: 4622
ActivityManagerService.startActivity(IApplicationThread, String, Intent, String, IBinder, String, int, int, ProfilerInfo, Bundle) line: 4609
ActivityManagerService(IActivityManager$Stub).onTransact(int, Parcel, Parcel, int) line: 121
ActivityManagerService.onTransact(int, Parcel, Parcel, int) line: 2977
ActivityManagerService(Binder).execTransact(int, long, long, int) line: 697

Thread [Binder:923_1B] (Suspended (breakpoint at line 3402 in DisplayContent$TaskStackContainers))
owns: WindowHashMap (id=10090)
owns: ActivityManagerService (id=165)
DisplayContent$TaskStackContainers.forAllWindows(ToBooleanFunction, boolean) line: 3402
DisplayContent.forAllWindows(ToBooleanFunction, boolean) line: 1533
DisplayContent.findFocusedWindow() line: 2265
RootWindowContainer.computeFocusedWindow() line: 170
WindowManagerService.updateFocusedWindowLocked(int, boolean) line: 5993
DisplayContent.layoutAndAssignWindowLayersIfNeeded() line: 2289
StackWindowController.positionChildAtTop(TaskWindowContainerController, boolean) line: 159
ActivityStack.insertTaskAtTop(TaskRecord, ActivityRecord) line: 2844
ActivityStack.moveTaskToFrontLocked(TaskRecord, boolean, ActivityOptions, AppTimeTracker, String) line: 4620
ActivityStarter.setTargetStackAndMoveToFrontIfNeeded(ActivityRecord) line: 1613
ActivityStarter.startActivityUnchecked(ActivityRecord, ActivityRecord, IVoiceInteractionSession, IVoiceInteractor, int, boolean, ActivityOptions, TaskRecord, ActivityRecord[]) line: 1096
ActivityStarter.startActivity(ActivityRecord, ActivityRecord, IVoiceInteractionSession, IVoiceInteractor, int, boolean, ActivityOptions, TaskRecord, ActivityRecord[]) line: 1000
ActivityStarter.startActivity(IApplicationThread, Intent, Intent, String, ActivityInfo, ResolveInfo, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, int, String, int, int, int, ActivityOptions, boolean, boolean, ActivityRecord[], TaskRecord) line: 577
ActivityStarter.startActivityLocked(IApplicationThread, Intent, Intent, String, ActivityInfo, ResolveInfo, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, int, String, int, int, int, ActivityOptions, boolean, boolean, ActivityRecord[], TaskRecord, String) line: 283
ActivityStarter.startActivityMayWait(IApplicationThread, int, String, Intent, String, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, ProfilerInfo, WaitResult, Configuration, Bundle, boolean, int, TaskRecord, String) line: 822
ActivityManagerService.startActivityAsUser(IApplicationThread, String, Intent, String, IBinder, String, int, int, ProfilerInfo, Bundle, int) line: 4622
ActivityManagerService.startActivity(IApplicationThread, String, Intent, String, IBinder, String, int, int, ProfilerInfo, Bundle) line: 4609
ActivityManagerService(IActivityManager$Stub).onTransact(int, Parcel, Parcel, int) line: 121
ActivityManagerService.onTransact(int, Parcel, Parcel, int) line: 2977
ActivityManagerService(Binder).execTransact(int, long, long, int) line: 697

Thread [android.anim] (Suspended (breakpoint at line 400 in InputMonitor))
owns: WindowHashMap (id=10090)
InputMonitor.updateInputWindowsLw(boolean) line: 400
WindowManagerService.relayoutWindow(Session, IWindow, int, WindowManager$LayoutParams, int, int, int, int, Rect, Rect, Rect, Rect, Rect, Rect, Rect, MergedConfiguration, Surface) line: 2241
Session.relayout(IWindow, int, WindowManager$LayoutParams, int, int, int, int, Rect, Rect, Rect, Rect, Rect, Rect, Rect, MergedConfiguration, Surface) line: 239
ViewRootImpl.relayoutWindow(WindowManager$LayoutParams, int, boolean) line: 6141
ViewRootImpl.performTraversals() line: 1905
ViewRootImpl.doTraversal() line: 1396
ViewRootImpl$TraversalRunnable.run() line: 6773
Choreographer$CallbackRecord.run(long) line: 966
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 713
Choreographer$FrameDisplayEventReceiver.run() line: 952
Handler.handleCallback(Message) line: 790
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

Thread [android.anim] (Suspended (breakpoint at line 632 in WindowContainer))
owns: WindowHashMap (id=10090)
DisplayContent(WindowContainer).forAllWindows(Consumer, boolean) line: 632
DisplayContent.updateWindowsForAnimator(WindowAnimator) line: 2616
WindowAnimator.animate(long) line: 201
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameDisplayEventReceiver.run() line: 952
Handler.handleCallback(Message) line: 790
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

Thread [android.anim] (Suspended (breakpoint at line 1525 in DisplayContent))
owns: WindowHashMap (id=10090)
DisplayContent.forAllWindows(ToBooleanFunction, boolean) line: 1525
DisplayContent(WindowContainer).forAllWindows(Consumer, boolean) line: 633
DisplayContent.prepareWindowSurfaces() line: 2637
WindowAnimator.animate(long) line: 203
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameDisplayEventReceiver.run() line: 952
Handler.handleCallback(Message) line: 790
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

查 看traceview 文件再分析一下

animate

traceview 显示 animate 占了很大一部分运行时间CPU时间

    mAnimationFrameCallback = frameTimeNs -> {
        synchronized (mService.mWindowMap) {
            mAnimationFrameCallbackScheduled = false;
        }
        animate(frameTimeNs);
    };


void scheduleAnimation() {
    if (!mAnimationFrameCallbackScheduled) {
        mAnimationFrameCallbackScheduled = true;
        mChoreographer.postFrameCallback(mAnimationFrameCallback); //放到渲染线程里面
    }
}

private void cancelAnimation() {
    if (mAnimationFrameCallbackScheduled) {
        mAnimationFrameCallbackScheduled = false;
        mChoreographer.removeFrameCallback(mAnimationFrameCallback);//移出渲染线程里面
    }
}


private void animate(long frameTimeNs) {

    synchronized (mService.mWindowMap) {
        if (!mInitialized) {
            return;
        }

        // Schedule next frame already such that back-pressure happens continuously
        scheduleAnimation();//animate每次都会调用
    }

mAnimationFrameCallbackScheduled 很重要,cancelAnimation()才能致 false

//下面的代码才能调 cancelAnimation
if (mService.mDragState != null) {
mAnimating |= mService.mDragState.stepAnimationLocked(mCurrentTime);
}

            if (!mAnimating) {
                cancelAnimation();
            }




private final Consumer<WindowState> mUpdateWallpaperForAnimator = w -> {
    final WindowStateAnimator winAnimator = w.mWinAnimator;
    if (winAnimator.mSurfaceController == null || !winAnimator.hasSurface()) {
        return;
    }

    final int flags = w.mAttrs.flags;

    // If this window is animating, make a note that we have an animating window and take
    // care of a request to run a detached wallpaper animation.
    if (winAnimator.mAnimating) {
        if (winAnimator.mAnimation != null) {
            if ((flags & FLAG_SHOW_WALLPAPER) != 0
                    && winAnimator.mAnimation.getDetachWallpaper()) {
                mTmpWindow = w;
            }
            final int color = winAnimator.mAnimation.getBackgroundColor();
            if (color != 0) {
                final TaskStack stack = w.getStack();
                if (stack != null) {
                    stack.setAnimationBackground(winAnimator, color);
                }
            }
        }
        mTmpWindowAnimator.setAnimating(true);
    }

    // If this window's app token is running a detached wallpaper animation, make a note so
    // we can ensure the wallpaper is displayed behind it.
    final AppWindowAnimator appAnimator = winAnimator.mAppAnimator;
    if (appAnimator != null && appAnimator.animation != null
            && appAnimator.animating) {
        if ((flags & FLAG_SHOW_WALLPAPER) != 0
                && appAnimator.animation.getDetachWallpaper()) {
            mTmpWindow = w;
        }

        final int color = appAnimator.animation.getBackgroundColor();
        if (color != 0) {
            final TaskStack stack = w.getStack();
            if (stack != null) {
                stack.setAnimationBackground(winAnimator, color);
            }
        }
    }
};




@Override
boolean forAllWindows(ToBooleanFunction<WindowState> callback, boolean traverseTopToBottom) {
    if (mChildren.isEmpty()) {
        // The window has no children so we just return it.
        return applyInOrderWithImeWindows(callback, traverseTopToBottom);// 这里?
    }

    if (traverseTopToBottom) {
        return forAllWindowTopToBottom(callback);
    } else {
        return forAllWindowBottomToTop(callback);
    }
}


private final Consumer<WindowState> mUpdateWallpaperForAnimator = w -> {
    final WindowStateAnimator winAnimator = w.mWinAnimator;
    if (winAnimator.mSurfaceController == null || !winAnimator.hasSurface()) {
        return;
    }

    final int flags = w.mAttrs.flags;

    // If this window is animating, make a note that we have an animating window and take
    // care of a request to run a detached wallpaper animation.
    if (winAnimator.mAnimating) {// ?在这里?
        if (winAnimator.mAnimation != null) {
            if ((flags & FLAG_SHOW_WALLPAPER) != 0
                    && winAnimator.mAnimation.getDetachWallpaper()) {
                mTmpWindow = w;
            }
            final int color = winAnimator.mAnimation.getBackgroundColor();
            if (color != 0) {
                final TaskStack stack = w.getStack();
                if (stack != null) {
                    stack.setAnimationBackground(winAnimator, color);
                }
            }
        }
        mTmpWindowAnimator.setAnimating(true);
    }

    // If this window's app token is running a detached wallpaper animation, make a note so
    // we can ensure the wallpaper is displayed behind it.
    final AppWindowAnimator appAnimator = winAnimator.mAppAnimator;
    if (appAnimator != null && appAnimator.animation != null
            && appAnimator.animating) {
        if ((flags & FLAG_SHOW_WALLPAPER) != 0
                && appAnimator.animation.getDetachWallpaper()) {
            mTmpWindow = w;
        }

        final int color = appAnimator.animation.getBackgroundColor();
        if (color != 0) {
            final TaskStack stack = w.getStack();
            if (stack != null) {
                stack.setAnimationBackground(winAnimator, color);
            }
        }
    }
};

Thread [android.anim] (Suspended (breakpoint at line 435 in WindowAnimator))
owns: WindowHashMap (id=142)
WindowAnimator.setAnimating(boolean) line: 435
DisplayContent.lambda$-com_android_server_wm_DisplayContent_18415(WindowState) line: 408
-$Lambda$YIZfR4m-B8z_tYbP2x4OJ3o7OYE.$m$4(Object) line: not available
-$Lambda$YIZfR4m-B8z_tYbP2x4OJ3o7OYE.accept(Object) line: not available
WindowContainer$ForAllWindowsConsumerWrapper.apply(WindowState) line: 779
WindowContainer$ForAllWindowsConsumerWrapper.apply(Object) line: 777
WindowState.applyInOrderWithImeWindows(ToBooleanFunction, boolean) line: 4128
WindowState.forAllWindows(ToBooleanFunction, boolean) line: 4035
AppWindowToken(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
AppWindowToken.forAllWindowsUnchecked(ToBooleanFunction, boolean) line: 1549
AppWindowToken.forAllWindows(ToBooleanFunction, boolean) line: 1544
Task(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
TaskStack(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
DisplayContent$TaskStackContainers(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
DisplayContent$TaskStackContainers.forAllWindows(ToBooleanFunction, boolean) line: 3405
DisplayContent.forAllWindows(ToBooleanFunction, boolean) line: 1534
DisplayContent(WindowContainer).forAllWindows(Consumer, boolean) line: 633
DisplayContent.updateWallpaperForAnimator(WindowAnimator) line: 2628
WindowAnimator.animate(long) line: 202
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameDisplayEventReceiver.run() line: 952
Handler.handleCallback(Message) line: 790
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

private static final boolean OPTS_INPUT = SystemProperties.getBoolean(“persist.vendor.qti.inputopts.enable”,false);

//这个很关键???????
// Enable/disable vsync for animations and drawing.
private static final boolean USE_VSYNC = SystemProperties.getBoolean(
“debug.choreographer.vsync”, true);

启动activity

Thread [Binder:3041_D] (Suspended)
owns: Object (id=374)
owns: WindowHashMap (id=142)
owns: ActivityManagerService (id=337)
Choreographer.postCallbackDelayedInternal(int, Object, Object, long) line: 429
Choreographer.postFrameCallbackDelayed(Choreographer$FrameCallback, long) line: 509
Choreographer.postFrameCallback(Choreographer$FrameCallback) line: 489
WindowAnimator.scheduleAnimation() line: 407
WindowManagerService.scheduleAnimationLocked() line: 5988
RootWindowContainer.performSurfacePlacement(boolean) line: 824
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowSurfacePlacer.performSurfacePlacement() line: 135
WindowSurfacePlacer.continueLayout() line: 126
WindowManagerService.continueSurfaceLayout() line: 2966
ActivityStarter.startActivity(ActivityRecord, ActivityRecord, IVoiceInteractionSession, IVoiceInteractor, int, boolean, ActivityOptions, TaskRecord, ActivityRecord[]) line: 1010
ActivityStarter.startActivity(IApplicationThread, Intent, Intent, String, ActivityInfo, ResolveInfo, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, int, String, int, int, int, ActivityOptions, boolean, boolean, ActivityRecord[], TaskRecord) line: 577
ActivityStarter.startActivityLocked(IApplicationThread, Intent, Intent, String, ActivityInfo, ResolveInfo, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, int, String, int, int, int, ActivityOptions, boolean, boolean, ActivityRecord[], TaskRecord, String) line: 283
ActivityStarter.startActivityMayWait(IApplicationThread, int, String, Intent, String, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, ProfilerInfo, WaitResult, Configuration, Bundle, boolean, int, TaskRecord, String) line: 822
ActivityManagerService.startActivityAsUser(IApplicationThread, String, Intent, String, IBinder, String, int, int, ProfilerInfo, Bundle, int) line: 4622
ActivityManagerService.startActivity(IApplicationThread, String, Intent, String, IBinder, String, int, int, ProfilerInfo, Bundle) line: 4609
ActivityManagerService(IActivityManager$Stub).onTransact(int, Parcel, Parcel, int) line: 121
ActivityManagerService.onTransact(int, Parcel, Parcel, int) line: 2977
ActivityManagerService(Binder).execTransact(int, long, long, int) line: 697

POWER ON 唤醒
Thread [PowerManagerService] (Suspended (breakpoint at line 426 in Choreographer))
Choreographer.postCallbackDelayedInternal(int, Object, Object, long) line: 426
Choreographer.postCallbackDelayed(int, Runnable, Object, long) line: 415
Choreographer.postCallback(int, Runnable, Object) line: 389
RampAnimator.postAnimationCallback() line: 124
RampAnimator.animateTo(int, int) line: 103
DisplayPowerController.animateScreenBrightness(int, int) line: 986
DisplayPowerController.updatePowerState() line: 802
DisplayPowerController.-wrap6(DisplayPowerController) line: not available
DisplayPowerController$DisplayControllerHandler.handleMessage(Message) line: 1421
DisplayPowerController$DisplayControllerHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
ServiceThread(HandlerThread).run() line: 65
ServiceThread.run() line: 46


@Override
boolean forAllWindows(ToBooleanFunction<WindowState> callback, boolean traverseTopToBottom) {
    if (mChildren.isEmpty()) {//这里递归返回
        // The window has no children so we just return it.
        return applyInOrderWithImeWindows(callback, traverseTopToBottom);
    }

    if (traverseTopToBottom) {
        return forAllWindowTopToBottom(callback);
    } else {
        return forAllWindowBottomToTop(callback);
    }
}

设置 setAnimating 的true
Thread [android.anim] (Suspended (breakpoint at line 435 in WindowAnimator))
owns: WindowHashMap (id=142)
WindowAnimator.setAnimating(boolean) line: 435
DisplayContent.lambda$-com_android_server_wm_DisplayContent_18415(WindowState) line: 408
-$Lambda$YIZfR4m-B8z_tYbP2x4OJ3o7OYE.$m$4(Object) line: not available
-$Lambda$YIZfR4m-B8z_tYbP2x4OJ3o7OYE.accept(Object) line: not available
WindowContainer$ForAllWindowsConsumerWrapper.apply(WindowState) line: 779
WindowContainer$ForAllWindowsConsumerWrapper.apply(Object) line: 777
WindowState.applyInOrderWithImeWindows(ToBooleanFunction, boolean) line: 4128
WindowState.forAllWindows(ToBooleanFunction, boolean) line: 4035
WallpaperWindowToken(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
DisplayContent$NonAppWindowContainers(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
DisplayContent.forAllWindows(ToBooleanFunction, boolean) line: 1534
DisplayContent(WindowContainer).forAllWindows(Consumer, boolean) line: 633
DisplayContent.updateWallpaperForAnimator(WindowAnimator) line: 2628
WindowAnimator.animate(long) line: 202
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameDisplayEventReceiver.run() line: 952
Handler.handleCallback(Message) line: 790
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

Thread [android.anim] (Suspended (breakpoint at line 231 in WindowAnimator))
owns: WindowHashMap (id=163)
WindowAnimator.animate(long) line: 231
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameDisplayEventReceiver.run() line: 952
Handler.handleCallback(Message) line: 790
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46


case PAUSE_TIMEOUT_MSG: {
    ActivityRecord r = (ActivityRecord)msg.obj;
    // We don't at this point know if the activity is fullscreen,
    // so we need to be conservative and assume it isn't.
    Slog.w(TAG, "Activity pause timeout for " + r);
    synchronized (mService) {
        if (r.app != null) {
            mService.logAppTooSlow(r.app, r.pauseTime, "pausing " + r);
        }
        activityPausedLocked(r.appToken, true);
    }
} break;

Thread [ActivityManager] (Suspended (breakpoint at line 426 in Choreographer))
owns: WindowHashMap (id=163)
owns: ActivityManagerService (id=164)
Choreographer.postCallbackDelayedInternal(int, Object, Object, long) line: 426
Choreographer.postFrameCallbackDelayed(Choreographer$FrameCallback, long) line: 509
Choreographer.postFrameCallback(Choreographer$FrameCallback) line: 489
WindowAnimator.scheduleAnimation() line: 407
WindowManagerService.scheduleAnimationLocked() line: 5988
RootWindowContainer.performSurfacePlacement(boolean) line: 824
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowSurfacePlacer.performSurfacePlacement() line: 135
WindowSurfacePlacer.continueLayout() line: 126
WindowManagerService.continueSurfaceLayout() line: 2966
ActivityStack.activityPausedLocked(IBinder, boolean) line: 1427
ActivityStack$ActivityStackHandler.handleMessage(Message) line: 401
ActivityStack$ActivityStackHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
ServiceThread(HandlerThread).run() line: 65
ServiceThread.run() line: 46


Thread [Binder:14721_8] (Suspended (breakpoint at line 4035 in WindowState))
owns: WindowHashMap (id=146)
owns: ActivityManagerService (id=147)
WindowState.forAllWindows(ToBooleanFunction, boolean) line: 4035
WindowToken(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
DisplayContent$NonAppWindowContainers(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
DisplayContent.forAllWindows(ToBooleanFunction, boolean) line: 1534
DisplayContent.findFocusedWindow() line: 2267
RootWindowContainer.computeFocusedWindow() line: 170
WindowManagerService.updateFocusedWindowLocked(int, boolean) line: 5993
DisplayContent.layoutAndAssignWindowLayersIfNeeded() line: 2291
StackWindowController.positionChildAtTop(TaskWindowContainerController, boolean) line: 159
ActivityStack.insertTaskAtTop(TaskRecord, ActivityRecord) line: 2844
ActivityStack.moveTaskToFrontLocked(TaskRecord, boolean, ActivityOptions, AppTimeTracker, String) line: 4620
ActivityStarter.setTargetStackAndMoveToFrontIfNeeded(ActivityRecord) line: 1613
ActivityStarter.startActivityUnchecked(ActivityRecord, ActivityRecord, IVoiceInteractionSession, IVoiceInteractor, int, boolean, ActivityOptions, TaskRecord, ActivityRecord[]) line: 1096
ActivityStarter.startActivity(ActivityRecord, ActivityRecord, IVoiceInteractionSession, IVoiceInteractor, int, boolean, ActivityOptions, TaskRecord, ActivityRecord[]) line: 1000
ActivityStarter.startActivity(IApplicationThread, Intent, Intent, String, ActivityInfo, ResolveInfo, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, int, String, int, int, int, ActivityOptions, boolean, boolean, ActivityRecord[], TaskRecord) line: 577
ActivityStarter.startActivityLocked(IApplicationThread, Intent, Intent, String, ActivityInfo, ResolveInfo, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, int, String, int, int, int, ActivityOptions, boolean, boolean, ActivityRecord[], TaskRecord, String) line: 283
ActivityStarter.startActivityMayWait(IApplicationThread, int, String, Intent, String, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, ProfilerInfo, WaitResult, Configuration, Bundle, boolean, int, TaskRecord, String) line: 822
ActivityManagerService.startActivityAsUser(IApplicationThread, String, Intent, String, IBinder, String, int, int, ProfilerInfo, Bundle, int) line: 4622
ActivityManagerService.startActivity(IApplicationThread, String, Intent, String, IBinder, String, int, int, ProfilerInfo, Bundle) line: 4609
ActivityManagerService(IActivityManager$Stub).onTransact(int, Parcel, Parcel, int) line: 121
ActivityManagerService.onTransact(int, Parcel, Parcel, int) line: 2977
ActivityManagerService(Binder).execTransact(int, long, long, int) line: 697

退出APP

Thread [Binder:14721_14] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowManagerService.scheduleAnimationLocked() line: 5988
RootWindowContainer.performSurfacePlacement(boolean) line: 824
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowManagerService.relayoutWindow(Session, IWindow, int, WindowManager$LayoutParams, int, int, int, int, Rect, Rect, Rect, Rect, Rect, Rect, Rect, MergedConfiguration, Surface) line: 2182
Session.relayout(IWindow, int, WindowManager$LayoutParams, int, int, int, int, Rect, Rect, Rect, Rect, Rect, Rect, Rect, MergedConfiguration, Surface) line: 239
Session(IWindowSession$Stub).onTransact(int, Parcel, Parcel, int) line: 286
Session.onTransact(int, Parcel, Parcel, int) line: 163
Session(Binder).execTransact(int, long, long, int) line: 697


启动APP 1

Thread [Binder:14721_11] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
owns: ActivityManagerService (id=483)
WindowAnimator.scheduleAnimation() line: 407
WindowManagerService.scheduleAnimationLocked() line: 5988
RootWindowContainer.performSurfacePlacement(boolean) line: 824
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowSurfacePlacer.performSurfacePlacement() line: 135
WindowSurfacePlacer.continueLayout() line: 126
WindowManagerService.continueSurfaceLayout() line: 2966
ActivityStarter.startActivity(ActivityRecord, ActivityRecord, IVoiceInteractionSession, IVoiceInteractor, int, boolean, ActivityOptions, TaskRecord, ActivityRecord[]) line: 1010
ActivityStarter.startActivity(IApplicationThread, Intent, Intent, String, ActivityInfo, ResolveInfo, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, int, String, int, int, int, ActivityOptions, boolean, boolean, ActivityRecord[], TaskRecord) line: 577
ActivityStarter.startActivityLocked(IApplicationThread, Intent, Intent, String, ActivityInfo, ResolveInfo, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, int, String, int, int, int, ActivityOptions, boolean, boolean, ActivityRecord[], TaskRecord, String) line: 283
ActivityStarter.startActivityMayWait(IApplicationThread, int, String, Intent, String, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, ProfilerInfo, WaitResult, Configuration, Bundle, boolean, int, TaskRecord, String) line: 822
ActivityManagerService.startActivityAsUser(IApplicationThread, String, Intent, String, IBinder, String, int, int, ProfilerInfo, Bundle, int) line: 4622
ActivityManagerService.startActivity(IApplicationThread, String, Intent, String, IBinder, String, int, int, ProfilerInfo, Bundle) line: 4609
ActivityManagerService(IActivityManager$Stub).onTransact(int, Parcel, Parcel, int) line: 121
ActivityManagerService.onTransact(int, Parcel, Parcel, int) line: 2977
ActivityManagerService(Binder).execTransact(int, long, long, int) line: 697

第2次 animate

Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowAnimator.animate(long) line: 143
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第3次 animate

Thread [Binder:14721_12] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowManagerService.scheduleAnimationLocked() line: 5988
RootWindowContainer.performSurfacePlacement(boolean) line: 824
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowManagerService.relayoutWindow(Session, IWindow, int, WindowManager$LayoutParams, int, int, int, int, Rect, Rect, Rect, Rect, Rect, Rect, Rect, MergedConfiguration, Surface) line: 2182
Session.relayout(IWindow, int, WindowManager$LayoutParams, int, int, int, int, Rect, Rect, Rect, Rect, Rect, Rect, Rect, MergedConfiguration, Surface) line: 239
Session(IWindowSession$Stub).onTransact(int, Parcel, Parcel, int) line: 286
Session.onTransact(int, Parcel, Parcel, int) line: 163
Session(Binder).execTransact(int, long, long, int) line: 697

第4次 animate

Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowAnimator.animate(long) line: 143
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第5次 animate
Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowAnimator.animate(long) line: 143
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第6次 animate
Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowAnimator.animate(long) line: 143
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第7次 animate
Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowAnimator.animate(long) line: 143
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第8次 animate
Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowAnimator.animate(long) line: 143
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第9次 animate
Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowAnimator.animate(long) line: 143
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第10次 animate
Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowAnimator.animate(long) line: 143
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第11次 animate
Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowAnimator.animate(long) line: 143
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第12次 animate
Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowAnimator.animate(long) line: 143
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第13次 animate
Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowAnimator.animate(long) line: 143
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第14次 animate
Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowAnimator.animate(long) line: 143
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第15次 animate
Thread [android.anim] (Suspended (breakpoint at line 413 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.cancelAnimation() line: 413
WindowAnimator.animate(long) line: 231
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第16次 animate
Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowManagerService.scheduleAnimationLocked() line: 5988
RootWindowContainer.performSurfacePlacement(boolean) line: 824
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowSurfacePlacer.performSurfacePlacement() line: 135
WindowSurfacePlacer.lambda$-com_android_server_wm_WindowSurfacePlacer_5337() line: 108
-$Lambda$aEpJ2RCAIjecjyIIYTv6ricEwh4.$m$12() line: not available
-$Lambda$aEpJ2RCAIjecjyIIYTv6ricEwh4.run() line: not available
Handler.handleCallback(Message) line: 790
Handler.dispatchMessage(Message) line: 99
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第17次 animate
Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowAnimator.animate(long) line: 143
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第18次 animate
Thread [android.anim] (Suspended (breakpoint at line 413 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.cancelAnimation() line: 413
WindowAnimator.animate(long) line: 231
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第19次 animate
Thread [Binder:14721_13] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowManagerService.scheduleAnimationLocked() line: 5988
RootWindowContainer.performSurfacePlacement(boolean) line: 824
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowManagerService.relayoutWindow(Session, IWindow, int, WindowManager$LayoutParams, int, int, int, int, Rect, Rect, Rect, Rect, Rect, Rect, Rect, MergedConfiguration, Surface) line: 2182
Session.relayout(IWindow, int, WindowManager$LayoutParams, int, int, int, int, Rect, Rect, Rect, Rect, Rect, Rect, Rect, MergedConfiguration, Surface) line: 239
Session(IWindowSession$Stub).onTransact(int, Parcel, Parcel, int) line: 286
Session.onTransact(int, Parcel, Parcel, int) line: 163
Session(Binder).execTransact(int, long, long, int) line: 697

第20次 animate
Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowAnimator.animate(long) line: 143
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第21次 animate
Thread [android.anim] (Suspended (breakpoint at line 413 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.cancelAnimation() line: 413
WindowAnimator.animate(long) line: 231
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第22次 animate
Thread [Binder:14721_10] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowManagerService.scheduleAnimationLocked() line: 5988
RootWindowContainer.performSurfacePlacement(boolean) line: 824
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowManagerService.relayoutWindow(Session, IWindow, int, WindowManager$LayoutParams, int, int, int, int, Rect, Rect, Rect, Rect, Rect, Rect, Rect, MergedConfiguration, Surface) line: 2182
Session.relayout(IWindow, int, WindowManager$LayoutParams, int, int, int, int, Rect, Rect, Rect, Rect, Rect, Rect, Rect, MergedConfiguration, Surface) line: 239
Session(IWindowSession$Stub).onTransact(int, Parcel, Parcel, int) line: 286
Session.onTransact(int, Parcel, Parcel, int) line: 163
Session(Binder).execTransact(int, long, long, int) line: 697

第23次 animate
Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowAnimator.animate(long) line: 143
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第24次 animate
Thread [android.anim] (Suspended (breakpoint at line 413 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.cancelAnimation() line: 413
WindowAnimator.animate(long) line: 231
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第25次 animate
Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowManagerService.scheduleAnimationLocked() line: 5988
RootWindowContainer.performSurfacePlacement(boolean) line: 824
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowSurfacePlacer.performSurfacePlacement() line: 135
WindowSurfacePlacer.lambda$-com_android_server_wm_WindowSurfacePlacer_5337() line: 108
-$Lambda$aEpJ2RCAIjecjyIIYTv6ricEwh4.$m$12() line: not available
-$Lambda$aEpJ2RCAIjecjyIIYTv6ricEwh4.run() line: not available
Handler.handleCallback(Message) line: 790
Handler.dispatchMessage(Message) line: 99
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第26次 animate
Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowAnimator.animate(long) line: 143
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第27次 animate
Thread [android.anim] (Suspended (breakpoint at line 413 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.cancelAnimation() line: 413
WindowAnimator.animate(long) line: 231
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第28次 animate
Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowManagerService.scheduleAnimationLocked() line: 5988
RootWindowContainer.performSurfacePlacement(boolean) line: 824
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowSurfacePlacer.performSurfacePlacement() line: 135
WindowState.setupWindowForRemoveOnExit() line: 1994
WindowState.removeIfPossible(boolean) line: 1968
WindowState.removeIfPossible() line: 1848
WindowManagerService.removeWindow(Session, IWindow) line: 1733
Session.remove(IWindow) line: 222
TaskSnapshotSurface.remove() line: 260
AppWindowContainerController.lambda$-com_android_server_wm_AppWindowContainerController_31045(WindowManagerPolicy$StartingSurface) line: 658
-$Lambda$aEpJ2RCAIjecjyIIYTv6ricEwh4.$m$5() line: not available
-$Lambda$aEpJ2RCAIjecjyIIYTv6ricEwh4.run() line: not available
Handler.handleCallback(Message) line: 790
Handler.dispatchMessage(Message) line: 99
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第29次 animate
Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowAnimator.animate(long) line: 143
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第30次 animate
Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowAnimator.animate(long) line: 143
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第31次 animate
Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowAnimator.animate(long) line: 143
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第32次 animate
Thread [android.anim] (Suspended (breakpoint at line 413 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.cancelAnimation() line: 413
WindowAnimator.animate(long) line: 231
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第33次 animate
Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowManagerService.scheduleAnimationLocked() line: 5988
RootWindowContainer.performSurfacePlacement(boolean) line: 824
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowSurfacePlacer.performSurfacePlacement() line: 135
WindowSurfacePlacer.lambda$-com_android_server_wm_WindowSurfacePlacer_5337() line: 108
-$Lambda$aEpJ2RCAIjecjyIIYTv6ricEwh4.$m$12() line: not available
-$Lambda$aEpJ2RCAIjecjyIIYTv6ricEwh4.run() line: not available
Handler.handleCallback(Message) line: 790
Handler.dispatchMessage(Message) line: 99
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第34次 animate
Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowAnimator.animate(long) line: 143
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

第35次 animate
Thread [android.anim] (Suspended (breakpoint at line 413 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.cancelAnimation() line: 413
WindowAnimator.animate(long) line: 231
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

Thread [android.ui] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=460)
WindowAnimator.scheduleAnimation() line: 407
WindowManagerService.scheduleAnimationLocked() line: 5988
RootWindowContainer.performSurfacePlacement(boolean) line: 824
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowManagerService.relayoutWindow(Session, IWindow, int, WindowManager$LayoutParams, int, int, int, int, Rect, Rect, Rect, Rect, Rect, Rect, Rect, MergedConfiguration, Surface) line: 2061
Session.relayout(IWindow, int, WindowManager$LayoutParams, int, int, int, int, Rect, Rect, Rect, Rect, Rect, Rect, Rect, MergedConfiguration, Surface) line: 239
ViewRootImpl.relayoutWindow(WindowManager$LayoutParams, int, boolean) line: 6141
ViewRootImpl.performTraversals() line: 1905
ViewRootImpl.doTraversal() line: 1396
ViewRootImpl$TraversalRunnable.run() line: 6773
Choreographer$CallbackRecord.run(long) line: 966
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 713
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
UiThread(HandlerThread).run() line: 65
UiThread(ServiceThread).run() line: 46
UiThread.run() line: 42


Thread [android.anim] (Suspended (breakpoint at line 609 in WindowState))
owns: WindowHashMap (id=460)
WindowState.(WindowManagerService, Session, IWindow, WindowToken, WindowState, int, int, WindowManager$LayoutParams, int, int, boolean) line: 609
WindowManagerService.addWindow(Session, IWindow, int, WindowManager$LayoutParams, int, int, Rect, Rect, Rect, InputChannel) line: 1396
Session.addToDisplay(IWindow, int, WindowManager$LayoutParams, int, int, Rect, Rect, Rect, InputChannel) line: 202
TaskSnapshotSurface.create(WindowManagerService, AppWindowToken, ActivityManager$TaskSnapshot) line: 199
TaskSnapshotController.createStartingSurface(AppWindowToken, ActivityManager$TaskSnapshot) line: 203
SnapshotStartingData.createStartingSurface(AppWindowToken) line: 39
AppWindowContainerController.lambda$-com_android_server_wm_AppWindowContainerController_4735() line: 145
-$Lambda$aEpJ2RCAIjecjyIIYTv6ricEwh4.$m$4() line: not available
-$Lambda$aEpJ2RCAIjecjyIIYTv6ricEwh4.run() line: not available
Handler.handleCallback(Message) line: 790
Handler.dispatchMessage(Message) line: 99
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46


启动APP的调用堆栈, scheduleAddStartingWindow调用mAddStartingWindow

Thread [Binder:14721_16] (Suspended (breakpoint at line 593 in AppWindowContainerController))
owns: WindowHashMap (id=460)
owns: ActivityManagerService (id=483)
AppWindowContainerController.scheduleAddStartingWindow() line: 593
AppWindowContainerController.createSnapshot(ActivityManager$TaskSnapshot) line: 603
AppWindowContainerController.addStartingWindow(String, int, CompatibilityInfo, CharSequence, int, int, int, int, IBinder, boolean, boolean, boolean, boolean, boolean, boolean) line: 502
ActivityRecord.showStartingWindow(ActivityRecord, boolean, boolean, boolean) line: 2241
ActivityRecord.showStartingWindow(ActivityRecord, boolean, boolean) line: 2226
ActivityStarter.setTargetStackAndMoveToFrontIfNeeded(ActivityRecord) line: 1657
ActivityStarter.startActivityUnchecked(ActivityRecord, ActivityRecord, IVoiceInteractionSession, IVoiceInteractor, int, boolean, ActivityOptions, TaskRecord, ActivityRecord[]) line: 1096
ActivityStarter.startActivity(ActivityRecord, ActivityRecord, IVoiceInteractionSession, IVoiceInteractor, int, boolean, ActivityOptions, TaskRecord, ActivityRecord[]) line: 1000
ActivityStarter.startActivity(IApplicationThread, Intent, Intent, String, ActivityInfo, ResolveInfo, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, int, String, int, int, int, ActivityOptions, boolean, boolean, ActivityRecord[], TaskRecord) line: 577
ActivityStarter.startActivityLocked(IApplicationThread, Intent, Intent, String, ActivityInfo, ResolveInfo, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, int, String, int, int, int, ActivityOptions, boolean, boolean, ActivityRecord[], TaskRecord, String) line: 283
ActivityStarter.startActivityMayWait(IApplicationThread, int, String, Intent, String, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, ProfilerInfo, WaitResult, Configuration, Bundle, boolean, int, TaskRecord, String) line: 822
ActivityManagerService.startActivityAsUser(IApplicationThread, String, Intent, String, IBinder, String, int, int, ProfilerInfo, Bundle, int) line: 4622
ActivityManagerService.startActivity(IApplicationThread, String, Intent, String, IBinder, String, int, int, ProfilerInfo, Bundle) line: 4609
ActivityManagerService(IActivityManager$Stub).onTransact(int, Parcel, Parcel, int) line: 121
ActivityManagerService.onTransact(int, Parcel, Parcel, int) line: 2977
ActivityManagerService(Binder).execTransact(int, long, long, int) line: 697

Thread [android.anim] (Suspended (breakpoint at line 609 in WindowState))
owns: WindowHashMap (id=460)
WindowState.(WindowManagerService, Session, IWindow, WindowToken, WindowState, int, int, WindowManager$LayoutParams, int, int, boolean) line: 609
WindowManagerService.addWindow(Session, IWindow, int, WindowManager$LayoutParams, int, int, Rect, Rect, Rect, InputChannel) line: 1396
Session.addToDisplay(IWindow, int, WindowManager$LayoutParams, int, int, Rect, Rect, Rect, InputChannel) line: 202
TaskSnapshotSurface.create(WindowManagerService, AppWindowToken, ActivityManager$TaskSnapshot) line: 199
TaskSnapshotController.createStartingSurface(AppWindowToken, ActivityManager$TaskSnapshot) line: 203
SnapshotStartingData.createStartingSurface(AppWindowToken) line: 39
AppWindowContainerController.lambda$-com_android_server_wm_AppWindowContainerController_4735() line: 145
-$Lambda$aEpJ2RCAIjecjyIIYTv6ricEwh4.$m$4() line: not available
-$Lambda$aEpJ2RCAIjecjyIIYTv6ricEwh4.run() line: not available
Handler.handleCallback(Message) line: 790
Handler.dispatchMessage(Message) line: 99
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

这里释放WindowState

Thread [android.anim] (Suspended (breakpoint at line 1746 in WindowManagerService))
owns: WindowHashMap (id=460)
WindowManagerService.postWindowRemoveCleanupLocked(WindowState) line: 1746
WindowState.removeImmediately() line: 1842
WindowState.destroySurface(boolean, boolean) line: 2842
AppWindowToken.destroySurfaces(boolean) line: 649
AppWindowToken.destroySurfaces() line: 633
WindowState.onExitAnimationDone() line: 4257
WindowStateAnimator.stepAnimationLocked(long) line: 474
DisplayContent.lambda$-com_android_server_wm_DisplayContent_16102(WindowState) line: 339
-$Lambda$YIZfR4m-B8z_tYbP2x4OJ3o7OYE.$m$3(Object) line: not available
-$Lambda$YIZfR4m-B8z_tYbP2x4OJ3o7OYE.accept(Object) line: not available
WindowContainer$ForAllWindowsConsumerWrapper.apply(WindowState) line: 779
WindowContainer$ForAllWindowsConsumerWrapper.apply(Object) line: 777
WindowState.applyInOrderWithImeWindows(ToBooleanFunction, boolean) line: 4128
WindowState.forAllWindows(ToBooleanFunction, boolean) line: 4035
AppWindowToken(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
AppWindowToken.forAllWindowsUnchecked(ToBooleanFunction, boolean) line: 1549
AppWindowToken.forAllWindows(ToBooleanFunction, boolean) line: 1544
Task(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
TaskStack(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
DisplayContent$TaskStackContainers(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
DisplayContent$TaskStackContainers.forAllWindows(ToBooleanFunction, boolean) line: 3405
DisplayContent.forAllWindows(ToBooleanFunction, boolean) line: 1534
DisplayContent(WindowContainer).forAllWindows(Consumer, boolean) line: 633
DisplayContent.updateWindowsForAnimator(WindowAnimator) line: 2618
WindowAnimator.animate(long) line: 201
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

Thread [android.anim] (Suspended (breakpoint at line 1746 in WindowManagerService))
owns: WindowHashMap (id=1203)
WindowManagerService.postWindowRemoveCleanupLocked(WindowState) line: 1746
WindowState.removeImmediately() line: 1842
WindowState.destroySurface(boolean, boolean) line: 2842
AppWindowToken.destroySurfaces(boolean) line: 649
AppWindowToken.destroySurfaces() line: 633
WindowState.onExitAnimationDone() line: 4257
WindowStateAnimator.stepAnimationLocked(long) line: 474
DisplayContent.lambda$-com_android_server_wm_DisplayContent_16102(WindowState) line: 339
-$Lambda$YIZfR4m-B8z_tYbP2x4OJ3o7OYE.$m$3(Object) line: not available
-$Lambda$YIZfR4m-B8z_tYbP2x4OJ3o7OYE.accept(Object) line: not available
WindowContainer$ForAllWindowsConsumerWrapper.apply(WindowState) line: 779
WindowContainer$ForAllWindowsConsumerWrapper.apply(Object) line: 777
WindowState.applyInOrderWithImeWindows(ToBooleanFunction, boolean) line: 4128
WindowState.forAllWindows(ToBooleanFunction, boolean) line: 4035
AppWindowToken(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
AppWindowToken.forAllWindowsUnchecked(ToBooleanFunction, boolean) line: 1549
AppWindowToken.forAllWindows(ToBooleanFunction, boolean) line: 1544
Task(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
TaskStack(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
DisplayContent$TaskStackContainers(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
DisplayContent$TaskStackContainers.forAllWindows(ToBooleanFunction, boolean) line: 3405
DisplayContent.forAllWindows(ToBooleanFunction, boolean) line: 1534
DisplayContent(WindowContainer).forAllWindows(Consumer, boolean) line: 633
DisplayContent.updateWindowsForAnimator(WindowAnimator) line: 2618
WindowAnimator.animate(long) line: 201
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

Class Name | Shallow Heap | Retained Heap

mAllAppWinAnimators com.android.server.wm.AppWindowAnimator @ 0x14eed5c0| 96 | 288

Class Name | Shallow Heap | Retained Heap

mAppAnimator com.android.server.wm.AppWindowToken @ 0x14eeac40| 200 | 1,272

Thread [android.ui] (Suspended (breakpoint at line 844 in DisplayContent))
owns: WindowHashMap (id=460)
owns: ViewRootImpl (id=1036)
owns: Object (id=538)
DisplayContent.reParentWindowToken(WindowToken) line: 844
WindowToken.onDisplayChanged(DisplayContent) line: 247
WindowToken.(WindowManagerService, IBinder, int, boolean, DisplayContent, boolean) line: 111
WindowManagerService.addWindow(Session, IWindow, int, WindowManager$LayoutParams, int, int, Rect, Rect, Rect, InputChannel) line: 1329
Session.addToDisplay(IWindow, int, WindowManager$LayoutParams, int, int, Rect, Rect, Rect, InputChannel) line: 202
ViewRootImpl.setView(View, WindowManager$LayoutParams, View) line: 730
WindowManagerGlobal.addView(View, ViewGroup$LayoutParams, Display, Window) line: 356
WindowManagerImpl.addView(View, ViewGroup$LayoutParams) line: 94
AppNotRespondingDialog(Dialog).show() line: 330
AppErrors.handleShowAnrUi(Message) line: 1065
ActivityManagerService$UiHandler.handleMessage(Message) line: 1817
ActivityManagerService$UiHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
UiThread(HandlerThread).run() line: 65
UiThread(ServiceThread).run() line: 46
UiThread.run() line: 42


这里退出应用

调用cancelAnimation()的条件是:

if (!mAnimating) {
    cancelAnimation();
}

Thread [android.anim] (Suspended (breakpoint at line 413 in WindowAnimator))
owns: WindowHashMap (id=1203)
WindowAnimator.cancelAnimation() line: 413
WindowAnimator.animate(long) line: 231
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

Thread [android.anim] (Suspended (breakpoint at line 435 in WindowAnimator))
owns: WindowHashMap (id=1203)
WindowAnimator.setAnimating(boolean) line: 435
DisplayContent.lambda$-com_android_server_wm_DisplayContent_18415(WindowState) line: 408
-$Lambda$YIZfR4m-B8z_tYbP2x4OJ3o7OYE.$m$4(Object) line: not available
-$Lambda$YIZfR4m-B8z_tYbP2x4OJ3o7OYE.accept(Object) line: not available
WindowContainer$ForAllWindowsConsumerWrapper.apply(WindowState) line: 779
WindowContainer$ForAllWindowsConsumerWrapper.apply(Object) line: 777
WindowState.applyInOrderWithImeWindows(ToBooleanFunction, boolean) line: 4128
WindowState.forAllWindows(ToBooleanFunction, boolean) line: 4035
AppWindowToken(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
AppWindowToken.forAllWindowsUnchecked(ToBooleanFunction, boolean) line: 1549
AppWindowToken.forAllWindows(ToBooleanFunction, boolean) line: 1544
Task(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
TaskStack(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
DisplayContent$TaskStackContainers(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
DisplayContent$TaskStackContainers.forAllWindows(ToBooleanFunction, boolean) line: 3405
DisplayContent.forAllWindows(ToBooleanFunction, boolean) line: 1534
DisplayContent(WindowContainer).forAllWindows(Consumer, boolean) line: 633
DisplayContent.updateWallpaperForAnimator(WindowAnimator) line: 2628
WindowAnimator.animate(long) line: 202
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=1203)
WindowAnimator.scheduleAnimation() line: 407
WindowManagerService.scheduleAnimationLocked() line: 5988
RootWindowContainer.performSurfacePlacement(boolean) line: 824
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowSurfacePlacer.performSurfacePlacement() line: 135
WindowSurfacePlacer.lambda$-com_android_server_wm_WindowSurfacePlacer_5337() line: 108
-$Lambda$aEpJ2RCAIjecjyIIYTv6ricEwh4.$m$12() line: not available
-$Lambda$aEpJ2RCAIjecjyIIYTv6ricEwh4.run() line: not available
Handler.handleCallback(Message) line: 790
Handler.dispatchMessage(Message) line: 99
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46


调用scheduleAnimation APP DIED

Thread [Binder:14721_1] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=1203)
owns: ActivityManagerService (id=1204)
WindowAnimator.scheduleAnimation() line: 407
WindowManagerService.scheduleAnimationLocked() line: 5988
RootWindowContainer.performSurfacePlacement(boolean) line: 824
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowSurfacePlacer.performSurfacePlacement() line: 135
WindowSurfacePlacer.continueLayout() line: 126
WindowManagerService.continueSurfaceLayout() line: 2966
ActivityManagerService.handleAppDiedLocked(ProcessRecord, boolean, boolean) line: 5435
ActivityManagerService.appDiedLocked(ProcessRecord, int, IApplicationThread, boolean) line: 5594
ActivityManagerService$AppDeathRecipient.binderDied() line: 1641
BinderProxy.sendDeathNotice(IBinder$DeathRecipient) line: 844

启动APP

Thread [Binder:14721_15] (Suspended (breakpoint at line 593 in AppWindowContainerController))
owns: WindowHashMap (id=1203)
owns: ActivityManagerService (id=1204)
AppWindowContainerController.scheduleAddStartingWindow() line: 593
AppWindowContainerController.createSnapshot(ActivityManager$TaskSnapshot) line: 603
AppWindowContainerController.addStartingWindow(String, int, CompatibilityInfo, CharSequence, int, int, int, int, IBinder, boolean, boolean, boolean, boolean, boolean, boolean) line: 502
ActivityRecord.showStartingWindow(ActivityRecord, boolean, boolean, boolean) line: 2241
ActivityRecord.showStartingWindow(ActivityRecord, boolean, boolean) line: 2226
ActivityStarter.setTargetStackAndMoveToFrontIfNeeded(ActivityRecord) line: 1657
ActivityStarter.startActivityUnchecked(ActivityRecord, ActivityRecord, IVoiceInteractionSession, IVoiceInteractor, int, boolean, ActivityOptions, TaskRecord, ActivityRecord[]) line: 1096
ActivityStarter.startActivity(ActivityRecord, ActivityRecord, IVoiceInteractionSession, IVoiceInteractor, int, boolean, ActivityOptions, TaskRecord, ActivityRecord[]) line: 1000
ActivityStarter.startActivity(IApplicationThread, Intent, Intent, String, ActivityInfo, ResolveInfo, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, int, String, int, int, int, ActivityOptions, boolean, boolean, ActivityRecord[], TaskRecord) line: 577
ActivityStarter.startActivityLocked(IApplicationThread, Intent, Intent, String, ActivityInfo, ResolveInfo, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, int, String, int, int, int, ActivityOptions, boolean, boolean, ActivityRecord[], TaskRecord, String) line: 283
ActivityStarter.startActivityMayWait(IApplicationThread, int, String, Intent, String, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, ProfilerInfo, WaitResult, Configuration, Bundle, boolean, int, TaskRecord, String) line: 822
ActivityManagerService.startActivityAsUser(IApplicationThread, String, Intent, String, IBinder, String, int, int, ProfilerInfo, Bundle, int) line: 4622
ActivityManagerService.startActivity(IApplicationThread, String, Intent, String, IBinder, String, int, int, ProfilerInfo, Bundle) line: 4609
ActivityManagerService(IActivityManager$Stub).onTransact(int, Parcel, Parcel, int) line: 121
ActivityManagerService.onTransact(int, Parcel, Parcel, int) line: 2977
ActivityManagerService(Binder).execTransact(int, long, long, int) line: 697

启动APP
Thread [Binder:14721_15] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=1203)
owns: ActivityManagerService (id=1204)
WindowAnimator.scheduleAnimation() line: 407
WindowManagerService.scheduleAnimationLocked() line: 5988
RootWindowContainer.performSurfacePlacement(boolean) line: 824
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowSurfacePlacer.performSurfacePlacement() line: 135
WindowSurfacePlacer.continueLayout() line: 126
WindowManagerService.continueSurfaceLayout() line: 2966
ActivityStarter.startActivity(ActivityRecord, ActivityRecord, IVoiceInteractionSession, IVoiceInteractor, int, boolean, ActivityOptions, TaskRecord, ActivityRecord[]) line: 1010
ActivityStarter.startActivity(IApplicationThread, Intent, Intent, String, ActivityInfo, ResolveInfo, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, int, String, int, int, int, ActivityOptions, boolean, boolean, ActivityRecord[], TaskRecord) line: 577
ActivityStarter.startActivityLocked(IApplicationThread, Intent, Intent, String, ActivityInfo, ResolveInfo, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, int, String, int, int, int, ActivityOptions, boolean, boolean, ActivityRecord[], TaskRecord, String) line: 283
ActivityStarter.startActivityMayWait(IApplicationThread, int, String, Intent, String, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, ProfilerInfo, WaitResult, Configuration, Bundle, boolean, int, TaskRecord, String) line: 822
ActivityManagerService.startActivityAsUser(IApplicationThread, String, Intent, String, IBinder, String, int, int, ProfilerInfo, Bundle, int) line: 4622
ActivityManagerService.startActivity(IApplicationThread, String, Intent, String, IBinder, String, int, int, ProfilerInfo, Bundle) line: 4609
ActivityManagerService(IActivityManager$Stub).onTransact(int, Parcel, Parcel, int) line: 121
ActivityManagerService.onTransact(int, Parcel, Parcel, int) line: 2977
ActivityManagerService(Binder).execTransact(int, long, long, int) line: 697

mAddStartingWindow 新增 WindowState

Thread [Binder:14721_15] (Suspended (breakpoint at line 762 in WindowSurfacePlacer))
owns: WindowHashMap (id=1203)
owns: ActivityManagerService (id=1204)
WindowSurfacePlacer.requestTraversal() line: 762
WindowSurfacePlacer.performSurfacePlacementLoop() line: 203
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowSurfacePlacer.performSurfacePlacement() line: 135
WindowSurfacePlacer.continueLayout() line: 126
WindowManagerService.continueSurfaceLayout() line: 2966
ActivityStarter.startActivity(ActivityRecord, ActivityRecord, IVoiceInteractionSession, IVoiceInteractor, int, boolean, ActivityOptions, TaskRecord, ActivityRecord[]) line: 1010
ActivityStarter.startActivity(IApplicationThread, Intent, Intent, String, ActivityInfo, ResolveInfo, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, int, String, int, int, int, ActivityOptions, boolean, boolean, ActivityRecord[], TaskRecord) line: 577
ActivityStarter.startActivityLocked(IApplicationThread, Intent, Intent, String, ActivityInfo, ResolveInfo, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, int, String, int, int, int, ActivityOptions, boolean, boolean, ActivityRecord[], TaskRecord, String) line: 283
ActivityStarter.startActivityMayWait(IApplicationThread, int, String, Intent, String, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, ProfilerInfo, WaitResult, Configuration, Bundle, boolean, int, TaskRecord, String) line: 822
ActivityManagerService.startActivityAsUser(IApplicationThread, String, Intent, String, IBinder, String, int, int, ProfilerInfo, Bundle, int) line: 4622
ActivityManagerService.startActivity(IApplicationThread, String, Intent, String, IBinder, String, int, int, ProfilerInfo, Bundle) line: 4609
ActivityManagerService(IActivityManager$Stub).onTransact(int, Parcel, Parcel, int) line: 121
ActivityManagerService.onTransact(int, Parcel, Parcel, int) line: 2977
ActivityManagerService(Binder).execTransact(int, long, long, int) line: 697

Thread [android.anim] (Suspended (breakpoint at line 762 in WindowSurfacePlacer))
owns: WindowHashMap (id=1203)
WindowSurfacePlacer.requestTraversal() line: 762
WindowManagerService.finishDrawingWindow(Session, IWindow) line: 2363
Session.finishDrawing(IWindow) line: 275
TaskSnapshotSurface.reportDrawn() line: 402
TaskSnapshotSurface.drawSnapshot() line: 292
TaskSnapshotSurface.create(WindowManagerService, AppWindowToken, ActivityManager$TaskSnapshot) line: 222
TaskSnapshotController.createStartingSurface(AppWindowToken, ActivityManager$TaskSnapshot) line: 203
SnapshotStartingData.createStartingSurface(AppWindowToken) line: 39
AppWindowContainerController.lambda$-com_android_server_wm_AppWindowContainerController_4735() line: 145
-$Lambda$aEpJ2RCAIjecjyIIYTv6ricEwh4.$m$4() line: not available
-$Lambda$aEpJ2RCAIjecjyIIYTv6ricEwh4.run() line: not available
Handler.handleCallback(Message) line: 790
Handler.dispatchMessage(Message) line: 99
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

setAnimating 为true 就不会退出

Thread [android.anim] (Suspended (breakpoint at line 435 in WindowAnimator))
owns: WindowHashMap (id=1203)
WindowAnimator.setAnimating(boolean) line: 435
DisplayContent.lambda$-com_android_server_wm_DisplayContent_18415(WindowState) line: 408
-$Lambda$YIZfR4m-B8z_tYbP2x4OJ3o7OYE.$m$4(Object) line: not available
-$Lambda$YIZfR4m-B8z_tYbP2x4OJ3o7OYE.accept(Object) line: not available
WindowContainer$ForAllWindowsConsumerWrapper.apply(WindowState) line: 779
WindowContainer$ForAllWindowsConsumerWrapper.apply(Object) line: 777
WindowState.applyInOrderWithImeWindows(ToBooleanFunction, boolean) line: 4128
WindowState.forAllWindows(ToBooleanFunction, boolean) line: 4035
AppWindowToken(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
AppWindowToken.forAllWindowsUnchecked(ToBooleanFunction, boolean) line: 1549
AppWindowToken.forAllWindows(ToBooleanFunction, boolean) line: 1544
Task(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
TaskStack(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
DisplayContent$TaskStackContainers(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
DisplayContent$TaskStackContainers.forAllWindows(ToBooleanFunction, boolean) line: 3405
DisplayContent.forAllWindows(ToBooleanFunction, boolean) line: 1534
DisplayContent(WindowContainer).forAllWindows(Consumer, boolean) line: 633
DisplayContent.updateWallpaperForAnimator(WindowAnimator) line: 2628
WindowAnimator.animate(long) line: 202
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65

if (winAnimator.mAnimating) {
    if (winAnimator.mAnimation != null) {
        if ((flags & FLAG_SHOW_WALLPAPER) != 0
                && winAnimator.mAnimation.getDetachWallpaper()) {
            mTmpWindow = w;
        }
        final int color = winAnimator.mAnimation.getBackgroundColor();
        if (color != 0) {
            final TaskStack stack = w.getStack();
            if (stack != null) {
                stack.setAnimationBackground(winAnimator, color);
            }
        }
    }
    mTmpWindowAnimator.setAnimating(true);
}

Thread [Binder:14721_15] (Suspended (breakpoint at line 762 in WindowSurfacePlacer))
owns: WindowHashMap (id=1203)
owns: ActivityManagerService (id=1204)
WindowSurfacePlacer.requestTraversal() line: 762
WindowSurfacePlacer.performSurfacePlacementLoop() line: 203
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowSurfacePlacer.performSurfacePlacement() line: 135
WindowSurfacePlacer.continueLayout() line: 126
WindowManagerService.continueSurfaceLayout() line: 2966
ActivityStack.activityPausedLocked(IBinder, boolean) line: 1427
ActivityManagerService.activityPaused(IBinder) line: 7609
ActivityManagerService(IActivityManager$Stub).onTransact(int, Parcel, Parcel, int) line: 317
ActivityManagerService.onTransact(int, Parcel, Parcel, int) line: 2977
ActivityManagerService(Binder).execTransact(int, long, long, int) line: 697

06-27 17:04:11.047 835 2286 V WindowManager: Starting animation in AppWindowToken{b6799a3 token=Token{d5ffdc3 ActivityRecord{d112627 u0 com.android.launcher3/.Launcher t13}}} @ 23774931 scale=1.0 allDrawn=true animating=false
06-27 17:04:11.048 835 2286 V WindowManager: Starting animation in AppWindowToken{fcdff0a token=Token{ad2718b ActivityRecord{51a9a7c u0 com.android.dialer/.app.DialtactsActivity t193}}} @ 23774931 scale=1.0 allDrawn=true animating=false
06-27 17:04:11.106 835 2286 I WindowManager: SURFACE POS (setPositionInTransaction) @ (0.0,9.0): com.android.dialer/com.android.dialer.app.DialtactsActivity
06-27 17:04:11.122 835 2286 I WindowManager: <<< CLOSE TRANSACTION animate
06-27 17:04:11.596 835 2286 I WindowManager: >>> OPEN TRANSACTION animate
06-27 17:04:11.650 835 2286 I WindowManager: SURFACE POS (setPositionInTransaction) @ (0.0,322.0): com.android.dialer/com.android.dialer.app.DialtactsActivity
06-27 17:04:11.661 835 2286 I WindowManager: <<< CLOSE TRANSACTION animate
06-27 17:04:11.663 835 2286 I WindowManager: >>> OPEN TRANSACTION animate
06-27 17:04:11.714 835 2286 I WindowManager: SURFACE POS (setPositionInTransaction) @ (0.0,939.0): com.android.dialer/com.android.dialer.app.DialtactsActivity
06-27 17:04:11.727 835 2286 I WindowManager: <<< CLOSE TRANSACTION animate
06-27 17:04:11.739 835 2286 I WindowManager: >>> OPEN TRANSACTION animate
06-27 17:04:11.740 835 2286 V WindowManager: Animation done in AppWindowToken{b6799a3 token=Token{d5ffdc3 ActivityRecord{d112627 u0 com.android.launcher3/.Launcher t13}}}: reportedVisible=false okToDisplay=true okToAnimate=true startingDisplayed=false
06-27 17:04:11.775 835 2286 V WindowManager: Animation done in AppWindowToken{fcdff0a token=Token{ad2718b ActivityRecord{51a9a7c u0 com.android.dialer/.app.DialtactsActivity t193}}}: reportedVisible=false okToDisplay=true okToAnimate=true startingDisplayed=false
06-27 17:04:11.790 835 2286 V WindowManager: Animation done in WindowStateAnimator{c28623a com.android.launcher3/com.android.launcher3.Launcher}: exiting=false, reportedVisible=true
06-27 17:04:11.791 835 2286 V WindowManager: Animation done in WindowStateAnimator{1cf447c com.android.dialer/com.android.dialer.app.DialtactsActivity}: exiting=true, reportedVisible=false
06-27 17:04:11.826 835 2286 I WindowManager: SURFACE POS (setPositionInTransaction) @ (0.0,0.0): com.android.dialer/com.android.dialer.app.DialtactsActivity

void scheduleAnimation()

  1. 动画启动流程
  2. Winstate为什么没有释放
  3. 为什么forallwindows会走那么久

    void requestTraversal() {

    if (!mTraversalScheduled) {
        mTraversalScheduled = true;
        mService.mAnimationHandler.post(mPerformSurfacePlacement); //替换?
    }
    

    }

启动APP时调用动画:

Thread [Binder:14721_16] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=1203)
owns: ActivityManagerService (id=1204)
WindowAnimator.scheduleAnimation() line: 407
WindowManagerService.scheduleAnimationLocked() line: 5988
RootWindowContainer.performSurfacePlacement(boolean) line: 824
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowSurfacePlacer.performSurfacePlacement() line: 135
WindowSurfacePlacer.continueLayout() line: 126
WindowManagerService.continueSurfaceLayout() line: 2966
ActivityStarter.startActivity(ActivityRecord, ActivityRecord, IVoiceInteractionSession, IVoiceInteractor, int, boolean, ActivityOptions, TaskRecord, ActivityRecord[]) line: 1010
ActivityStarter.startActivity(IApplicationThread, Intent, Intent, String, ActivityInfo, ResolveInfo, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, int, String, int, int, int, ActivityOptions, boolean, boolean, ActivityRecord[], TaskRecord) line: 577
ActivityStarter.startActivityLocked(IApplicationThread, Intent, Intent, String, ActivityInfo, ResolveInfo, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, int, String, int, int, int, ActivityOptions, boolean, boolean, ActivityRecord[], TaskRecord, String) line: 283
ActivityStarter.startActivityMayWait(IApplicationThread, int, String, Intent, String, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, ProfilerInfo, WaitResult, Configuration, Bundle, boolean, int, TaskRecord, String) line: 822
ActivityManagerService.startActivityAsUser(IApplicationThread, String, Intent, String, IBinder, String, int, int, ProfilerInfo, Bundle, int) line: 4622
ActivityManagerService.startActivity(IApplicationThread, String, Intent, String, IBinder, String, int, int, ProfilerInfo, Bundle) line: 4609
ActivityManagerService(IActivityManager$Stub).onTransact(int, Parcel, Parcel, int) line: 121
ActivityManagerService.onTransact(int, Parcel, Parcel, int) line: 2977
ActivityManagerService(Binder).execTransact(int, long, long, int) line: 697

第一次进入animate 会再次调用 scheduleAnimation() 是否下次还需要走 animate 取决与条件 mAnimationFrameCallbackScheduled
mAnimationFrameCallbackScheduled初始话默认是 false

void scheduleAnimation() {
    if (!mAnimationFrameCallbackScheduled) {
        mAnimationFrameCallbackScheduled = true;
        mChoreographer.postFrameCallback(mAnimationFrameCallback);
    }
}

取消下一次 animate 即 mChoreographer.removeFrameCallback(mAnimationFrameCallback);
private void cancelAnimation() {
if (mAnimationFrameCallbackScheduled) {
mAnimationFrameCallbackScheduled = false;
mChoreographer.removeFrameCallback(mAnimationFrameCallback);
}
}

但是函数里面有一个判断条件:
if (mService.mDragState != null) {
mAnimating |= mService.mDragState.stepAnimationLocked(mCurrentTime);
}

if (!mAnimating) {
    cancelAnimation();
}

整体的代码如下:
private void animate(long frameTimeNs) {

    synchronized (mService.mWindowMap) {
        if (!mInitialized) {
            return;
        }

        // Schedule next frame already such that back-pressure happens continuously
        scheduleAnimation();                                    //这里先预定下一帧
    }

    // Simulate back-pressure by opening and closing an empty animation transaction. This makes
    // sure that an animation frame is at least presented once on the screen. We do this outside
    // of the regular transaction such that we can avoid holding the window manager lock in case
    // we receive back-pressure from SurfaceFlinger. Since closing an animation transaction
    // without the window manager locks leads to ordering issues (as the transaction will be
    // processed only at the beginning of the next frame which may result in another transaction
    // that was executed later in WM side gets executed first on SF side), we don't update any
    // Surface properties here such that reordering doesn't cause issues.
    mService.executeEmptyAnimationTransaction();

    synchronized (mService.mWindowMap) {
        mCurrentTime = frameTimeNs / TimeUtils.NANOS_PER_MS;
        mBulkUpdateParams = SET_ORIENTATION_CHANGE_COMPLETE;
        mAnimating = false;                                    //每次都会设置为false
        mAppWindowAnimating = false;
        if (DEBUG_WINDOW_TRACE) {
            Slog.i(TAG, "!!! animate: entry time=" + mCurrentTime);
        }

        if (SHOW_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION animate");
        mService.openSurfaceTransaction();
        try {
            final AccessibilityController accessibilityController =
                    mService.mAccessibilityController;
            final int numDisplays = mDisplayContentsAnimators.size();
            for (int i = 0; i < numDisplays; i++) {
                final int displayId = mDisplayContentsAnimators.keyAt(i);
                final DisplayContent dc = mService.mRoot.getDisplayContentOrCreate(displayId);
                dc.stepAppWindowsAnimation(mCurrentTime); //这里也可能会置mAppAnimator.animating = true; //这里设置为true
                DisplayContentsAnimator displayAnimator = mDisplayContentsAnimators.valueAt(i);

                final ScreenRotationAnimation screenRotationAnimation =
                        displayAnimator.mScreenRotationAnimation;
                if (screenRotationAnimation != null && screenRotationAnimation.isAnimating()) {
                    if (screenRotationAnimation.stepAnimationLocked(mCurrentTime)) {
                        setAnimating(true);
                    } else {
                        mBulkUpdateParams |= SET_UPDATE_ROTATION;
                        screenRotationAnimation.kill();
                        displayAnimator.mScreenRotationAnimation = null;

                        //TODO (multidisplay): Accessibility supported only for the default
                        // display.
                        if (accessibilityController != null && dc.isDefaultDisplay) {
                            // We just finished rotation animation which means we did not
                            // announce the rotation and waited for it to end, announce now.
                            accessibilityController.onRotationChangedLocked(
                                    mService.getDefaultDisplayContentLocked());
                        }
                    }
                }

                // Update animations of all applications, including those
                // associated with exiting/removed apps
                ++mAnimTransactionSequence;
                dc.updateWindowsForAnimator(this);      // 这里轮寻windows 可能会把 winAnimator.mAnimating 置为 true,这样可以影响下一个函数
                dc.updateWallpaperForAnimator(this);    // 这里有可能会把this.mAnimating 设置为true,mUpdateWallpaperForAnimator
                dc.prepareWindowSurfaces();
            }

            for (int i = 0; i < numDisplays; i++) {
                final int displayId = mDisplayContentsAnimators.keyAt(i);
                final DisplayContent dc = mService.mRoot.getDisplayContentOrCreate(displayId);

                dc.checkAppWindowsReadyToShow();

                final ScreenRotationAnimation screenRotationAnimation =
                        mDisplayContentsAnimators.valueAt(i).mScreenRotationAnimation;
                if (screenRotationAnimation != null) {
                    screenRotationAnimation.updateSurfacesInTransaction();
                }

                orAnimating(dc.animateDimLayers());
                orAnimating(dc.getDockedDividerController().animate(mCurrentTime));
                //TODO (multidisplay): Magnification is supported only for the default display.
                if (accessibilityController != null && dc.isDefaultDisplay) {
                    accessibilityController.drawMagnifiedRegionBorderIfNeededLocked();
                }
            }

            if (mService.mDragState != null) {
                mAnimating |= mService.mDragState.stepAnimationLocked(mCurrentTime);
            }

            if (!mAnimating) {  //这里不为false 时, 就不会取消cancelAnimation.意味着animate 还需要再跑一次,
                cancelAnimation(); //对应scheduleAnimation(),取消调预定的那一帧
            }

            if (mService.mWatermark != null) {
                mService.mWatermark.drawIfNeeded();
            }
        } catch (RuntimeException e) {
            Slog.wtf(TAG, "Unhandled exception in Window Manager", e);
        } finally {
            mService.closeSurfaceTransaction();
            if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION animate");
        }

        boolean hasPendingLayoutChanges = mService.mRoot.hasPendingLayoutChanges(this);
        boolean doRequest = false;
        if (mBulkUpdateParams != 0) {
            doRequest = mService.mRoot.copyAnimToLayoutParams();
        }

        if (hasPendingLayoutChanges || doRequest) {
            mWindowPlacerLocked.requestTraversal();
        }

        if (mAnimating && !mLastAnimating) {

            // Usually app transitions but quite a load onto the system already (with all the
            // things happening in app), so pause task snapshot persisting to not increase the
            // load.
            mService.mTaskSnapshotController.setPersisterPaused(true);
            Trace.asyncTraceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "animating", 0);
        }
        if (!mAnimating && mLastAnimating) {
            mWindowPlacerLocked.requestTraversal();
            mService.mTaskSnapshotController.setPersisterPaused(false);
            Trace.asyncTraceEnd(Trace.TRACE_TAG_WINDOW_MANAGER, "animating", 0);
        }

        mLastAnimating = mAnimating;

        if (mRemoveReplacedWindows) {
            mService.mRoot.removeReplacedWindows();
            mRemoveReplacedWindows = false;
        }

        mService.stopUsingSavedSurfaceLocked();
        mService.destroyPreservedSurfaceLocked();
        mService.mWindowPlacerLocked.destroyPendingSurfaces();

        if (DEBUG_WINDOW_TRACE) {
            Slog.i(TAG, "!!! animate: exit mAnimating=" + mAnimating
                    + " mBulkUpdateParams=" + Integer.toHexString(mBulkUpdateParams)
                    + " mPendingLayoutChanges(DEFAULT_DISPLAY)="
                    + Integer.toHexString(getPendingLayoutChanges(DEFAULT_DISPLAY)));
        }
    }
}

Thread [android.anim] (Suspended (breakpoint at line 435 in WindowAnimator))
owns: WindowHashMap (id=1203)

WindowAnimator.setAnimating(boolean) line: 435    

private final Consumer<WindowState> mUpdateWallpaperForAnimator = w -> { //这是一个回调函数 ,所有的window都会执行这个函数forallwindows
    final WindowStateAnimator winAnimator = w.mWinAnimator;
    if (winAnimator.mSurfaceController == null || !winAnimator.hasSurface()) {
        return;
    }

    final int flags = w.mAttrs.flags;

    // If this window is animating, make a note that we have an animating window and take
    // care of a request to run a detached wallpaper animation.
    if (winAnimator.mAnimating) {
        //这个条件决定是否把mAnimating置为true,如果置为true之后,就不会cancelAnimation(),animate 下一次还会执行
        if (winAnimator.mAnimation != null) {
            if ((flags & FLAG_SHOW_WALLPAPER) != 0
                    && winAnimator.mAnimation.getDetachWallpaper()) {
                mTmpWindow = w;
            }
            final int color = winAnimator.mAnimation.getBackgroundColor();
            if (color != 0) {
                final TaskStack stack = w.getStack();
                if (stack != null) {
                    stack.setAnimationBackground(winAnimator, color);
                }
            }
        }
        mTmpWindowAnimator.setAnimating(true);
    }

DisplayContent.lambda$-com_android_server_wm_DisplayContent_18415(WindowState) line: 408    
-$Lambda$YIZfR4m-B8z_tYbP2x4OJ3o7OYE.$m$4(Object) line: not available    
-$Lambda$YIZfR4m-B8z_tYbP2x4OJ3o7OYE.accept(Object) line: not available    
WindowContainer$ForAllWindowsConsumerWrapper.apply(WindowState) line: 779    
WindowContainer$ForAllWindowsConsumerWrapper.apply(Object) line: 777    
WindowState.applyInOrderWithImeWindows(ToBooleanFunction, boolean) line: 4128    
WindowState.forAllWindows(ToBooleanFunction, boolean) line: 4035    
AppWindowToken(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616    
AppWindowToken.forAllWindowsUnchecked(ToBooleanFunction, boolean) line: 1549    
AppWindowToken.forAllWindows(ToBooleanFunction, boolean) line: 1544    
Task(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616    
TaskStack(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616    
DisplayContent$TaskStackContainers(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616    
DisplayContent$TaskStackContainers.forAllWindows(ToBooleanFunction, boolean) line: 3405    
DisplayContent.forAllWindows(ToBooleanFunction, boolean) line: 1534    
DisplayContent(WindowContainer).forAllWindows(Consumer, boolean) line: 633    
DisplayContent.updateWallpaperForAnimator(WindowAnimator) line: 2628    
WindowAnimator.animate(long) line: 202

dc.updateWallpaperForAnimator(this);

WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105    
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available    
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available    
Choreographer$CallbackRecord.run(long) line: 964    
Choreographer.doCallbacks(int, long) line: 778    
Choreographer.doFrame(long, int) line: 710    
Choreographer$FrameHandler.handleMessage(Message) line: 881    
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106    
Looper.loop() line: 164    
AnimationThread(HandlerThread).run() line: 65    
AnimationThread(ServiceThread).run() line: 46    

下面的这个调用堆栈,把winAnimator.mAnimating 置为了true

Thread [android.anim] (Suspended (breakpoint at line 423 in WindowStateAnimator))
owns: WindowHashMap (id=1203)
WindowStateAnimator.stepAnimationLocked(long) line: 423
DisplayContent.lambda$-com_android_server_wm_DisplayContent_16102(WindowState) line: 339
-$Lambda$YIZfR4m-B8z_tYbP2x4OJ3o7OYE.$m$3(Object) line: not available
-$Lambda$YIZfR4m-B8z_tYbP2x4OJ3o7OYE.accept(Object) line: not available
WindowContainer$ForAllWindowsConsumerWrapper.apply(WindowState) line: 779
WindowContainer$ForAllWindowsConsumerWrapper.apply(Object) line: 777
WindowState.applyInOrderWithImeWindows(ToBooleanFunction, boolean) line: 4128
WindowState.forAllWindows(ToBooleanFunction, boolean) line: 4035
AppWindowToken(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
AppWindowToken.forAllWindowsUnchecked(ToBooleanFunction, boolean) line: 1549
AppWindowToken.forAllWindows(ToBooleanFunction, boolean) line: 1544
Task(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
TaskStack(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
DisplayContent$TaskStackContainers(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616
DisplayContent$TaskStackContainers.forAllWindows(ToBooleanFunction, boolean) line: 3405
DisplayContent.forAllWindows(ToBooleanFunction, boolean) line: 1534
DisplayContent(WindowContainer).forAllWindows(Consumer, boolean) line: 633
DisplayContent.updateWindowsForAnimator(WindowAnimator) line: 2618
WindowAnimator.animate(long) line: 201
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameHandler.handleMessage(Message) line: 881
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

这里
Thread [android.anim] (Suspended (breakpoint at line 395 in AppWindowAnimator))
owns: WindowHashMap (id=1203)
AppWindowAnimator.stepAnimationLocked(long) line: 395

mAppAnimator.animating = true;这里也会设置为true
@Override
void stepAppWindowsAnimation(long currentTime) {
    mAppAnimator.wasAnimating = mAppAnimator.animating;
    if (mAppAnimator.stepAnimationLocked(currentTime)) {
        mAppAnimator.animating = true; //这里设置为true
        mService.mAnimator.setAnimating(true);
        mService.mAnimator.mAppWindowAnimating = true;
    } else if (mAppAnimator.wasAnimating) {
        // stopped animating, do one more pass through the layout
        setAppLayoutChanges(FINISH_LAYOUT_REDO_WALLPAPER,
                DEBUG_LAYOUT_REPEATS ? "appToken " + this + " done" : null);
        if (DEBUG_ANIM) Slog.v(TAG, "updateWindowsApps...: done animating " + this);
    }
}
AppWindowToken.stepAppWindowsAnimation(long) line: 1523    
Task(WindowContainer).stepAppWindowsAnimation(long) line: 511    
TaskStack(WindowContainer).stepAppWindowsAnimation(long) line: 511    
TaskStack.stepAppWindowsAnimation(long) line: 1628    
DisplayContent$TaskStackContainers(WindowContainer).stepAppWindowsAnimation(long) line: 511    
DisplayContent(WindowContainer).stepAppWindowsAnimation(long) line: 511    
WindowAnimator.animate(long) line: 174    
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105    
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available    
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available    
Choreographer$CallbackRecord.run(long) line: 964    
Choreographer.doCallbacks(int, long) line: 778    
Choreographer.doFrame(long, int) line: 710    
Choreographer$FrameHandler.handleMessage(Message) line: 881    
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106    
Looper.loop() line: 164    
AnimationThread(HandlerThread).run() line: 65    
AnimationThread(ServiceThread).run() line: 46    






Thread [android.anim] (Suspended (breakpoint at line 291 in Animation))    
owns: WindowHashMap  (id=1203)    
AlphaAnimation(Animation).reset() line: 291    
public boolean getTransformation(long currentTime, Transformation outTransformation) {
    if (mStartTime == -1) {
        mStartTime = currentTime;
    }

    final long startOffset = getStartOffset();
    final long duration = mDuration;
    float normalizedTime;
    if (duration != 0) {
        normalizedTime = ((float) (currentTime - (mStartTime + startOffset))) /
                (float) duration;
    } else {
        // time is a step-change with a zero duration
        normalizedTime = currentTime < mStartTime ? 0.0f : 1.0f;
    }

    final boolean expired = normalizedTime >= 1.0f || isCanceled();
    mMore = !expired;

    if (!mFillEnabled) normalizedTime = Math.max(Math.min(normalizedTime, 1.0f), 0.0f);

    if ((normalizedTime >= 0.0f || mFillBefore) && (normalizedTime <= 1.0f || mFillAfter)) {
        if (!mStarted) {
            fireAnimationStart();
            mStarted = true;
            if (NoImagePreloadHolder.USE_CLOSEGUARD) {
                guard.open("cancel or detach or getTransformation");
            }
        }

        if (mFillEnabled) normalizedTime = Math.max(Math.min(normalizedTime, 1.0f), 0.0f);

        if (mCycleFlip) {
            normalizedTime = 1.0f - normalizedTime;
        }

        final float interpolatedTime = mInterpolator.getInterpolation(normalizedTime);
        applyTransformation(interpolatedTime, outTransformation);
    }

    if (expired) {
        if (mRepeatCount == mRepeated || isCanceled()) {
            if (!mEnded) {
                mEnded = true;
                guard.close();
                fireAnimationEnd();
            }
        } else {
            if (mRepeatCount > 0) {
                mRepeated++;
            }

            if (mRepeatMode == REVERSE) {
                mCycleFlip = !mCycleFlip;
            }

            mStartTime = -1;
            mMore = true;

            fireAnimationRepeat();
        }
    }

    if (!mMore && mOneMoreTime) { //这个mOneMoreTime被置为了 true
        mOneMoreTime = false;
        return true;
    }

    return mMore;
}
AlphaAnimation(Animation).initialize(int, int, int, int) line: 354    
WindowStateAnimator.stepAnimationLocked(long) line: 391    
DisplayContent.lambda$-com_android_server_wm_DisplayContent_16102(WindowState) line: 339    
-$Lambda$YIZfR4m-B8z_tYbP2x4OJ3o7OYE.$m$3(Object) line: not available    
-$Lambda$YIZfR4m-B8z_tYbP2x4OJ3o7OYE.accept(Object) line: not available    
WindowContainer$ForAllWindowsConsumerWrapper.apply(WindowState) line: 779    
WindowContainer$ForAllWindowsConsumerWrapper.apply(Object) line: 777    
WindowState.applyInOrderWithImeWindows(ToBooleanFunction, boolean) line: 4128    
WindowState.forAllWindows(ToBooleanFunction, boolean) line: 4035    
AppWindowToken(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616    
AppWindowToken.forAllWindowsUnchecked(ToBooleanFunction, boolean) line: 1549    
AppWindowToken.forAllWindows(ToBooleanFunction, boolean) line: 1544    
Task(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616    
TaskStack(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616    
DisplayContent$TaskStackContainers(WindowContainer).forAllWindows(ToBooleanFunction, boolean) line: 616    
DisplayContent$TaskStackContainers.forAllWindows(ToBooleanFunction, boolean) line: 3405    
DisplayContent.forAllWindows(ToBooleanFunction, boolean) line: 1534    
DisplayContent(WindowContainer).forAllWindows(Consumer, boolean) line: 633    
DisplayContent.updateWindowsForAnimator(WindowAnimator) line: 2618    
WindowAnimator.animate(long) line: 201    
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105    
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available    
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available    
Choreographer$CallbackRecord.run(long) line: 964    
Choreographer.doCallbacks(int, long) line: 778    
Choreographer.doFrame(long, int) line: 710    
Choreographer$FrameHandler.handleMessage(Message) line: 881    
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 106    
Looper.loop() line: 164    
AnimationThread(HandlerThread).run() line: 65    
AnimationThread(ServiceThread).run() line: 46    

Thread [Binder:835_7] (Suspended (breakpoint at line 291 in Animation))
owns: WindowHashMap (id=11972)
AlphaAnimation(Animation).reset() line: 291
AlphaAnimation(Animation).initialize(int, int, int, int) line: 354
AppWindowAnimator.setAnimation(Animation, int, int, int, int, boolean, int, int, int) line: 133
WindowManagerService.applyAnimationLocked(AppWindowToken, WindowManager$LayoutParams, int, boolean, boolean) line: 2427
AppWindowToken.setVisibility(WindowManager$LayoutParams, boolean, int, boolean, boolean) line: 372
WindowSurfacePlacer.handleClosingApps(int, WindowManager$LayoutParams, boolean, WindowSurfacePlacer$LayerAndToken) line: 461
WindowSurfacePlacer.handleAppTransitionReadyLocked() line: 344
RootWindowContainer.performSurfacePlacement(boolean) line: 615
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowManagerService.relayoutWindow(Session, IWindow, int, WindowManager$LayoutParams, int, int, int, int, Rect, Rect, Rect, Rect, Rect, Rect, Rect, MergedConfiguration, Surface) line: 2182
Session.relayout(IWindow, int, WindowManager$LayoutParams, int, int, int, int, Rect, Rect, Rect, Rect, Rect, Rect, Rect, MergedConfiguration, Surface) line: 239
Session(IWindowSession$Stub).onTransact(int, Parcel, Parcel, int) line: 286
Session.onTransact(int, Parcel, Parcel, int) line: 163
Session(Binder).execTransact(int, long, long, int) line: 697

mLocalAnimating

if ((!mLocalAnimating || mAnimationIsEntrance) && mAppAnimator != null
        && mAppAnimator.animation != null) {
    // When our app token is animating, we kind-of pretend like
    // we are as well.  Note the mLocalAnimating mAnimationIsEntrance
    // part of this check means that we will only do this if
    // our window is not currently exiting, or it is not
    // locally animating itself.  The idea being that one that
    // is exiting and doing a local animation should be removed
    // once that animation is done.
    mAnimating = true; //一直把mAnimating置为true
    mHasTransformation = true;
    mTransformation.clear();
    return false;
}



if (mWin.isDrawnLw() && mAnimation != null) {  //这个判断的关键点是mAnimation
    mHasTransformation = true;
    mHasLocalTransformation = true;
    if (!mLocalAnimating) {
        if (DEBUG_ANIM) Slog.v(
            TAG, "Starting animation in " + this +
            " @ " + currentTime + ": ww=" + mWin.mFrame.width() +
            " wh=" + mWin.mFrame.height() +
            " dx=" + mAnimDx + " dy=" + mAnimDy +
            " scale=" + mService.getWindowAnimationScaleLocked());
        final DisplayInfo displayInfo = displayContent.getDisplayInfo();
        if (mAnimateMove) {
            mAnimateMove = false;
            mAnimation.initialize(mWin.mFrame.width(), mWin.mFrame.height(),
                    mAnimDx, mAnimDy);
        } else {
            mAnimation.initialize(mWin.mFrame.width(), mWin.mFrame.height(),
                    displayInfo.appWidth, displayInfo.appHeight);
        }
        mAnimDx = displayInfo.appWidth;
        mAnimDy = displayInfo.appHeight;
        mAnimation.setStartTime(mAnimationStartTime != -1
                ? mAnimationStartTime
                : currentTime);
        mLocalAnimating = true; //这里会设置为true
        mAnimating = true;
    }

Thread [android.anim] (Suspended (breakpoint at line 271 in WindowStateAnimator))
owns: WindowHashMap (id=11972)
WindowStateAnimator.setAnimation(Animation, long, int) line: 271
public void setAnimation(Animation anim, long startTime, int stackClip) {
if (localLOGV) Slog.v(TAG, “Setting animation in “ + this + “: “ + anim);
mAnimating = false;
mLocalAnimating = false; //这里会置为false
mAnimation = anim; //并且赋值mAnimation
mAnimation.restrictDuration(WindowManagerService.MAX_ANIMATION_DURATION);
mAnimation.scaleCurrentDuration(mService.getWindowAnimationScaleLocked());
// Start out animation gone if window is gone, or visible if window is visible.
mTransformation.clear();
mTransformation.setAlpha(mLastHidden ? 0 : 1);
mHasLocalTransformation = true;
mAnimationStartTime = startTime;
mStackClip = stackClip;
}
WindowStateAnimator.setAnimation(Animation) line: 287
WindowStateAnimator.applyAnimationLocked(int, boolean) line: 1858
WindowState.removeIfPossible(boolean) line: 1946
WindowState.removeIfPossible() line: 1848
WindowManagerService.removeWindow(Session, IWindow) line: 1733
Session.remove(IWindow) line: 222
TaskSnapshotSurface.remove() line: 260
AppWindowContainerController.lambda$-com_android_server_wm_AppWindowContainerController_31045(WindowManagerPolicy$StartingSurface) line: 658
-$Lambda$aEpJ2RCAIjecjyIIYTv6ricEwh4.$m$5() line: not available
-$Lambda$aEpJ2RCAIjecjyIIYTv6ricEwh4.run() line: not available
Handler.handleCallback(Message) line: 790
Handler.dispatchMessage(Message) line: 99
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

Thread [Binder:835_1E] (Suspended (breakpoint at line 291 in Animation))
owns: WindowHashMap (id=11972)
owns: ActivityManagerService (id=12078)
AnimationSet(Animation).reset() line: 291
AnimationSet.reset() line: 488
AnimationSet(Animation).initialize(int, int, int, int) line: 354
AnimationSet.initialize(int, int, int, int) line: 425
AppTransition.createClipRevealAnimationLocked(int, boolean, Rect, Rect) line: 867
AppTransition.loadAnimation(WindowManager$LayoutParams, int, boolean, int, int, Rect, Rect, Rect, Rect, Rect, boolean, boolean, int) line: 1563
WindowManagerService.applyAnimationLocked(AppWindowToken, WindowManager$LayoutParams, int, boolean, boolean) line: 2420
AppWindowToken.setVisibility(WindowManager$LayoutParams, boolean, int, boolean, boolean) line: 372
WindowSurfacePlacer.handleOpeningApps(int, WindowManager$LayoutParams, boolean, int) line: 404
WindowSurfacePlacer.handleAppTransitionReadyLocked() line: 348
RootWindowContainer.performSurfacePlacement(boolean) line: 615
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowSurfacePlacer.performSurfacePlacement() line: 135
WindowSurfacePlacer.continueLayout() line: 126
WindowManagerService.continueSurfaceLayout() line: 2966
ActivityStack.activityPausedLocked(IBinder, boolean) line: 1427
ActivityManagerService.activityPaused(IBinder) line: 7609
ActivityManagerService(IActivityManager$Stub).onTransact(int, Parcel, Parcel, int) line: 317
ActivityManagerService.onTransact(int, Parcel, Parcel, int) line: 2977
ActivityManagerService(Binder).execTransact(int, long, long, int) line: 697

//其他进程调用 activityStopped
Thread [Binder:835_19] (Suspended (breakpoint at line 615 in AppWindowContainerController))
owns: WindowHashMap (id=11972)
owns: ActivityManagerService (id=12078)
AppWindowContainerController.removeStartingWindow() line: 615
AppWindowToken.notifyAppStopped() line: 682
AppWindowContainerController.notifyAppStopped() line: 699
ActivityRecord.activityStoppedLocked(Bundle, PersistableBundle, CharSequence) line: 1820
ActivityManagerService.activityStopped(IBinder, Bundle, PersistableBundle, CharSequence) line: 7630
ActivityManagerService(IActivityManager$Stub).onTransact(int, Parcel, Parcel, int) line: 347
ActivityManagerService.onTransact(int, Parcel, Parcel, int) line: 2977
ActivityManagerService(Binder).execTransact(int, long, long, int) line: 697

home键

Thread [InputDispatcher] (Suspended (breakpoint at line 615 in AppWindowContainerController))
owns: ActivityManagerService (id=12078)
AppWindowContainerController.removeStartingWindow() line: 615
ActivityRecord.removeOrphanedStartingWindow(boolean) line: 2256
ActivityStack.cancelInitializingActivities() line: 2236
ActivityStackSupervisor.cancelInitializingActivities() line: 1112
ActivityStack.resumeTopActivityInnerLocked(ActivityRecord, ActivityOptions) line: 2316
ActivityStack.resumeTopActivityUncheckedLocked(ActivityRecord, ActivityOptions) line: 2267
ActivityStackSupervisor.resumeFocusedStackTopActivityLocked(ActivityStack, ActivityRecord, ActivityOptions) line: 2107
ActivityStackSupervisor.resumeFocusedStackTopActivityLocked() line: 2091
ActivityStack.moveTaskToFrontLocked(TaskRecord, boolean, ActivityOptions, AppTimeTracker, String) line: 4652
ActivityStarter.setTargetStackAndMoveToFrontIfNeeded(ActivityRecord) line: 1613
ActivityStarter.startActivityUnchecked(ActivityRecord, ActivityRecord, IVoiceInteractionSession, IVoiceInteractor, int, boolean, ActivityOptions, TaskRecord, ActivityRecord[]) line: 1096
ActivityStarter.startActivity(ActivityRecord, ActivityRecord, IVoiceInteractionSession, IVoiceInteractor, int, boolean, ActivityOptions, TaskRecord, ActivityRecord[]) line: 1000
ActivityStarter.startActivity(IApplicationThread, Intent, Intent, String, ActivityInfo, ResolveInfo, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, int, String, int, int, int, ActivityOptions, boolean, boolean, ActivityRecord[], TaskRecord) line: 577
ActivityStarter.startActivityLocked(IApplicationThread, Intent, Intent, String, ActivityInfo, ResolveInfo, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, int, String, int, int, int, ActivityOptions, boolean, boolean, ActivityRecord[], TaskRecord, String) line: 283
ActivityStarter.startActivityMayWait(IApplicationThread, int, String, Intent, String, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, ProfilerInfo, WaitResult, Configuration, Bundle, boolean, int, TaskRecord, String) line: 822
ActivityManagerService.startActivityAsUser(IApplicationThread, String, Intent, String, IBinder, String, int, int, ProfilerInfo, Bundle, int) line: 4622
ContextImpl.startActivityAsUser(Intent, Bundle, UserHandle) line: 887
ContextImpl.startActivityAsUser(Intent, UserHandle) line: 861
PhoneWindowManager.startActivityAsUser(Intent, UserHandle) line: 4157
PhoneWindowManager.startDockOrHome(boolean, boolean) line: 7833
PhoneWindowManager.launchHomeFromHotKey(boolean, boolean) line: 4281
PhoneWindowManager.launchHomeFromHotKey() line: 4233
PhoneWindowManager.handleShortPressOnHome() line: 1769
PhoneWindowManager.interceptKeyBeforeDispatching(WindowManagerPolicy$WindowState, KeyEvent, int) line: 3499
InputMonitor.interceptKeyBeforeDispatching(InputWindowHandle, KeyEvent, int) line: 466
InputManagerService.interceptKeyBeforeDispatching(InputWindowHandle, KeyEvent, int) line: 1983

Thread [Binder:835_1E] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=11972)
WindowAnimator.scheduleAnimation() line: 407
WindowManagerService.scheduleAnimationLocked() line: 5988
RootWindowContainer.performSurfacePlacement(boolean) line: 824
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowManagerService.relayoutWindow(Session, IWindow, int, WindowManager$LayoutParams, int, int, int, int, Rect, Rect, Rect, Rect, Rect, Rect, Rect, MergedConfiguration, Surface) line: 2182
Session.relayout(IWindow, int, WindowManager$LayoutParams, int, int, int, int, Rect, Rect, Rect, Rect, Rect, Rect, Rect, MergedConfiguration, Surface) line: 239
Session(IWindowSession$Stub).onTransact(int, Parcel, Parcel, int) line: 286
Session.onTransact(int, Parcel, Parcel, int) line: 163
Session(Binder).execTransact(int, long, long, int) line: 697

Thread [android.anim] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=11972)
WindowAnimator.scheduleAnimation() line: 407
WindowAnimator.animate(long) line: 143
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameDisplayEventReceiver.run() line: 952
Handler.handleCallback(Message) line: 790
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

堵在这里回不去

public boolean containsShowWhenLockedWindow(IBinder token) {
    synchronized (mWindowMap) {
        final AppWindowToken wtoken = mRoot.getAppWindowToken(token);
        return wtoken != null && wtoken.containsShowWhenLockedWindow();
    }
}

Thread [Binder:835_1F] (Suspended)
owns: ActivityManagerService (id=12078)
waiting for: WindowHashMap (id=11972)
WindowManagerService.containsShowWhenLockedWindow(IBinder) line: 2975
ActivityRecord.canShowWhenLocked() line: 2881
ActivityStack.checkKeyguardVisibility(ActivityRecord, boolean, boolean) line: 1999
ActivityStack.ensureActivitiesVisibleLocked(ActivityRecord, int, boolean) line: 1862
ActivityStackSupervisor.ensureActivitiesVisibleLocked(ActivityRecord, int, boolean) line: 3430
ActivityStack.completePauseLocked(boolean, ActivityRecord) line: 1543
ActivityStack.activityPausedLocked(IBinder, boolean) line: 1425
ActivityManagerService.activityPaused(IBinder) line: 7609
ActivityManagerService(IActivityManager$Stub).onTransact(int, Parcel, Parcel, int) line: 317
ActivityManagerService.onTransact(int, Parcel, Parcel, int) line: 2977
ActivityManagerService(Binder).execTransact(int, long, long, int) line: 697

现在怀疑是android.anim线程一直占着锁,然后,其他进程的activityPausedLocked线程退不出去

Thread [Binder:835_1E] (Suspended (breakpoint at line 291 in Animation))
owns: WindowHashMap (id=11972)
owns: ActivityManagerService (id=12078)
AnimationSet(Animation).reset() line: 291 //reset 是这里走的 可以置条件
AnimationSet.reset() line: 488
AnimationSet(Animation).initialize(int, int, int, int) line: 354
AnimationSet.initialize(int, int, int, int) line: 425
AppTransition.createClipRevealAnimationLocked(int, boolean, Rect, Rect) line: 867
AppTransition.loadAnimation(WindowManager$LayoutParams, int, boolean, int, int, Rect, Rect, Rect, Rect, Rect, boolean, boolean, int) line: 1563
WindowManagerService.applyAnimationLocked(AppWindowToken, WindowManager$LayoutParams, int, boolean, boolean) line: 2420
AppWindowToken.setVisibility(WindowManager$LayoutParams, boolean, int, boolean, boolean) line: 372
WindowSurfacePlacer.handleOpeningApps(int, WindowManager$LayoutParams, boolean, int) line: 404
WindowSurfacePlacer.handleAppTransitionReadyLocked() line: 348
RootWindowContainer.performSurfacePlacement(boolean) line: 615
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowSurfacePlacer.performSurfacePlacement() line: 135
WindowSurfacePlacer.continueLayout() line: 126
WindowManagerService.continueSurfaceLayout() line: 2966
ActivityStack.activityPausedLocked(IBinder, boolean) line: 1427
ActivityManagerService.activityPaused(IBinder) line: 7609
ActivityManagerService(IActivityManager$Stub).onTransact(int, Parcel, Parcel, int) line: 317
ActivityManagerService.onTransact(int, Parcel, Parcel, int) line: 2977
ActivityManagerService(Binder).execTransact(int, long, long, int) line: 697

明天可以通过线程的LOG来跟踪

Thread [Binder:835_17] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=11972)
owns: ActivityManagerService (id=12078)
WindowAnimator.scheduleAnimation() line: 407
WindowManagerService.scheduleAnimationLocked() line: 5988
RootWindowContainer.performSurfacePlacement(boolean) line: 824
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowSurfacePlacer.performSurfacePlacement() line: 135
WindowSurfacePlacer.continueLayout() line: 126
WindowManagerService.continueSurfaceLayout() line: 2966
ActivityStarter.startActivity(ActivityRecord, ActivityRecord, IVoiceInteractionSession, IVoiceInteractor, int, boolean, ActivityOptions, TaskRecord, ActivityRecord[]) line: 1010
ActivityStarter.startActivity(IApplicationThread, Intent, Intent, String, ActivityInfo, ResolveInfo, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, int, String, int, int, int, ActivityOptions, boolean, boolean, ActivityRecord[], TaskRecord) line: 577
ActivityStarter.startActivityLocked(IApplicationThread, Intent, Intent, String, ActivityInfo, ResolveInfo, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, int, String, int, int, int, ActivityOptions, boolean, boolean, ActivityRecord[], TaskRecord, String) line: 283
ActivityStarter.startActivityMayWait(IApplicationThread, int, String, Intent, String, IVoiceInteractionSession, IVoiceInteractor, IBinder, String, int, int, ProfilerInfo, WaitResult, Configuration, Bundle, boolean, int, TaskRecord, String) line: 822
ActivityManagerService.startActivityAsUser(IApplicationThread, String, Intent, String, IBinder, String, int, int, ProfilerInfo, Bundle, int) line: 4622
ActivityManagerService.startActivity(IApplicationThread, String, Intent, String, IBinder, String, int, int, ProfilerInfo, Bundle) line: 4609
ActivityManagerService(IActivityManager$Stub).onTransact(int, Parcel, Parcel, int) line: 121
ActivityManagerService.onTransact(int, Parcel, Parcel, int) line: 2977
ActivityManagerService(Binder).execTransact(int, long, long, int) line: 697

这里重新调用一下, scheduleAnimation
Thread [Binder:835_13] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=11972)
WindowAnimator.scheduleAnimation() line: 407
WindowManagerService.scheduleAnimationLocked() line: 5988
RootWindowContainer.performSurfacePlacement(boolean) line: 824
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowManagerService.relayoutWindow(Session, IWindow, int, WindowManager$LayoutParams, int, int, int, int, Rect, Rect, Rect, Rect, Rect, Rect, Rect, MergedConfiguration, Surface) line: 2182
Session.relayout(IWindow, int, WindowManager$LayoutParams, int, int, int, int, Rect, Rect, Rect, Rect, Rect, Rect, Rect, MergedConfiguration, Surface) line: 239
Session(IWindowSession$Stub).onTransact(int, Parcel, Parcel, int) line: 286
Session.onTransact(int, Parcel, Parcel, int) line: 163
Session(Binder).execTransact(int, long, long, int) line: 697

—– pid 13471 at 2018-06-29 09:52:55 —–
Cmd line: com.android.dialer
Build fingerprint: ‘ATT/QS5509QL/QS5509QL:8.1.0/OPM1.171019.026/v1A6L-0:userdebug/test-keys’
ABI: ‘arm’
Build type: optimized
Zygote loaded classes=5032 post zygote classes=907
“main” prio=5 tid=1 Native
| group=”main” sCount=1 dsCount=0 flags=1 obj=0x70bb97f0 self=0xa5ca4000
| sysTid=13471 nice=-10 cgrp=default sched=0/0 handle=0xa9d944a4
| state=S schedstat=( 5295191541 1911600014 4283 ) utm=416 stm=113 core=3 HZ=100
| stack=0xbe3bc000-0xbe3be000 stackSize=8MB
| held mutexes=
native: #00 pc 00049794 /system/lib/libc.so (ioctl+8)
native: #01 pc 0001e233 /system/lib/libc.so (ioctl+38)
native: #02 pc 0004242f /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+170)
native: #03 pc 00042de9 /system/lib/libbinder.so (android::IPCThreadState::waitForResponse(android::Parcel, int)+236)
native: #04 pc 0003d2e5 /system/lib/libbinder.so (android::BpBinder::transact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+36)
native: #05 pc 000bd409 /system/lib/libandroid_runtime.so (???)
native: #06 pc 0064e485 /data/dalvik-cache/arm/system@framework@boot.oat (Java_android_os_BinderProxy_transactNative
ILandroid_os_Parcel_2Landroid_os_Parcel_2I+132)
at android.os.BinderProxy.transactNative(Native method)
at android.os.BinderProxy.transact(Binder.java:764)
at android.view.IWindowSession$Stub$Proxy.relayout(IWindowSession.java:915)
at android.view.ViewRootImpl.relayoutWindow(ViewRootImpl.java:6141)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1905)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1396)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6773)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:966)
at android.view.Choreographer.doCallbacks(Choreographer.java:778)
at android.view.Choreographer.doFrame(Choreographer.java:713)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:952)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6518)
at java.lang.reflect.Method.invoke(Native method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

这里也会block?

Thread [Binder:835_13] (Suspended)
waiting for: ActivityManagerService (id=12078)
ActivityManagerService.getActivityOptions(IBinder) line: 13588
ActivityManagerService(IActivityManager$Stub).onTransact(int, Parcel, Parcel, int) line: 2906
ActivityManagerService.onTransact(int, Parcel, Parcel, int) line: 2977
ActivityManagerService(Binder).execTransact(int, long, long, int) line: 697

“main” prio=5 tid=1 Native
| group=”main” sCount=1 dsCount=0 flags=1 obj=0x70bb97f0 self=0xa5ca4000
| sysTid=13471 nice=-10 cgrp=default sched=0/0 handle=0xa9d944a4
| state=S schedstat=( 5312166227 1913354234 4311 ) utm=416 stm=115 core=1 HZ=100
| stack=0xbe3bc000-0xbe3be000 stackSize=8MB
| held mutexes=
native: #00 pc 00049794 /system/lib/libc.so (ioctl+8)
native: #01 pc 0001e233 /system/lib/libc.so (ioctl+38)
native: #02 pc 0004242f /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+170)
native: #03 pc 00042de9 /system/lib/libbinder.so (android::IPCThreadState::waitForResponse(android::Parcel, int)+236)
native: #04 pc 0003d2e5 /system/lib/libbinder.so (android::BpBinder::transact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+36)
native: #05 pc 000bd409 /system/lib/libandroid_runtime.so (???)
native: #06 pc 0064e485 /data/dalvik-cache/arm/system@framework@boot.oat (Java_android_os_BinderProxy_transactNative
ILandroid_os_Parcel_2Landroid_os_Parcel_2I+132)
at android.os.BinderProxy.transactNative(Native method)
at android.os.BinderProxy.transact(Binder.java:764)
at android.app.IActivityManager$Stub$Proxy.getActivityOptions(IActivityManager.java:8278)
at android.app.Activity.getActivityOptions(Activity.java:6431)
at android.app.Activity.performStart(Activity.java:7044)
at android.app.Activity.performRestart(Activity.java:7123)
at android.app.Activity.performResume(Activity.java:7128)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3559)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3624)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1641)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6518)
at java.lang.reflect.Method.invoke(Native method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

超时调用

Thread [ActivityManager] (Suspended (breakpoint at line 291 in Animation))
owns: WindowHashMap (id=11972)
owns: ActivityManagerService (id=12078)
AnimationSet(Animation).reset() line: 291
AnimationSet.reset() line: 488
AnimationSet(Animation).initialize(int, int, int, int) line: 354
AnimationSet.initialize(int, int, int, int) line: 425
AppTransition.createClipRevealAnimationLocked(int, boolean, Rect, Rect) line: 867
AppTransition.loadAnimation(WindowManager$LayoutParams, int, boolean, int, int, Rect, Rect, Rect, Rect, Rect, boolean, boolean, int) line: 1563
WindowManagerService.applyAnimationLocked(AppWindowToken, WindowManager$LayoutParams, int, boolean, boolean) line: 2420
AppWindowToken.setVisibility(WindowManager$LayoutParams, boolean, int, boolean, boolean) line: 372
WindowSurfacePlacer.handleOpeningApps(int, WindowManager$LayoutParams, boolean, int) line: 404
WindowSurfacePlacer.handleAppTransitionReadyLocked() line: 348
RootWindowContainer.performSurfacePlacement(boolean) line: 615
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowSurfacePlacer.performSurfacePlacement() line: 135
WindowSurfacePlacer.continueLayout() line: 126
WindowManagerService.continueSurfaceLayout() line: 2966
ActivityStack.activityPausedLocked(IBinder, boolean) line: 1427
ActivityStack$ActivityStackHandler.handleMessage(Message) line: 401
ActivityStack$ActivityStackHandler(Handler).dispatchMessage(Message) line: 106
Looper.loop() line: 164
ServiceThread(HandlerThread).run() line: 65
ServiceThread.run() line: 46

Thread [Binder:835_1B] (Suspended (breakpoint at line 1429 in ActivityStack))
owns: ActivityManagerService (id=23700)
ActivityStack.activityPausedLocked(IBinder, boolean) line: 1429
ActivityManagerService.activityPaused(IBinder) line: 7609
ActivityManagerService(IActivityManager$Stub).onTransact(int, Parcel, Parcel, int) line: 317
ActivityManagerService.onTransact(int, Parcel, Parcel, int) line: 2977
ActivityManagerService(Binder).execTransact(int, long, long, int) line: 697

Thread [Binder:835_1B] (Suspended (breakpoint at line 615 in AppWindowContainerController))
owns: WindowHashMap (id=23648)
owns: ActivityManagerService (id=23700)
AppWindowContainerController.removeStartingWindow() line: 615
AppWindowToken.notifyAppStopped() line: 682
AppWindowContainerController.notifyAppStopped() line: 699
ActivityRecord.activityStoppedLocked(Bundle, PersistableBundle, CharSequence) line: 1820
ActivityManagerService.activityStopped(IBinder, Bundle, PersistableBundle, CharSequence) line: 7630
ActivityManagerService(IActivityManager$Stub).onTransact(int, Parcel, Parcel, int) line: 347
ActivityManagerService.onTransact(int, Parcel, Parcel, int) line: 2977
ActivityManagerService(Binder).execTransact(int, long, long, int) line: 697

APP activityStopped时,才会走removeStartingWindow

public void removeStartingWindow() {
    synchronized (mWindowMap) {//jackywei 这里会有block的问题
        if (mContainer.startingWindow == null) {
            if (mContainer.startingData != null) {
                // Starting window has not been added yet, but it is scheduled to be added.
                // Go ahead and cancel the request.
                if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM,
                        "Clearing startingData for token=" + mContainer);
                mContainer.startingData = null;
            }
            return;
        }

animation = null;

Thread [android.anim] (Suspended (breakpoint at line 179 in AppWindowAnimator))
owns: WindowHashMap (id=23648)
AppWindowAnimator.setNullAnimation() line: 179
AppWindowAnimator.clearAnimation() line: 188
AppWindowAnimator.stepAnimationLocked(long) line: 413
AppWindowToken.stepAppWindowsAnimation(long) line: 1523
Task(WindowContainer).stepAppWindowsAnimation(long) line: 511
TaskStack(WindowContainer).stepAppWindowsAnimation(long) line: 511
TaskStack.stepAppWindowsAnimation(long) line: 1628
DisplayContent$TaskStackContainers(WindowContainer).stepAppWindowsAnimation(long) line: 511
DisplayContent(WindowContainer).stepAppWindowsAnimation(long) line: 511
WindowAnimator.animate(long) line: 174
WindowAnimator.lambda$-com_android_server_wm_WindowAnimator_3951(long) line: 105
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.$m$0(long) line: not available
-$Lambda$OQfQhd_xsxt9hoLAjIbVfOwa-jY.doFrame(long) line: not available
Choreographer$CallbackRecord.run(long) line: 964
Choreographer.doCallbacks(int, long) line: 778
Choreographer.doFrame(long, int) line: 710
Choreographer$FrameDisplayEventReceiver.run() line: 952
Handler.handleCallback(Message) line: 790
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 164
AnimationThread(HandlerThread).run() line: 65
AnimationThread(ServiceThread).run() line: 46

启动 scheduleAnimation
Thread [Binder:835_1A] (Suspended (breakpoint at line 407 in WindowAnimator))
owns: WindowHashMap (id=23648)
WindowAnimator.scheduleAnimation() line: 407
WindowManagerService.scheduleAnimationLocked() line: 5988
RootWindowContainer.performSurfacePlacement(boolean) line: 824
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowManagerService.relayoutWindow(Session, IWindow, int, WindowManager$LayoutParams, int, int, int, int, Rect, Rect, Rect, Rect, Rect, Rect, Rect, MergedConfiguration, Surface) line: 2182
Session.relayout(IWindow, int, WindowManager$LayoutParams, int, int, int, int, Rect, Rect, Rect, Rect, Rect, Rect, Rect, MergedConfiguration, Surface) line: 239
Session(IWindowSession$Stub).onTransact(int, Parcel, Parcel, int) line: 286
Session.onTransact(int, Parcel, Parcel, int) line: 163
Session(Binder).execTransact(int, long, long, int) line: 697

把animation = null;//jackywei设置为NULL
Thread [Binder:835_1C] (Suspended (breakpoint at line 179 in AppWindowAnimator))
owns: WindowHashMap (id=23648)
owns: ActivityManagerService (id=23700)
AppWindowAnimator.setNullAnimation() line: 179
WindowSurfacePlacer.handleClosingApps(int, WindowManager$LayoutParams, boolean, WindowSurfacePlacer$LayerAndToken) line: 458
WindowSurfacePlacer.handleAppTransitionReadyLocked() line: 344
RootWindowContainer.performSurfacePlacement(boolean) line: 615
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowSurfacePlacer.performSurfacePlacement() line: 135
WindowSurfacePlacer.continueLayout() line: 126
WindowManagerService.continueSurfaceLayout() line: 2966
ActivityStack.activityPausedLocked(IBinder, boolean) line: 1427
ActivityManagerService.activityPaused(IBinder) line: 7609
ActivityManagerService(IActivityManager$Stub).onTransact(int, Parcel, Parcel, int) line: 317
ActivityManagerService.onTransact(int, Parcel, Parcel, int) line: 2977
ActivityManagerService(Binder).execTransact(int, long, long, int) line: 697

设置animating = false;
Thread [Binder:835_1C] (Suspended (breakpoint at line 131 in AppWindowAnimator))
owns: WindowHashMap (id=23648)
owns: ActivityManagerService (id=23700)
AppWindowAnimator.setAnimation(Animation, int, int, int, int, boolean, int, int, int) line: 131
WindowManagerService.applyAnimationLocked(AppWindowToken, WindowManager$LayoutParams, int, boolean, boolean) line: 2427
AppWindowToken.setVisibility(WindowManager$LayoutParams, boolean, int, boolean, boolean) line: 372
WindowSurfacePlacer.handleClosingApps(int, WindowManager$LayoutParams, boolean, WindowSurfacePlacer$LayerAndToken) line: 461
WindowSurfacePlacer.handleAppTransitionReadyLocked() line: 344
RootWindowContainer.performSurfacePlacement(boolean) line: 615
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowSurfacePlacer.performSurfacePlacement() line: 135
WindowSurfacePlacer.continueLayout() line: 126
WindowManagerService.continueSurfaceLayout() line: 2966
ActivityStack.activityPausedLocked(IBinder, boolean) line: 1427
ActivityManagerService.activityPaused(IBinder) line: 7609
ActivityManagerService(IActivityManager$Stub).onTransact(int, Parcel, Parcel, int) line: 317
ActivityManagerService.onTransact(int, Parcel, Parcel, int) line: 2977
ActivityManagerService(Binder).execTransact(int, long, long, int) line: 697

设置 mMore = true;
mOneMoreTime = true;

Thread [Binder:835_1C] (Suspended (breakpoint at line 291 in Animation))
owns: WindowHashMap (id=23648)
owns: ActivityManagerService (id=23700)
AlphaAnimation(Animation).reset() line: 291
AlphaAnimation(Animation).initialize(int, int, int, int) line: 354
AppWindowAnimator.setAnimation(Animation, int, int, int, int, boolean, int, int, int) line: 133
WindowManagerService.applyAnimationLocked(AppWindowToken, WindowManager$LayoutParams, int, boolean, boolean) line: 2427
AppWindowToken.setVisibility(WindowManager$LayoutParams, boolean, int, boolean, boolean) line: 372
WindowSurfacePlacer.handleClosingApps(int, WindowManager$LayoutParams, boolean, WindowSurfacePlacer$LayerAndToken) line: 461
WindowSurfacePlacer.handleAppTransitionReadyLocked() line: 344
RootWindowContainer.performSurfacePlacement(boolean) line: 615
WindowSurfacePlacer.performSurfacePlacementLoop() line: 197
WindowSurfacePlacer.performSurfacePlacement(boolean) line: 145
WindowSurfacePlacer.performSurfacePlacement() line: 135
WindowSurfacePlacer.continueLayout() line: 126
WindowManagerService.continueSurfaceLayout() line: 2966
ActivityStack.activityPausedLocked(IBinder, boolean) line: 1427
ActivityManagerService.activityPaused(IBinder) line: 7609
ActivityManagerService(IActivityManager$Stub).onTransact(int, Parcel, Parcel, int) line: 317
ActivityManagerService.onTransact(int, Parcel, Parcel, int) line: 2977
ActivityManagerService(Binder).execTransact(int, long, long, int) line: 697

7月7日,
问题 again.