diff options
| author | 2021-06-25 18:12:21 +0000 | |
|---|---|---|
| committer | 2021-06-25 18:12:21 +0000 | |
| commit | cb8e4e8db646e0348bbaa37ceeeea8f49d3d0165 (patch) | |
| tree | 79bd41f0e7f2510c4f7e5fa4757bb0db01fc5d08 | |
| parent | ffdad637f3732c54556cf5fc30ffc21a02453f2b (diff) | |
| parent | 5518a714f33f456a9e88aa0e189f38363341ee98 (diff) | |
Fix side effects of trace-ipc and dumpheap commands am: 4c0b9a5fbd am: 5518a714f3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14982641
Change-Id: I2cd91b0de1757c122625b2535a10b5092d57d42a
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityManagerShellCommand.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java index 9f3a7e93a433..cc45cf8e4718 100644 --- a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java +++ b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java @@ -90,7 +90,6 @@ import com.android.internal.util.MemInfoReader; import com.android.internal.util.Preconditions; import java.io.BufferedReader; -import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -759,8 +758,7 @@ final class ActivityManagerShellCommand extends ShellCommand { return -1; } - File file = new File(filename); - file.delete(); + // Writes an error message to stderr on failure ParcelFileDescriptor fd = openFileForSystem(filename, "w"); if (fd == null) { return -1; @@ -917,8 +915,7 @@ final class ActivityManagerShellCommand extends ShellCommand { pw.println("File: " + heapFile); pw.flush(); - File file = new File(heapFile); - file.delete(); + // Writes an error message to stderr on failure ParcelFileDescriptor fd = openFileForSystem(heapFile, "w"); if (fd == null) { return -1; |