Merge "Fix #155437855: "dumpsys activity" package filtering doesn't filter everything" into rvc-dev

This commit is contained in:
Dianne Hackborn
2020-05-01 15:49:51 +00:00
committed by Android (Google) Code Review
11 changed files with 279 additions and 132 deletions

View File

@@ -1719,31 +1719,50 @@ public class ActivityManager {
configuration.windowConfiguration.getActivityType());
pw.println(); pw.print(" ");
pw.print(" id=" + persistentId);
pw.print(" stackId=" + stackId);
pw.print(" userId=" + userId);
pw.print(" hasTask=" + (id != -1));
pw.print(" lastActiveTime=" + lastActiveTime);
pw.println(); pw.print(" ");
pw.print(" baseIntent=" + baseIntent);
pw.println(); pw.print(" ");
pw.print(" isExcluded="
+ ((baseIntent.getFlags() & FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) != 0));
pw.print(" activityType=" + activityType);
pw.print(" windowingMode=" + windowingMode);
pw.print(" supportsSplitScreenMultiWindow=" + supportsSplitScreenMultiWindow);
pw.print(" id="); pw.print(persistentId);
pw.print(" stackId="); pw.print(stackId);
pw.print(" userId="); pw.print(userId);
pw.print(" hasTask="); pw.print((id != -1));
pw.print(" lastActiveTime="); pw.println(lastActiveTime);
pw.print(" "); pw.print(" baseIntent="); pw.println(baseIntent);
if (baseActivity != null) {
pw.print(" "); pw.print(" baseActivity=");
pw.println(baseActivity.toShortString());
}
if (topActivity != null) {
pw.print(" "); pw.print(" topActivity="); pw.println(topActivity.toShortString());
}
if (origActivity != null) {
pw.print(" "); pw.print(" origActivity=");
pw.println(origActivity.toShortString());
}
if (realActivity != null) {
pw.print(" "); pw.print(" realActivity=");
pw.println(realActivity.toShortString());
}
pw.print(" ");
pw.print(" isExcluded=");
pw.print(((baseIntent.getFlags() & FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) != 0));
pw.print(" activityType="); pw.print(activityType);
pw.print(" windowingMode="); pw.print(windowingMode);
pw.print(" supportsSplitScreenMultiWindow=");
pw.println(supportsSplitScreenMultiWindow);
if (taskDescription != null) {
pw.println(); pw.print(" ");
pw.print(" ");
final ActivityManager.TaskDescription td = taskDescription;
pw.print(" taskDescription {");
pw.print(" colorBackground=#" + Integer.toHexString(td.getBackgroundColor()));
pw.print(" colorPrimary=#" + Integer.toHexString(td.getPrimaryColor()));
pw.print(" iconRes=" + td.getIconResourcePackage() + "/" + td.getIconResource());
pw.print(" iconBitmap=" + (td.getIconFilename() != null
|| td.getInMemoryIcon() != null));
pw.print(" resizeMode=" + ActivityInfo.resizeModeToString(td.getResizeMode()));
pw.print(" minWidth=" + td.getMinWidth());
pw.print(" minHeight=" + td.getMinHeight());
pw.print(" colorBackground=#");
pw.print(Integer.toHexString(td.getBackgroundColor()));
pw.print(" colorPrimary=#");
pw.print(Integer.toHexString(td.getPrimaryColor()));
pw.print(" iconRes=");
pw.print(td.getIconResourcePackage() + "/" + td.getIconResource());
pw.print(" iconBitmap=");
pw.print(td.getIconFilename() != null || td.getInMemoryIcon() != null);
pw.print(" resizeMode=");
pw.print(ActivityInfo.resizeModeToString(td.getResizeMode()));
pw.print(" minWidth="); pw.print(td.getMinWidth());
pw.print(" minHeight="); pw.print(td.getMinHeight());
pw.println(" }");
}
}

View File

