adb: don't spew push/pull progress to dumb terminals.
Bug: http://b/113070277
Test: adb push 100mb /data/local/tmp | cat
Test: adb sync | cat
Change-Id: I252bdbdbde825bba903f43bd892262786a58c4e4
diff --git a/client/line_printer.cpp b/client/line_printer.cpp
index 9758526..4dc2d28 100644
--- a/client/line_printer.cpp
+++ b/client/line_printer.cpp
@@ -67,7 +67,11 @@
void LinePrinter::Print(string to_print, LineType type) {
if (!smart_terminal_) {
- Out(to_print + "\n");
+ if (type == LineType::INFO) {
+ info_line_ = to_print + "\n";
+ } else {
+ Out(to_print + "\n");
+ }
return;
}
@@ -123,6 +127,11 @@
}
void LinePrinter::KeepInfoLine() {
- if (!have_blank_line_) Out("\n");
- have_blank_line_ = true;
+ if (smart_terminal_) {
+ if (!have_blank_line_) Out("\n");
+ have_blank_line_ = true;
+ } else {
+ Out(info_line_);
+ info_line_.clear();
+ }
}