summaryrefslogtreecommitdiff
path: root/bugreport.cpp
diff options
context:
space:
mode:
authorFelipe Leme <felipeal@google.com>2016-08-15 16:01:58 -0700
committerJosh Gao <jmgao@google.com>2016-08-30 13:06:37 -0700
commitbeed1fbb9f6f3c97aab9959a53f3deca96bffc03 (patch)
treecd4269d3f4fa2e3312df664f2a3fd52d89e54292 /bugreport.cpp
parent7fc82442f7a87e829600d099e3fafa5289a1026b (diff)
downloadadb-beed1fbb9f6f3c97aab9959a53f3deca96bffc03.tar.gz
DO NOT MERGE: Split 'generating' and 'pulling' in 2 messages.
BUG: 30799929 Change-Id: I0af0ad2478c57ffc5b2c953118e01677f788d14a (cherry picked from commit 9c0be90528baee54182334048af467e3dde74d72) (cherry picked from commit 321c21e2df13cb375a9c96dbdbb7c849734a9293)
Diffstat (limited to 'bugreport.cpp')
-rw-r--r--bugreport.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/bugreport.cpp b/bugreport.cpp
index 9ed44a7..c348dd5 100644
--- a/bugreport.cpp
+++ b/bugreport.cpp
@@ -47,7 +47,7 @@ class BugreportStandardStreamsCallback : public StandardStreamsCallbackInterface
show_progress_(show_progress),
status_(0),
line_() {
- SetLineMessage();
+ SetLineMessage("generating");
}
void OnStdout(const char* buffer, int length) {
@@ -97,6 +97,7 @@ class BugreportStandardStreamsCallback : public StandardStreamsCallbackInterface
OS_PATH_SEPARATOR, dest_file_.c_str());
}
std::vector<const char*> srcs{src_file_.c_str()};
+ SetLineMessage("pulling");
status_ =
br_->DoSyncPull(srcs, destination.c_str(), true, line_message_.c_str()) ? 0 : 1;
if (status_ != 0) {
@@ -111,9 +112,8 @@ class BugreportStandardStreamsCallback : public StandardStreamsCallbackInterface
}
private:
- void SetLineMessage() {
- line_message_ =
- android::base::StringPrintf("generating %s", adb_basename(dest_file_).c_str());
+ void SetLineMessage(const std::string& action) {
+ line_message_ = action + " " + adb_basename(dest_file_);
}
void SetSrcFile(const std::string path) {
@@ -121,7 +121,7 @@ class BugreportStandardStreamsCallback : public StandardStreamsCallbackInterface
if (!dest_dir_.empty()) {
// Only uses device-provided name when user passed a directory.
dest_file_ = adb_basename(path);
- SetLineMessage();
+ SetLineMessage("generating");
}
}