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

Commit 4f088b6c authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Call WindowContainer#dump in all levels

In order to know if there is an animating window container. And
all derived classes should call super because the dump method is
annotated as CallSuper.

This fixes that TaskDisplayArea and ActivityStack don't call super
and the overridden Task#dump is never called. Also adjust the output
format so it is easier to read.

Bug: 157743122
Test: "adb shell dumpsys activity activities" and check the section
      "Task display areas in top down Z order".
Change-Id: I8396e1fbce1960dc9dcd9de8c5cd47bfd18ba31a
parent ebb7ae66
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7539,7 +7539,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
    public String toString() {
        if (stringName != null) {
            return stringName + " t" + (task == null ? INVALID_TASK_ID : task.mTaskId) +
                    (finishing ? " f}" : "") + (mIsExiting ? " mIsExiting=" : "") + "}";
                    (finishing ? " f}" : "") + (mIsExiting ? " isExiting" : "") + "}";
        }
        StringBuilder sb = new StringBuilder(128);
        sb.append("ActivityRecord{");
+8 −8
Original line number Diff line number Diff line
@@ -3230,22 +3230,22 @@ class ActivityStack extends Task {

    @Override
    void dump(PrintWriter pw, String prefix, boolean dumpAll) {
        pw.println(prefix + "mStackId=" + getRootTaskId());
        pw.println(prefix + "mDeferRemoval=" + mDeferRemoval);
        pw.println(prefix + "mBounds=" + getRawBounds().toShortString());
        for (int taskNdx = mChildren.size() - 1; taskNdx >= 0; taskNdx--) {
            mChildren.get(taskNdx).dump(pw, prefix + "  ", dumpAll);
        if (mDeferRemoval) {
            pw.println(prefix + "mDeferRemoval=true");
        }
        super.dump(pw, prefix, dumpAll);
        if (!mExitingActivities.isEmpty()) {
            pw.println();
            pw.println("  Exiting application tokens:");
            pw.println(prefix + "Exiting application tokens:");
            final String doublePrefix = prefix + "  ";
            for (int i = mExitingActivities.size() - 1; i >= 0; i--) {
                WindowToken token = mExitingActivities.get(i);
                pw.print("  Exiting App #"); pw.print(i);
                pw.print(doublePrefix + "Exiting App #" + i);
                pw.print(' '); pw.print(token);
                pw.println(':');
                token.dump(pw, "    ", dumpAll);
                token.dump(pw, doublePrefix, dumpAll);
            }
            pw.println();
        }
        mAnimatingActivityRegistry.dump(pw, "AnimatingApps:", prefix);
    }
+1 −1
Original line number Diff line number Diff line
@@ -1886,7 +1886,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
    public void dump(PrintWriter pw, String prefix) {
        pw.println();
        pw.println("ActivityStackSupervisor state:");
        mRootWindowContainer.dump(pw, prefix);
        mRootWindowContainer.dump(pw, prefix, true /* dumpAll */);
        getKeyguardController().dump(pw, prefix);
        mService.getLockTaskController().dump(pw, prefix);
        pw.print(prefix);
+2 −4
Original line number Diff line number Diff line
@@ -2977,12 +2977,10 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
        pw.println();
        mWallpaperController.dump(pw, "  ");

        if (mSystemGestureExclusionListeners.getRegisteredCallbackCount() > 0) {
            pw.println();
            pw.print("  mSystemGestureExclusion=");
        if (mSystemGestureExclusionListeners.getRegisteredCallbackCount() > 0) {
            pw.println(mSystemGestureExclusion);
        } else {
            pw.println("<no lstnrs>");
        }

        pw.println();
+4 −2
Original line number Diff line number Diff line
@@ -3570,12 +3570,14 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
        }
    }

    public void dump(PrintWriter pw, String prefix) {
    @Override
    public void dump(PrintWriter pw, String prefix, boolean dumpAll) {
        super.dump(pw, prefix, dumpAll);
        pw.print(prefix);
        pw.println("topDisplayFocusedStack=" + getTopDisplayFocusedStack());
        for (int i = getChildCount() - 1; i >= 0; --i) {
            final DisplayContent display = getChildAt(i);
            display.dump(pw, prefix, true /* dumpAll */);
            display.dump(pw, prefix, dumpAll);
        }
        pw.println();
    }
Loading