Consider the recents component activities/windows when dumping visible
- The Launcher currently manages gesture nav, so often a bug report
taken with better bug will prevent the launcher state from being
recorded as a part of the BR. This ensures that both the activity
dump and the window hierarchy is saved even if it is not visible.
Bug: 223509022
Bug: 223498680
Test: dumpsys activity -v all, cmd window dump-visible-window-views
while Launcher is not visible
Change-Id: I06c5eaf4a82368996c734cd245803b3d7c4e7d71
This commit is contained in:
@@ -3376,11 +3376,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, userId));
|
if (!dumpVisibleRootTasksOnly || task.shouldBeVisible(null) || isRecents) {
|
||||||
|
activities.addAll(task.getDumpActivitiesLocked(name, userId));
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
});
|
});
|
||||||
return activities;
|
return activities;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -566,9 +566,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.getUid() == recentsComponentUid);
|
||||||
|
if (w.isVisible() || isRecents) {
|
||||||
ByteTransferPipe pipe = null;
|
ByteTransferPipe pipe = null;
|
||||||
try {
|
try {
|
||||||
pipe = new ByteTransferPipe();
|
pipe = new ByteTransferPipe();
|
||||||
|
|||||||
Reference in New Issue
Block a user