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

Commit 695560e0 authored by Jing Ji's avatar Jing Ji Committed by Automerger Merge Worker
Browse files

Merge "[AMS][Bugfix] Fix hang when dumping local cache info." am: 4e52496e am: 5d682d6c

parents 3adbf0b4 5d682d6c
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -10822,6 +10822,13 @@ public class ActivityManagerService extends IActivityManager.Stub
                pw.println("\n\n** Cache info for pid " + pid + " [" + r.processName + "] **");
                pw.println("\n\n** Cache info for pid " + pid + " [" + r.processName + "] **");
                pw.flush();
                pw.flush();
                try {
                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();
                    TransferPipe tp = new TransferPipe();
                    try {
                    try {
                        thread.dumpCacheInfo(tp.getWriteFd(), args);
                        thread.dumpCacheInfo(tp.getWriteFd(), args);