aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao2017-01-21 15:03:25 -0600
committerTao Bao2017-01-21 22:43:45 -0600
commitf013642477dbe0a5ed8d440571e9c8676ed42b2d (patch)
tree536ba1489bcc83a8594ff7efc69ec3457de70664 /install.cpp
parente78ca37656d72d10952727c20f20c5044b4b3db0 (diff)
downloadplatform-bootable-recovery-f013642477dbe0a5ed8d440571e9c8676ed42b2d.tar.gz
platform-bootable-recovery-f013642477dbe0a5ed8d440571e9c8676ed42b2d.tar.xz
platform-bootable-recovery-f013642477dbe0a5ed8d440571e9c8676ed42b2d.zip
Print with newline for ui_print.
Currently the ui_print command between the recovery and updater doesn't append newline. Updater has to send an extra "ui_print" command without any argument to get the line break. This looks unnecessary. And not all the callers (including the ones in bootable/recovery) are following this protocol when sending the ui_print command. This CL simplifies the protocol to always print with a newline for ui_print command. When updating from an old recovery with the new updater, all the ui_print'd strings would appear in one line as a side effect. But a) it would only affect the text-mode UI, which won't be shown to users; b) log files won't be affected. Bug: 32305035 Test: Apply an update with the new updater on top of an old and new recovery image respectively. Change-Id: I305a0ffc6f180daf60919cf99d24d1495d68749b
Diffstat (limited to 'install.cpp')
-rw-r--r--install.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/install.cpp b/install.cpp
index d3ab2136..959a7422 100644
--- a/install.cpp
+++ b/install.cpp
@@ -420,11 +420,7 @@ static int try_update_binary(const char* path, ZipArchiveHandle zip, bool* wipe_
420 LOG(ERROR) << "invalid \"set_progress\" parameters: " << line; 420 LOG(ERROR) << "invalid \"set_progress\" parameters: " << line;
421 } 421 }
422 } else if (command == "ui_print") { 422 } else if (command == "ui_print") {
423 if (!args.empty()) { 423 ui->PrintOnScreenOnly("%s\n", args.c_str());
424 ui->PrintOnScreenOnly("%s", args.c_str());
425 } else {
426 ui->PrintOnScreenOnly("\n");
427 }
428 fflush(stdout); 424 fflush(stdout);
429 } else if (command == "wipe_cache") { 425 } else if (command == "wipe_cache") {
430 *wipe_cache = true; 426 *wipe_cache = true;