From 979388ef5d5876a63679ee04da9ded996817f04f Mon Sep 17 00:00:00 2001 From: Nandana Dutt Date: Fri, 30 Nov 2018 16:48:55 +0000 Subject: Accept a file descriptor to write bugreport file This will be used via the bugreporting api. Changed dumpstate to do bugreport generation in its own directory in the beginning and to copy over to the destination fd or directory at the very end. BUG: 111441001 Test: adb bugreport Test: adb shell /data/nativetest64/dumpstate_test/dumpstate_test Test: interactive bugreport Change-Id: I83e24f0989a202e84266b6e0fdf8edc14ea639bf --- cmds/dumpstate/utils.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cmds/dumpstate/utils.cpp') diff --git a/cmds/dumpstate/utils.cpp b/cmds/dumpstate/utils.cpp index 6cbb691676..d97ffbf2ed 100644 --- a/cmds/dumpstate/utils.cpp +++ b/cmds/dumpstate/utils.cpp @@ -229,7 +229,11 @@ bool Dumpstate::IsZipping() const { } std::string Dumpstate::GetPath(const std::string& suffix) const { - return android::base::StringPrintf("%s/%s-%s%s", bugreport_dir_.c_str(), base_name_.c_str(), + return GetPath(bugreport_internal_dir_, suffix); +} + +std::string Dumpstate::GetPath(const std::string& directory, const std::string& suffix) const { + return android::base::StringPrintf("%s/%s-%s%s", directory.c_str(), base_name_.c_str(), name_.c_str(), suffix.c_str()); } -- cgit v1.2.3-59-g8ed1b