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

Commit 45c091b8 authored by Presubmit Automerger Backend's avatar Presubmit Automerger Backend
Browse files

[automerge] Consider the recents component activities/windows when dumping visible 2p: 43301fec

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17160643

Bug: 223509022
Bug: 223498680
Change-Id: I51c0e784a29a2103aec4f6831e5b503c5d486327
Merged-In: I06c5eaf4a82368996c734cd245803b3d7c4e7d71
parents 70c5b554 43301fec
Loading
Loading
Loading
Loading
+9 −3
Original line number Original line Diff line number Diff line
@@ -3624,11 +3624,17 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
                return new ArrayList<>();
                return new ArrayList<>();
            }
            }
        } else {
        } else {
            final RecentTasks recentTasks = mWindowManager.mAtmService.getRecentTasks();
            final int recentsComponentUid = recentTasks != null
                    ? recentTasks.getRecentsComponentUid()
                    : -1;
            final ArrayList<ActivityRecord> activities = new ArrayList<>();
            final ArrayList<ActivityRecord> activities = new ArrayList<>();
            forAllRootTasks(rootTask -> {
            forAllLeafTasks(task -> {
                if (!dumpVisibleRootTasksOnly || rootTask.shouldBeVisible(null)) {
                final boolean isRecents = (task.effectiveUid == recentsComponentUid);
                    activities.addAll(rootTask.getDumpActivitiesLocked(name));
                if (!dumpVisibleRootTasksOnly || task.shouldBeVisible(null) || isRecents) {
                    activities.addAll(task.getDumpActivitiesLocked(name));
                }
                }
                return false;
            });
            });
            return activities;
            return activities;
        }
        }
+6 −1
Original line number Original line Diff line number Diff line
@@ -513,9 +513,14 @@ public class WindowManagerShellCommand extends ShellCommand {
        try (ZipOutputStream out = new ZipOutputStream(getRawOutputStream())) {
        try (ZipOutputStream out = new ZipOutputStream(getRawOutputStream())) {
            ArrayList<Pair<String, ByteTransferPipe>> requestList = new ArrayList<>();
            ArrayList<Pair<String, ByteTransferPipe>> requestList = new ArrayList<>();
            synchronized (mInternal.mGlobalLock) {
            synchronized (mInternal.mGlobalLock) {
                final RecentTasks recentTasks = mInternal.mAtmService.getRecentTasks();
                final int recentsComponentUid = recentTasks != null
                        ? recentTasks.getRecentsComponentUid()
                        : -1;
                // Request dump from all windows parallelly before writing to disk.
                // Request dump from all windows parallelly before writing to disk.
                mInternal.mRoot.forAllWindows(w -> {
                mInternal.mRoot.forAllWindows(w -> {
                    if (w.isVisible()) {
                    final boolean isRecents = (w.mSession.mUid == recentsComponentUid);
                    if (w.isVisible() || isRecents) {
                        ByteTransferPipe pipe = null;
                        ByteTransferPipe pipe = null;
                        try {
                        try {
                            pipe = new ByteTransferPipe();
                            pipe = new ByteTransferPipe();