Merge "[AMS][Bugfix] Fix hang when dumping local cache info."

This commit is contained in:
Jing Ji
2023-05-10 17:26:13 +00:00
committed by Gerrit Code Review

View File

@@ -10784,6 +10784,13 @@ public class ActivityManagerService extends IActivityManager.Stub
pw.println("\n\n** Cache info for pid " + pid + " [" + r.processName + "] **");
pw.flush();
try {
if (pid == Process.myPid()) {
// Directly dump to target fd for local dump to avoid hang.
try (ParcelFileDescriptor pfd = ParcelFileDescriptor.fromFd(fd.getInt$())) {
thread.dumpCacheInfo(pfd, args);
}
continue;
}
TransferPipe tp = new TransferPipe();
try {
thread.dumpCacheInfo(tp.getWriteFd(), args);