From bde9bc36353554c08fa14a0824842e48a64998c6 Mon Sep 17 00:00:00 2001 From: Collin Fijalkovich Date: Thu, 18 Feb 2021 13:18:10 -0800 Subject: [PATCH] Avoid TransferPipe for local dumpCacheInfo calls Make a process-local call to PropertyInvalidatedCache instead of dumping cache state through a TransferPipe to avoid blocking when the pipe buffer fills. Bug: 180051995 Test: Ran dumpsys cacheinfo and validated output Change-Id: I1e4ab8e1d09b98b379d81079fd26ff2129b5b65a --- .../java/com/android/server/am/ActivityManagerService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 9382e1aa2a9e3..f6fbfeed2b0fc 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -172,6 +172,7 @@ import android.app.NotificationManager; import android.app.PendingIntent; import android.app.ProcessMemoryState; import android.app.ProfilerInfo; +import android.app.PropertyInvalidatedCache; import android.app.WaitResult; import android.app.backup.BackupManager.OperationType; import android.app.backup.IBackupManager; @@ -9835,6 +9836,10 @@ public class ActivityManagerService extends IActivityManager.Stub if (thread != null) { pw.println("\n\n** Cache info for pid " + pid + " [" + r.processName + "] **"); pw.flush(); + if (pid == MY_PID) { + PropertyInvalidatedCache.dumpCacheInfo(fd, args); + continue; + } try { TransferPipe tp = new TransferPipe(); try {