Loading core/java/android/app/ActivityManager.java +41 −22 Original line number Diff line number Diff line Loading @@ -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(" }"); } } Loading services/core/java/com/android/server/am/ActivityManagerService.java +69 −39 Original line number Diff line number Diff line Loading @@ -10535,12 +10535,14 @@ public class ActivityManagerService extends IActivityManager.Stub } mAtmInternal.dump( DUMP_STARTER_CMD, fd, pw, args, opti, dumpAll, dumpClient, dumpPackage); if (dumpPackage == null) { pw.println(); if (dumpAll) { pw.println("-------------------------------------------------------------------------------"); } 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) { Loading @@ -10558,32 +10560,26 @@ public class ActivityManagerService extends IActivityManager.Stub } dumpAssociationsLocked(fd, pw, args, opti, dumpAll, dumpClient, dumpPackage); } if (dumpPackage == null) { pw.println(); if (dumpAll) { pw.println("-------------------------------------------------------------------------------"); } mOomAdjProfiler.dump(pw); mProcessList.mAppExitInfoTracker.dumpHistoryProcessExitInfo(pw, dumpPackage); if (dumpPackage == null) { pw.println(); if (dumpAll) { pw.println("-------------------------------------------------------------------------------"); } dumpLmkLocked(pw); } mOomAdjProfiler.dump(pw); pw.println(); if (dumpAll) { pw.println("-------------------------------------------------------------------------------"); } dumpLruLocked(pw, dumpPackage); pw.println(); if (dumpAll) { pw.println("-------------------------------------------------------------------------------"); dumpLmkLocked(pw); } mProcessList.mAppExitInfoTracker.dumpHistoryProcessExitInfo(pw, dumpPackage); pw.println(); if (dumpAll) { pw.println("-------------------------------------------------------------------" + "------------"); pw.println("-------------------------------------------------------------------------------"); } dumpProcessesLocked(fd, pw, args, opti, dumpAll, dumpPackage, dumpAppId); pw.println(); Loading Loading @@ -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) { Loading @@ -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; Loading @@ -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; Loading Loading @@ -11106,7 +11102,8 @@ public class ActivityManagerService extends IActivityManager.Stub " Counts of Binder Proxies held by SYSTEM"); } void dumpLruEntryLocked(PrintWriter pw, int index, ProcessRecord proc) { void dumpLruEntryLocked(PrintWriter pw, int index, ProcessRecord proc, String prefix) { pw.print(prefix); pw.print("#"); pw.print(index); pw.print(": "); Loading Loading @@ -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--) { Loading @@ -11160,10 +11177,11 @@ public class ActivityManagerService extends IActivityManager.Stub continue; } if (first) { pw.print(innerPrefix); pw.println("Activities:"); first = false; } dumpLruEntryLocked(pw, i, r); dumpLruEntryLocked(pw, i, r, innerPrefix); } first = true; for (; i >= mProcessList.mLruProcessServiceStart; i--) { Loading @@ -11172,10 +11190,11 @@ public class ActivityManagerService extends IActivityManager.Stub continue; } if (first) { pw.print(innerPrefix); pw.println("Services:"); first = false; } dumpLruEntryLocked(pw, i, r); dumpLruEntryLocked(pw, i, r, innerPrefix); } first = true; for (; i >= 0; i--) { Loading @@ -11184,11 +11203,13 @@ public class ActivityManagerService extends IActivityManager.Stub continue; } if (first) { pw.print(innerPrefix); pw.println("Other:"); first = false; } dumpLruEntryLocked(pw, i, r); dumpLruEntryLocked(pw, i, r, innerPrefix); } return true; } // TODO: Move to ProcessList? Loading @@ -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); Loading Loading @@ -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)) { Loading @@ -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(); Loading Loading @@ -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, Loading Loading @@ -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; Loading Loading @@ -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); services/core/java/com/android/server/am/AppExitInfoTracker.java +1 −1 Original line number Diff line number Diff line Loading @@ -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: " Loading services/core/java/com/android/server/wm/ActivityRecord.java +2 −2 Original line number Diff line number Diff line Loading @@ -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())); Loading services/core/java/com/android/server/wm/ActivityStack.java +66 −41 Original line number Diff line number Diff line Loading @@ -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; /** Loading Loading @@ -2802,67 +2803,91 @@ class ActivityStack extends Task { } boolean dump(FileDescriptor fd, PrintWriter pw, boolean dumpAll, boolean dumpClient, String dumpPackage, boolean needSep) { String dumpPackage, final boolean needSep) { Runnable headerPrinter = () -> { if (needSep) { pw.println(); } 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); boolean printed = false; 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) { 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; needSep = false; } printed |= printThisActivity(pw, mPausingActivity, dumpPackage, false, " mPausingActivity: ", null); printed |= printThisActivity(pw, getResumedActivity(), dumpPackage, false, " mResumedActivity: ", null); if (dumpAll) { pr = printThisActivity(pw, mLastPausedActivity, dumpPackage, needSep, " mLastPausedActivity: "); if (pr) { printed = true; needSep = true; } printed |= printThisActivity(pw, mLastPausedActivity, dumpPackage, false, " mLastPausedActivity: ", null); printed |= printThisActivity(pw, mLastNoHistoryActivity, dumpPackage, needSep, " mLastNoHistoryActivity: "); 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) -> { final String prefix = " "; Runnable headerPrinter = () -> { printed.set(true); if (!printedHeader.get()) { if (needSep) { pw.println(""); } 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); 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; } 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) { Loading Loading
core/java/android/app/ActivityManager.java +41 −22 Original line number Diff line number Diff line Loading @@ -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(" }"); } } Loading
services/core/java/com/android/server/am/ActivityManagerService.java +69 −39 Original line number Diff line number Diff line Loading @@ -10535,12 +10535,14 @@ public class ActivityManagerService extends IActivityManager.Stub } mAtmInternal.dump( DUMP_STARTER_CMD, fd, pw, args, opti, dumpAll, dumpClient, dumpPackage); if (dumpPackage == null) { pw.println(); if (dumpAll) { pw.println("-------------------------------------------------------------------------------"); } 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) { Loading @@ -10558,32 +10560,26 @@ public class ActivityManagerService extends IActivityManager.Stub } dumpAssociationsLocked(fd, pw, args, opti, dumpAll, dumpClient, dumpPackage); } if (dumpPackage == null) { pw.println(); if (dumpAll) { pw.println("-------------------------------------------------------------------------------"); } mOomAdjProfiler.dump(pw); mProcessList.mAppExitInfoTracker.dumpHistoryProcessExitInfo(pw, dumpPackage); if (dumpPackage == null) { pw.println(); if (dumpAll) { pw.println("-------------------------------------------------------------------------------"); } dumpLmkLocked(pw); } mOomAdjProfiler.dump(pw); pw.println(); if (dumpAll) { pw.println("-------------------------------------------------------------------------------"); } dumpLruLocked(pw, dumpPackage); pw.println(); if (dumpAll) { pw.println("-------------------------------------------------------------------------------"); dumpLmkLocked(pw); } mProcessList.mAppExitInfoTracker.dumpHistoryProcessExitInfo(pw, dumpPackage); pw.println(); if (dumpAll) { pw.println("-------------------------------------------------------------------" + "------------"); pw.println("-------------------------------------------------------------------------------"); } dumpProcessesLocked(fd, pw, args, opti, dumpAll, dumpPackage, dumpAppId); pw.println(); Loading Loading @@ -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) { Loading @@ -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; Loading @@ -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; Loading Loading @@ -11106,7 +11102,8 @@ public class ActivityManagerService extends IActivityManager.Stub " Counts of Binder Proxies held by SYSTEM"); } void dumpLruEntryLocked(PrintWriter pw, int index, ProcessRecord proc) { void dumpLruEntryLocked(PrintWriter pw, int index, ProcessRecord proc, String prefix) { pw.print(prefix); pw.print("#"); pw.print(index); pw.print(": "); Loading Loading @@ -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--) { Loading @@ -11160,10 +11177,11 @@ public class ActivityManagerService extends IActivityManager.Stub continue; } if (first) { pw.print(innerPrefix); pw.println("Activities:"); first = false; } dumpLruEntryLocked(pw, i, r); dumpLruEntryLocked(pw, i, r, innerPrefix); } first = true; for (; i >= mProcessList.mLruProcessServiceStart; i--) { Loading @@ -11172,10 +11190,11 @@ public class ActivityManagerService extends IActivityManager.Stub continue; } if (first) { pw.print(innerPrefix); pw.println("Services:"); first = false; } dumpLruEntryLocked(pw, i, r); dumpLruEntryLocked(pw, i, r, innerPrefix); } first = true; for (; i >= 0; i--) { Loading @@ -11184,11 +11203,13 @@ public class ActivityManagerService extends IActivityManager.Stub continue; } if (first) { pw.print(innerPrefix); pw.println("Other:"); first = false; } dumpLruEntryLocked(pw, i, r); dumpLruEntryLocked(pw, i, r, innerPrefix); } return true; } // TODO: Move to ProcessList? Loading @@ -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); Loading Loading @@ -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)) { Loading @@ -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(); Loading Loading @@ -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, Loading Loading @@ -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; Loading Loading @@ -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);
services/core/java/com/android/server/am/AppExitInfoTracker.java +1 −1 Original line number Diff line number Diff line Loading @@ -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: " Loading
services/core/java/com/android/server/wm/ActivityRecord.java +2 −2 Original line number Diff line number Diff line Loading @@ -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())); Loading
services/core/java/com/android/server/wm/ActivityStack.java +66 −41 Original line number Diff line number Diff line Loading @@ -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; /** Loading Loading @@ -2802,67 +2803,91 @@ class ActivityStack extends Task { } boolean dump(FileDescriptor fd, PrintWriter pw, boolean dumpAll, boolean dumpClient, String dumpPackage, boolean needSep) { String dumpPackage, final boolean needSep) { Runnable headerPrinter = () -> { if (needSep) { pw.println(); } 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); boolean printed = false; 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) { 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; needSep = false; } printed |= printThisActivity(pw, mPausingActivity, dumpPackage, false, " mPausingActivity: ", null); printed |= printThisActivity(pw, getResumedActivity(), dumpPackage, false, " mResumedActivity: ", null); if (dumpAll) { pr = printThisActivity(pw, mLastPausedActivity, dumpPackage, needSep, " mLastPausedActivity: "); if (pr) { printed = true; needSep = true; } printed |= printThisActivity(pw, mLastPausedActivity, dumpPackage, false, " mLastPausedActivity: ", null); printed |= printThisActivity(pw, mLastNoHistoryActivity, dumpPackage, needSep, " mLastNoHistoryActivity: "); 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) -> { final String prefix = " "; Runnable headerPrinter = () -> { printed.set(true); if (!printedHeader.get()) { if (needSep) { pw.println(""); } 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); 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; } 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) { Loading