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
This commit is contained in:
Collin Fijalkovich
2021-02-18 13:18:10 -08:00
parent 989bc8cd01
commit bde9bc3635

View File

@@ -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 {