Fix side effects of trace-ipc and dumpheap commands am: 4c0b9a5fbd am: 5518a714f3 am: cb8e4e8db6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14982641 Change-Id: I65246cca8e1b07d7005ef298505e2dd688d22ced
This commit is contained in:
@@ -94,7 +94,6 @@ import com.android.internal.util.MemInfoReader;
|
|||||||
import com.android.server.compat.PlatformCompat;
|
import com.android.server.compat.PlatformCompat;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
@@ -787,8 +786,7 @@ final class ActivityManagerShellCommand extends ShellCommand {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
File file = new File(filename);
|
// Writes an error message to stderr on failure
|
||||||
file.delete();
|
|
||||||
ParcelFileDescriptor fd = openFileForSystem(filename, "w");
|
ParcelFileDescriptor fd = openFileForSystem(filename, "w");
|
||||||
if (fd == null) {
|
if (fd == null) {
|
||||||
return -1;
|
return -1;
|
||||||
@@ -945,8 +943,7 @@ final class ActivityManagerShellCommand extends ShellCommand {
|
|||||||
pw.println("File: " + heapFile);
|
pw.println("File: " + heapFile);
|
||||||
pw.flush();
|
pw.flush();
|
||||||
|
|
||||||
File file = new File(heapFile);
|
// Writes an error message to stderr on failure
|
||||||
file.delete();
|
|
||||||
ParcelFileDescriptor fd = openFileForSystem(heapFile, "w");
|
ParcelFileDescriptor fd = openFileForSystem(heapFile, "w");
|
||||||
if (fd == null) {
|
if (fd == null) {
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user