Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 495f1381 authored by Chong Zhang's avatar Chong Zhang Committed by Android (Google) Code Review
Browse files

Merge "Remove dead window if its activity record is cleared from history"

parents 77640255 7e8eeb79
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -157,8 +157,17 @@ class Task implements DimLayer.DimLayerUser {
        mDeferRemoval = false;
    }

    private boolean hasAppTokensAlive() {
        for (int i = mAppTokens.size() - 1; i >= 0; i--) {
            if (!mAppTokens.get(i).appDied) {
                return true;
            }
        }
        return false;
    }

    void removeLocked() {
        if (!mAppTokens.isEmpty() && mStack.isAnimating()) {
        if (hasAppTokensAlive() && mStack.isAnimating()) {
            if (DEBUG_STACK) Slog.i(TAG_WM, "removeTask: deferring removing taskId=" + mTaskId);
            mDeferRemoval = true;
            return;
+5 −4
Original line number Diff line number Diff line
@@ -9769,8 +9769,9 @@ public class WindowManagerService extends IWindowManager.Stub
    boolean dumpWindows(PrintWriter pw, String name, String[] args,
            int opti, boolean dumpAll) {
        WindowList windows = new WindowList();
        if ("visible".equals(name) || "visible-apps".equals(name)) {
            final boolean appsOnly = "visible-apps".equals(name);
        if ("apps".equals(name) || "visible".equals(name) || "visible-apps".equals(name)) {
            final boolean appsOnly = name.contains("apps");
            final boolean visibleOnly = name.contains("visible");
            synchronized(mWindowMap) {
                if (appsOnly) {
                    dumpDisplayContentsLocked(pw, true);
@@ -9782,8 +9783,8 @@ public class WindowManagerService extends IWindowManager.Stub
                            mDisplayContents.valueAt(displayNdx).getWindowList();
                    for (int winNdx = windowList.size() - 1; winNdx >= 0; --winNdx) {
                        final WindowState w = windowList.get(winNdx);
                        if (w.mWinAnimator.getShown()
                                && (!appsOnly || (appsOnly && w.mAppToken != null))) {
                        if ((!visibleOnly || w.mWinAnimator.getShown())
                                && (!appsOnly || w.mAppToken != null)) {
                            windows.add(w);
                        }
                    }