summaryrefslogtreecommitdiff
path: root/update_engine_client.cc
diff options
context:
space:
mode:
authorJae Hoon Kim <kimjae@chromium.org>2019-07-25 13:20:43 -0700
committerCommit Bot <commit-bot@chromium.org>2019-07-30 20:04:20 +0000
commit2f78c1c636cd5476192060f604fd32839aa07c3b (patch)
tree107d511bcea82a4ca37ae89e909f8720c63a752a /update_engine_client.cc
parent493fecb3f48c8478fd3ef244d631d857730dd14d (diff)
update_engine: Leverage install indication in StatusResult protobuf
Update engine will provide this install indication for signal listeners (specifically dlcservice) and status requesters to indicate whether update engine is in the process of installing or updating. With this, dlcservice will can be altered to not probe update engine for status during a DLC uninstall. The update engine client is also updated when getting the status from update engine by using KeyValueStore printouts now. Old output: [0725/202915.815630:INFO:update_engine_client.cc(501)] Querying Update Engine status... LAST_CHECKED_TIME=1564102396 PROGRESS=1.000000 CURRENT_OP=UPDATE_STATUS_IDLE NEW_VERSION=12354.0.2019_07_19_1136 NEW_SIZE=792 New output: [0726/173804.558077:INFO:update_engine_client.cc(490)] Querying Update Engine status... CURRENT_OPERATION=UPDATE_STATUS_IDLE IS_INSTALL=false LAST_CHECKED_TIME=1564187860 NEW_SIZE=792 NEW_VERSION=12369.0.2019_07_26_0904 PROGRESS=1.0 BUG=chromium:871340 TEST=FEATURES="test" emerge-$BOARD update_engine update_engine-client system_api TEST=/usr/bin/update_engine_client --status Cq-Depend: chromium:1717661 Change-Id: Iaacea27e0fc0711200ec81fdebb7fef45f94af43
Diffstat (limited to 'update_engine_client.cc')
-rw-r--r--update_engine_client.cc17
1 files changed, 3 insertions, 14 deletions
diff --git a/update_engine_client.cc b/update_engine_client.cc
index 1b680d12..954e856d 100644
--- a/update_engine_client.cc
+++ b/update_engine_client.cc
@@ -41,6 +41,7 @@
using chromeos_update_engine::EolStatus;
using chromeos_update_engine::ErrorCode;
+using chromeos_update_engine::UpdateEngineStatusToString;
using chromeos_update_engine::UpdateStatusToString;
using chromeos_update_engine::utils::ErrorCodeToString;
using std::string;
@@ -138,12 +139,7 @@ class WatchingStatusUpdateHandler : public ExitingStatusUpdateHandler {
void WatchingStatusUpdateHandler::HandleStatusUpdate(
const UpdateEngineStatus& status) {
- LOG(INFO) << "Got status update:";
- LOG(INFO) << " last_checked_time: " << status.last_checked_time;
- LOG(INFO) << " progress: " << status.progress;
- LOG(INFO) << " current_operation: " << UpdateStatusToString(status.status);
- LOG(INFO) << " new_version: " << status.new_version;
- LOG(INFO) << " new_size: " << status.new_size_bytes;
+ LOG(INFO) << "Got status update: " << UpdateEngineStatusToString(status);
}
bool UpdateEngineClient::ShowStatus() {
@@ -161,14 +157,7 @@ bool UpdateEngineClient::ShowStatus() {
base::TimeDelta::FromSeconds(kShowStatusRetryIntervalInSeconds));
}
- printf("LAST_CHECKED_TIME=%" PRIi64
- "\nPROGRESS=%f\nCURRENT_OP=%s\n"
- "NEW_VERSION=%s\nNEW_SIZE=%" PRIi64 "\n",
- status.last_checked_time,
- status.progress,
- UpdateStatusToString(status.status),
- status.new_version.c_str(),
- status.new_size_bytes);
+ printf("%s", UpdateEngineStatusToString(status).c_str());
return true;
}