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

Commit e09ddd44 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge changes from topic...

Merge changes from topic "presubmit-am-9ba2a394f5ad4d338eadbfa2cb56aee6-sc-dev-sc-v2-dev-sc-v2-dev" into sc-v2-dev-plus-aosp

* changes:
  [automerge] Consider the recents component activities/windows when dumping visible 2p: 43301fec
  Consider the recents component activities/windows when dumping visible
parents 8ee22a34 45c091b8
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -3624,11 +3624,17 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
                return new ArrayList<>();
            }
        } else {
            final RecentTasks recentTasks = mWindowManager.mAtmService.getRecentTasks();
            final int recentsComponentUid = recentTasks != null
                    ? recentTasks.getRecentsComponentUid()
                    : -1;
            final ArrayList<ActivityRecord> activities = new ArrayList<>();
            forAllRootTasks(rootTask -> {
                if (!dumpVisibleRootTasksOnly || rootTask.shouldBeVisible(null)) {
                    activities.addAll(rootTask.getDumpActivitiesLocked(name));
            forAllLeafTasks(task -> {
                final boolean isRecents = (task.effectiveUid == recentsComponentUid);
                if (!dumpVisibleRootTasksOnly || task.shouldBeVisible(null) || isRecents) {
                    activities.addAll(task.getDumpActivitiesLocked(name));
                }
                return false;
            });
            return activities;
        }
+6 −1
Original line number Diff line number Diff line
@@ -513,9 +513,14 @@ public class WindowManagerShellCommand extends ShellCommand {
        try (ZipOutputStream out = new ZipOutputStream(getRawOutputStream())) {
            ArrayList<Pair<String, ByteTransferPipe>> requestList = new ArrayList<>();
            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.
                mInternal.mRoot.forAllWindows(w -> {
                    if (w.isVisible()) {
                    final boolean isRecents = (w.mSession.mUid == recentsComponentUid);
                    if (w.isVisible() || isRecents) {
                        ByteTransferPipe pipe = null;
                        try {
                            pipe = new ByteTransferPipe();