Fix side effects of trace-ipc and dumpheap commands am: 4c0b9a5fbd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14982641 Change-Id: I10aa11a0945092a01a1d27c8b4cbba0b91ac37ca
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user