diff options
author | Gavin Corkery <gavincorkery@google.com> | 2021-02-25 16:19:04 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-02-25 16:19:04 +0000 |
commit | 75dbd5e96c2a48412989121771c476e7941a464d (patch) | |
tree | 892df6223f664749fca9a7fa3723187af90b0e1e | |
parent | f867ed2f2a47e8521566735cefa3fa85bdfdb090 (diff) | |
parent | 789d7a5882cba2074e8a389e75ddbc29ef4c3cf7 (diff) | |
download | native-75dbd5e96c2a48412989121771c476e7941a464d.tar.gz |
Merge "Store ANR traces in internal directory"
-rw-r--r-- | cmds/dumpstate/dumpstate.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp index 528feca0cf..e377f1659f 100644 --- a/cmds/dumpstate/dumpstate.cpp +++ b/cmds/dumpstate/dumpstate.cpp @@ -2060,7 +2060,7 @@ static void DumpstateWifiOnly() { } Dumpstate::RunStatus Dumpstate::DumpTraces(const char** path) { - const std::string temp_file_pattern = "/data/anr/dumptrace_XXXXXX"; + const std::string temp_file_pattern = ds.bugreport_internal_dir_ + "/dumptrace_XXXXXX"; const size_t buf_size = temp_file_pattern.length() + 1; std::unique_ptr<char[]> file_name_buf(new char[buf_size]); memcpy(file_name_buf.get(), temp_file_pattern.c_str(), buf_size); @@ -3067,6 +3067,9 @@ void Dumpstate::CleanupTmpFiles() { android::os::UnlinkAndLogOnError(tmp_path_); android::os::UnlinkAndLogOnError(screenshot_path_); android::os::UnlinkAndLogOnError(path_); + if (dump_traces_path != nullptr) { + android::os::UnlinkAndLogOnError(dump_traces_path); + } } void Dumpstate::EnableParallelRunIfNeeded() { |