@@ -10535,12 +10535,14 @@ public class ActivityManagerService extends IActivityManager.Stub
}
mAtmInternal.dump(
DUMP_STARTER_CMD, fd, pw, args, opti, dumpAll, dumpClient, dumpPackage);
pw.println();
if (dumpAll) {
pw.println("-------------------------------------------------------------------------------");
if (dumpPackage == null) {
pw.println();
if (dumpAll) {
pw.println("-------------------------------------------------------------------------------");
}
mAtmInternal.dump(
DUMP_CONTAINERS_CMD, fd, pw, args, opti, dumpAll, dumpClient, dumpPackage);
}
mAtmInternal.dump(
DUMP_CONTAINERS_CMD, fd, pw, args, opti, dumpAll, dumpClient, dumpPackage);
// Activities section is dumped as part of the Critical priority dump. Exclude the
// section if priority is Normal.
if (!dumpNormalPriority) {
@@ -10558,6 +10560,11 @@ public class ActivityManagerService extends IActivityManager.Stub
}
dumpAssociationsLocked(fd, pw, args, opti, dumpAll, dumpClient, dumpPackage);
}
pw.println();
if (dumpAll) {
pw.println("-------------------------------------------------------------------------------");
}
mProcessList.mAppExitInfoTracker.dumpHistoryProcessExitInfo(pw, dumpPackage);
if (dumpPackage == null) {
pw.println();
if (dumpAll) {
@@ -10574,17 +10581,6 @@ public class ActivityManagerService extends IActivityManager.Stub
if (dumpAll) {
pw.println("-------------------------------------------------------------------------------");
}
dumpLruLocked(pw, dumpPackage);
pw.println();
if (dumpAll) {
pw.println("-------------------------------------------------------------------------------");
}
mProcessList.mAppExitInfoTracker.dumpHistoryProcessExitInfo(pw, dumpPackage);
pw.println();
if (dumpAll) {
pw.println("-------------------------------------------------------------------"
+ "------------");
}
dumpProcessesLocked(fd, pw, args, opti, dumpAll, dumpPackage, dumpAppId);
pw.println();
if (dumpAll) {
@@ -10788,7 +10784,7 @@ public class ActivityManagerService extends IActivityManager.Stub
}
} else if ("oom".equals(cmd) || "o".equals(cmd)) {
synchronized (this) {
dumpOomLocked(fd, pw, args, opti, true);
dumpOomLocked(fd, pw, false, args, opti, true, dumpPackage, true);
}
} else if ("lmk".equals(cmd)) {
synchronized (this) {
@@ -10796,11 +10792,11 @@ public class ActivityManagerService extends IActivityManager.Stub
}
} else if ("lru".equals(cmd)) {
synchronized (this) {
dumpLruLocked(pw, null);
dumpLruLocked(pw, dumpPackage, null);
}
} else if ("permissions".equals(cmd) || "perm".equals(cmd)) {
synchronized (this) {
dumpPermissionsLocked(fd, pw, args, opti, true, null);
dumpPermissionsLocked(fd, pw, args, opti, true, dumpPackage);
}
} else if ("provider".equals(cmd)) {
String[] newArgs;
@@ -10820,7 +10816,7 @@ public class ActivityManagerService extends IActivityManager.Stub
}
} else if ("providers".equals(cmd) || "prov".equals(cmd)) {
synchronized (this) {
dumpProvidersLocked(fd, pw, args, opti, true, null);
dumpProvidersLocked(fd, pw, args, opti, true, dumpPackage);
}
} else if ("service".equals(cmd)) {
String[] newArgs;
@@ -11106,8 +11102,9 @@ public class ActivityManagerService extends IActivityManager.Stub
" Counts of Binder Proxies held by SYSTEM");
}
void dumpLruEntryLocked(PrintWriter pw, int index, ProcessRecord proc) {
pw.print(" #");
void dumpLruEntryLocked(PrintWriter pw, int index, ProcessRecord proc, String prefix) {
pw.print(prefix);
pw.print("#");
pw.print(index);
pw.print(": ");
pw.print(ProcessList.makeOomAdjString(proc.setAdj, false));
@@ -11149,9 +11146,29 @@ public class ActivityManagerService extends IActivityManager.Stub
}
// TODO: Move to ProcessList?
void dumpLruLocked(PrintWriter pw, String dumpPackage) {
pw.println("ACTIVITY MANAGER LRU PROCESSES (dumpsys activity lru)");
boolean dumpLruLocked(PrintWriter pw, String dumpPackage, String prefix) {
final int N = mProcessList.mLruProcesses.size();
final String innerPrefix;
if (prefix == null) {
pw.println("ACTIVITY MANAGER LRU PROCESSES (dumpsys activity lru)");
innerPrefix = " ";
} else {
boolean haveAny = false;
for (int i = N - 1; i >= 0; i--) {
final ProcessRecord r = mProcessList.mLruProcesses.get(i);
if (dumpPackage != null && !r.pkgList.containsKey(dumpPackage)) {
continue;
}
haveAny = true;
break;
}
if (!haveAny) {
return false;
}
pw.print(prefix);
pw.println("Raw LRU list (dumpsys activity lru):");
innerPrefix = prefix + " ";
}
int i;
boolean first = true;
for (i = N - 1; i >= mProcessList.mLruProcessActivityStart; i--) {
@@ -11160,10 +11177,11 @@ public class ActivityManagerService extends IActivityManager.Stub
continue;
}
if (first) {
pw.println(" Activities:");
pw.print(innerPrefix);
pw.println("Activities:");
first = false;
}
dumpLruEntryLocked(pw, i, r);
dumpLruEntryLocked(pw, i, r, innerPrefix);
}
first = true;
for (; i >= mProcessList.mLruProcessServiceStart; i--) {
@@ -11172,10 +11190,11 @@ public class ActivityManagerService extends IActivityManager.Stub
continue;
}
if (first) {
pw.println(" Services:");
pw.print(innerPrefix);
pw.println("Services:");
first = false;
}
dumpLruEntryLocked(pw, i, r);
dumpLruEntryLocked(pw, i, r, innerPrefix);
}
first = true;
for (; i >= 0; i--) {
@@ -11184,11 +11203,13 @@ public class ActivityManagerService extends IActivityManager.Stub
continue;
}
if (first) {
pw.println(" Other:");
pw.print(innerPrefix);
pw.println("Other:");
first = false;
}
dumpLruEntryLocked(pw, i, r);
dumpLruEntryLocked(pw, i, r, innerPrefix);
}
return true;
}
// TODO: Move to ProcessList?
@@ -11200,7 +11221,7 @@ public class ActivityManagerService extends IActivityManager.Stub
pw.println("ACTIVITY MANAGER RUNNING PROCESSES (dumpsys activity processes)");
if (dumpAll) {
if (dumpAll || dumpPackage != null) {
final int NP = mProcessList.mProcessNames.getMap().size();
for (int ip=0; ip<NP; ip++) {
SparseArray<ProcessRecord> procs = mProcessList.mProcessNames.getMap().valueAt(ip);
@@ -11267,6 +11288,12 @@ public class ActivityManagerService extends IActivityManager.Stub
}
}
if (dumpOomLocked(fd, pw, needSep, args, opti, dumpAll, dumpPackage, false)) {
needSep = true;
}
needSep = dumpProcessesToGc(pw, needSep, dumpPackage);
if (mProcessList.mActiveUids.size() > 0) {
if (dumpUids(pw, dumpPackage, dumpAppId, mProcessList.mActiveUids,
"UID states:", needSep)) {
@@ -11283,6 +11310,13 @@ public class ActivityManagerService extends IActivityManager.Stub
}
}
if (needSep) {
pw.println();
}
if (dumpLruLocked(pw, dumpPackage, " ")) {
needSep = true;
}
if (mProcessList.getLruSizeLocked() > 0) {
if (needSep) {
pw.println();
@@ -11387,8 +11421,6 @@ public class ActivityManagerService extends IActivityManager.Stub
"OnHold Norm", "OnHold PERS", dumpPackage);
}
needSep = dumpProcessesToGc(pw, needSep, dumpPackage);
needSep = mAppErrors.dumpLocked(fd, pw, needSep, dumpPackage);
needSep = mAtmInternal.dumpForProcesses(fd, pw, dumpAll, dumpPackage, dumpAppId, needSep,
@@ -11931,10 +11963,8 @@ public class ActivityManagerService extends IActivityManager.Stub
pw.println(")");
}
boolean dumpOomLocked(FileDescriptor fd, PrintWriter pw, String[] args,
int opti, boolean dumpAll) {
boolean needSep = false;
boolean dumpOomLocked(FileDescriptor fd, PrintWriter pw, boolean needSep, String[] args,
int opti, boolean dumpAll, String dumpPackage, boolean inclGc) {
if (mProcessList.getLruSizeLocked() > 0) {
if (needSep) pw.println();
needSep = true;
@@ -11965,11 +11995,11 @@ public class ActivityManagerService extends IActivityManager.Stub
- mProcessList.mLruProcessServiceStart);
pw.println("):");
dumpProcessOomList(pw, this, mProcessList.mLruProcesses, " ", "Proc", "PERS", true,
null);
dumpPackage);
needSep = true;
}
dumpProcessesToGc(pw, needSep, null);
dumpProcessesToGc(pw, needSep, dumpPackage);
pw.println();
mAtmInternal.dumpForOom(pw);

View File

@@ -785,7 +785,7 @@ public final class AppExitInfoTracker {
}
void dumpHistoryProcessExitInfo(PrintWriter pw, String packageName) {
pw.println("ACTIVITY MANAGER LRU PROCESSES (dumpsys activity exit-info)");
pw.println("ACTIVITY MANAGER PROCESS EXIT INFO (dumpsys activity exit-info)");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
synchronized (mLock) {
pw.println("Last Timestamp of Persistence Into Persistent Storage: "

View File

@@ -803,7 +803,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
pw.print(" icon=0x"); pw.print(Integer.toHexString(icon));
pw.print(" theme=0x"); pw.println(Integer.toHexString(theme));
pw.println(prefix + "mLastReportedConfigurations:");
mLastReportedConfiguration.dump(pw, prefix + " ");
mLastReportedConfiguration.dump(pw, prefix + " ");
pw.print(prefix); pw.print("CurrentConfiguration="); pw.println(getConfiguration());
if (!getRequestedOverrideConfiguration().equals(EMPTY)) {
@@ -839,7 +839,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
pw.print(" iconFilename="); pw.print(taskDescription.getIconFilename());
pw.print(" primaryColor=");
pw.println(Integer.toHexString(taskDescription.getPrimaryColor()));
pw.print(prefix + " backgroundColor=");
pw.print(prefix); pw.print(" backgroundColor=");
pw.print(Integer.toHexString(taskDescription.getBackgroundColor()));
pw.print(" statusBarColor=");
pw.print(Integer.toHexString(taskDescription.getStatusBarColor()));

View File

@@ -162,6 +162,7 @@ import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Consumer;
/**
@@ -2802,67 +2803,91 @@ class ActivityStack extends Task {
}
boolean dump(FileDescriptor fd, PrintWriter pw, boolean dumpAll, boolean dumpClient,
String dumpPackage, boolean needSep) {
pw.println(" Stack #" + getRootTaskId()
+ ": type=" + activityTypeToString(getActivityType())
+ " mode=" + windowingModeToString(getWindowingMode()));
pw.println(" isSleeping=" + shouldSleepActivities());
pw.println(" mBounds=" + getRequestedOverrideBounds());
boolean printed = dumpActivities(fd, pw, dumpAll, dumpClient, dumpPackage, needSep);
needSep = printed;
boolean pr = printThisActivity(pw, mPausingActivity, dumpPackage, needSep,
" mPausingActivity: ");
if (pr) {
printed = true;
needSep = false;
}
pr = printThisActivity(pw, getResumedActivity(), dumpPackage, needSep,
" mResumedActivity: ");
if (pr) {
printed = true;
needSep = false;
}
if (dumpAll) {
pr = printThisActivity(pw, mLastPausedActivity, dumpPackage, needSep,
" mLastPausedActivity: ");
if (pr) {
printed = true;
needSep = true;
String dumpPackage, final boolean needSep) {
Runnable headerPrinter = () -> {
if (needSep) {
pw.println();
}
printed |= printThisActivity(pw, mLastNoHistoryActivity, dumpPackage,
needSep, " mLastNoHistoryActivity: ");
pw.println(" Stack #" + getRootTaskId()
+ ": type=" + activityTypeToString(getActivityType())
+ " mode=" + windowingModeToString(getWindowingMode()));
pw.println(" isSleeping=" + shouldSleepActivities());
pw.println(" mBounds=" + getRequestedOverrideBounds());
};
boolean printed = false;
if (dumpPackage == null) {
// If we are not filtering by package, we want to print absolutely everything,
// so always print the header even if there are no tasks/activities inside.
headerPrinter.run();
headerPrinter = null;
printed = true;
}
printed |= printThisActivity(pw, mPausingActivity, dumpPackage, false,
" mPausingActivity: ", null);
printed |= printThisActivity(pw, getResumedActivity(), dumpPackage, false,
" mResumedActivity: ", null);
if (dumpAll) {
printed |= printThisActivity(pw, mLastPausedActivity, dumpPackage, false,
" mLastPausedActivity: ", null);
printed |= printThisActivity(pw, mLastNoHistoryActivity, dumpPackage,
false, " mLastNoHistoryActivity: ", null);
}
printed |= dumpActivities(fd, pw, dumpAll, dumpClient, dumpPackage, false, headerPrinter);
return printed;
}
private boolean dumpActivities(FileDescriptor fd, PrintWriter pw, boolean dumpAll,
boolean dumpClient, String dumpPackage, boolean needSep) {
boolean dumpClient, String dumpPackage, boolean needSep, Runnable header) {
if (!hasChild()) {
return false;
}
final String prefix = " ";
final AtomicBoolean printedHeader = new AtomicBoolean(false);
final AtomicBoolean printed = new AtomicBoolean(false);
forAllLeafTasks((task) -> {
if (needSep) {
pw.println("");
final String prefix = " ";
Runnable headerPrinter = () -> {
printed.set(true);
if (!printedHeader.get()) {
if (needSep) {
pw.println("");
}
if (header != null) {
header.run();
}
printedHeader.set(true);
}
pw.print(prefix); pw.print("* "); pw.println(task);
pw.print(prefix); pw.print(" mBounds=");
pw.println(task.getRequestedOverrideBounds());
pw.print(prefix); pw.print(" mMinWidth="); pw.print(task.mMinWidth);
pw.print(" mMinHeight="); pw.println(task.mMinHeight);
if (mLastNonFullscreenBounds != null) {
pw.print(prefix);
pw.print(" mLastNonFullscreenBounds=");
pw.println(task.mLastNonFullscreenBounds);
}
task.dump(pw, prefix + " ");
};
if (dumpPackage == null) {
// If we are not filtering by package, we want to print absolutely everything,
// so always print the header even if there are no activities inside.
headerPrinter.run();
headerPrinter = null;
}
pw.println(prefix + "Task id #" + task.mTaskId);
pw.println(prefix + "mBounds=" + task.getRequestedOverrideBounds());
pw.println(prefix + "mMinWidth=" + task.mMinWidth);
pw.println(prefix + "mMinHeight=" + task.mMinHeight);
pw.println(prefix + "mLastNonFullscreenBounds=" + task.mLastNonFullscreenBounds);
pw.println(prefix + "* " + task);
task.dump(pw, prefix + " ");
final ArrayList<ActivityRecord> activities = new ArrayList<>();
// Add activities by traversing the hierarchy from bottom to top, since activities
// are dumped in reverse order in {@link ActivityStackSupervisor#dumpHistoryList()}.
task.forAllActivities((Consumer<ActivityRecord>) activities::add,
false /* traverseTopToBottom */);
dumpHistoryList(fd, pw, activities, prefix, "Hist", true, !dumpAll, dumpClient,
dumpPackage, false, null, task);
dumpPackage, false, headerPrinter, task);
}, true /* traverseTopToBottom */);
return true;
return printed.get();
}
ArrayList<ActivityRecord> getDumpActivitiesLocked(String name) {

View File

@@ -1936,12 +1936,15 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
}
static boolean printThisActivity(PrintWriter pw, ActivityRecord activity, String dumpPackage,
boolean needSep, String prefix) {
boolean needSep, String prefix, Runnable header) {
if (activity != null) {
if (dumpPackage == null || dumpPackage.equals(activity.packageName)) {
if (needSep) {
pw.println();
}
if (header != null) {
header.run();
}
pw.print(prefix);
pw.println(activity);
return true;
@@ -1952,7 +1955,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
static boolean dumpHistoryList(FileDescriptor fd, PrintWriter pw, List<ActivityRecord> list,
String prefix, String label, boolean complete, boolean brief, boolean client,
String dumpPackage, boolean needNL, String header, Task lastTask) {
String dumpPackage, boolean needNL, Runnable header, Task lastTask) {
String innerPrefix = null;
String[] args = null;
boolean printed = false;
@@ -1972,7 +1975,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
needNL = false;
}
if (header != null) {
pw.println(header);
header.run();
header = null;
}
if (lastTask != r.getTask()) {

View File

@@ -549,19 +549,28 @@ public class ActivityStartController {
return mPendingRemoteAnimationRegistry;
}
void dump(PrintWriter pw, String prefix, String dumpPackage) {
void dumpLastHomeActivityStartResult(PrintWriter pw, String prefix) {
pw.print(prefix);
pw.print("mLastHomeActivityStartResult=");
pw.println(mLastHomeActivityStartResult);
}
if (mLastHomeActivityStartRecord != null) {
void dump(PrintWriter pw, String prefix, String dumpPackage) {
boolean dumped = false;
final boolean dumpPackagePresent = dumpPackage != null;
if (mLastHomeActivityStartRecord != null && (!dumpPackagePresent
|| dumpPackage.equals(mLastHomeActivityStartRecord.packageName))) {
if (!dumped) {
dumped = true;
dumpLastHomeActivityStartResult(pw, prefix);
}
pw.print(prefix);
pw.println("mLastHomeActivityStartRecord:");
mLastHomeActivityStartRecord.dump(pw, prefix + " ", true /* dumpAll */);
}
final boolean dumpPackagePresent = dumpPackage != null;
if (mLastStarter != null) {
final boolean dump = !dumpPackagePresent
|| mLastStarter.relatedToPackage(dumpPackage)
@@ -569,6 +578,10 @@ public class ActivityStartController {
&& dumpPackage.equals(mLastHomeActivityStartRecord.packageName));
if (dump) {
if (!dumped) {
dumped = true;
dumpLastHomeActivityStartResult(pw, prefix);
}
pw.print(prefix);
mLastStarter.dump(pw, prefix + " ");
@@ -578,7 +591,7 @@ public class ActivityStartController {
}
}
if (dumpPackagePresent) {
if (!dumped) {
pw.print(prefix);
pw.println("(nothing)");
}

View File

@@ -4926,7 +4926,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
boolean printed = ActivityStackSupervisor.printThisActivity(pw,
mRootWindowContainer.getTopResumedActivity(), dumpPackage, needSep,
" ResumedActivity: ");
" ResumedActivity: ", null);
if (printed) {
printedAnything = true;
needSep = false;

View File

@@ -1718,9 +1718,31 @@ class RecentTasks {
final int size = mTasks.size();
for (int i = 0; i < size; i++) {
final Task task = mTasks.get(i);
if (dumpPackage != null && (task.realActivity == null ||
!dumpPackage.equals(task.realActivity.getPackageName()))) {
continue;
if (dumpPackage != null) {
boolean match = task.intent != null
&& task.intent.getComponent() != null
&& dumpPackage.equals(
task.intent.getComponent().getPackageName());
if (!match) {
match |= task.affinityIntent != null
&& task.affinityIntent.getComponent() != null
&& dumpPackage.equals(
task.affinityIntent.getComponent().getPackageName());
}
if (!match) {
match |= task.origActivity != null
&& dumpPackage.equals(task.origActivity.getPackageName());
}
if (!match) {
match |= task.realActivity != null
&& dumpPackage.equals(task.realActivity.getPackageName());
}
if (!match) {
match |= dumpPackage.equals(task.mCallingPackage);
}
if (!match) {
continue;
}
}
if (!printedHeader) {
@@ -1743,6 +1765,31 @@ class RecentTasks {
0, true /* getTasksAllowed */, mService.getCurrentUserId(), SYSTEM_UID);
for (int i = 0; i < tasks.size(); i++) {
final ActivityManager.RecentTaskInfo taskInfo = tasks.get(i);
if (dumpPackage != null) {
boolean match = taskInfo.baseIntent != null
&& taskInfo.baseIntent.getComponent() != null
&& dumpPackage.equals(
taskInfo.baseIntent.getComponent().getPackageName());
if (!match) {
match |= taskInfo.baseActivity != null
&& dumpPackage.equals(taskInfo.baseActivity.getPackageName());
}
if (!match) {
match |= taskInfo.topActivity != null
&& dumpPackage.equals(taskInfo.topActivity.getPackageName());
}
if (!match) {
match |= taskInfo.origActivity != null
&& dumpPackage.equals(taskInfo.origActivity.getPackageName());
}
if (!match) {
match |= taskInfo.realActivity != null
&& dumpPackage.equals(taskInfo.realActivity.getPackageName());
}
if (!match) {
continue;
}
}
if (!printedHeader) {
if (printedAnything) {
// Separate from the last block if it printed

View File

@@ -3602,31 +3602,40 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
boolean needSep = false;
for (int displayNdx = getChildCount() - 1; displayNdx >= 0; --displayNdx) {
DisplayContent displayContent = getChildAt(displayNdx);
if (printed) {
pw.println();
}
pw.print("Display #"); pw.print(displayContent.mDisplayId);
pw.println(" (activities from top to bottom):");
for (int tdaNdx = displayContent.getTaskDisplayAreaCount() - 1; tdaNdx >= 0; --tdaNdx) {
final TaskDisplayArea taskDisplayArea = displayContent.getTaskDisplayAreaAt(tdaNdx);
for (int sNdx = taskDisplayArea.getStackCount() - 1; sNdx >= 0; --sNdx) {
final ActivityStack stack = taskDisplayArea.getStackAt(sNdx);
pw.println();
printed = stack.dump(fd, pw, dumpAll, dumpClient, dumpPackage, needSep);
needSep = printed;
if (needSep) {
pw.println();
}
needSep = stack.dump(fd, pw, dumpAll, dumpClient, dumpPackage, false);
printed |= needSep;
}
}
pw.println(" (resumed activities in task display areas from top to bottom):");
for (int tdaNdx = displayContent.getTaskDisplayAreaCount() - 1; tdaNdx >= 0; --tdaNdx) {
final TaskDisplayArea taskDisplayArea = displayContent.getTaskDisplayAreaAt(tdaNdx);
printThisActivity(pw, taskDisplayArea.getFocusedActivity(), dumpPackage, needSep,
" ResumedActivity:");
printed |= printThisActivity(pw, taskDisplayArea.getFocusedActivity(),
dumpPackage, needSep, " Resumed: ", () -> {
pw.println(" Resumed activities in task display areas"
+ " (from top to bottom):");
});
}
}
printed |= dumpHistoryList(fd, pw, mStackSupervisor.mFinishingActivities, " ",
"Fin", false, !dumpAll,
false, dumpPackage, true, " Activities waiting to finish:", null);
false, dumpPackage, true,
() -> { pw.println(" Activities waiting to finish:"); }, null);
printed |= dumpHistoryList(fd, pw, mStackSupervisor.mStoppingActivities, " ",
"Stop", false, !dumpAll,
false, dumpPackage, true, " Activities waiting to stop:", null);
false, dumpPackage, true,
() -> { pw.println(" Activities waiting to stop:"); }, null);
return printed;
}

View File

@@ -3875,11 +3875,12 @@ class Task extends WindowContainer<WindowContainer> {
pw.print(prefix); pw.print("mRootProcess="); pw.println(mRootProcess);
}
pw.print(prefix); pw.print("taskId=" + mTaskId); pw.println(" stackId=" + getRootTaskId());
pw.print(prefix + "mHasBeenVisible=" + getHasBeenVisible());
pw.print(" mResizeMode=" + ActivityInfo.resizeModeToString(mResizeMode));
pw.print(" mSupportsPictureInPicture=" + mSupportsPictureInPicture);
pw.print(" isResizeable=" + isResizeable());
pw.print(" lastActiveTime=" + lastActiveTime);
pw.print(prefix); pw.print("mHasBeenVisible="); pw.println(getHasBeenVisible());
pw.print(prefix); pw.print("mResizeMode=");
pw.print(ActivityInfo.resizeModeToString(mResizeMode));
pw.print(" mSupportsPictureInPicture="); pw.print(mSupportsPictureInPicture);
pw.print(" isResizeable="); pw.println(isResizeable());
pw.print(prefix); pw.print("lastActiveTime="); pw.print(lastActiveTime);
pw.println(" (inactive for " + (getInactiveDuration() / 1000) + "s)");
}