update_engine: Reports whether the update is interactive in StatusResult Report this in StatusResult so the UI can determine whether to show update progress based on interactive/non-interactive update. BUG=b:244480509 TEST=FEATURES=test emerge-$B update_engine Cq-Depend: chromium:3911159 Change-Id: Icec6e3e8a6f91d5cfdf5d0b66faa73bacca3db18 Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/3911578 Commit-Queue: Yuanpeng Ni <yuanpengni@chromium.org> Reviewed-by: Jae Hoon Kim <kimjae@chromium.org> Tested-by: Yuanpeng Ni <yuanpengni@chromium.org>
diff --git a/client_library/client_dbus.cc b/client_library/client_dbus.cc index 01992f8..acf138a 100644 --- a/client_library/client_dbus.cc +++ b/client_library/client_dbus.cc
@@ -62,6 +62,7 @@ out_status->update_urgency_internal = static_cast<UpdateUrgencyInternal>(status.update_urgency()); out_status->last_attempt_error = status.last_attempt_error(); + out_status->is_interactive = status.is_interactive(); } } // namespace
diff --git a/client_library/include/update_engine/update_status.h b/client_library/include/update_engine/update_status.h index 2fd3a15..626af9f 100644 --- a/client_library/include/update_engine/update_status.h +++ b/client_library/include/update_engine/update_status.h
@@ -102,8 +102,8 @@ uint64_t new_size_bytes; // New product version. std::string new_version; - // Wether the update is an enterprise rollback. The value is valid only if the - // current operation is passed CHECKING_FOR_UPDATE. + // Whether the update is an enterprise rollback. The value is valid only if + // the current operation is passed CHECKING_FOR_UPDATE. bool is_enterprise_rollback; // Indication of install for DLC(s). bool is_install; @@ -117,6 +117,8 @@ UpdateUrgencyInternal update_urgency_internal; // Features managed by update_engine. FeatureInternalList features; + // Whether the update is interactive. + bool is_interactive; }; } // namespace update_engine
diff --git a/cros/dbus_service.cc b/cros/dbus_service.cc index df49c2f..c9111c0 100644 --- a/cros/dbus_service.cc +++ b/cros/dbus_service.cc
@@ -58,6 +58,7 @@ out_feature->set_name(feature.name); out_feature->set_enabled(feature.enabled); } + out_status->set_is_interactive(ue_status.is_interactive); } } // namespace
diff --git a/cros/update_attempter.cc b/cros/update_attempter.cc index 7a86263..d956bfb 100644 --- a/cros/update_attempter.cc +++ b/cros/update_attempter.cc
@@ -1771,6 +1771,7 @@ } } out_status->features = std::move(features); + out_status->is_interactive = omaha_request_params_->interactive(); return true; }
diff --git a/update_status_utils.cc b/update_status_utils.cc index 6ed53b3..651d071 100644 --- a/update_status_utils.cc +++ b/update_status_utils.cc
@@ -46,6 +46,7 @@ const char kProgress[] = "PROGRESS"; const char kWillPowerwashAfterReboot[] = "WILL_POWERWASH_AFTER_REBOOT"; const char kLastAttemptError[] = "LAST_ATTEMPT_ERROR"; +const char kIsInteractive[] = "IS_INTERACTIVE"; } // namespace @@ -101,6 +102,7 @@ key_value_store.SetString(kLastAttemptError, utils::ErrorCodeToString(static_cast<ErrorCode>( status.last_attempt_error))); + key_value_store.SetBoolean(kIsInteractive, status.is_interactive); return key_value_store.SaveToString(); }
diff --git a/update_status_utils_unittest.cc b/update_status_utils_unittest.cc index 76a98b2..ce4147a 100644 --- a/update_status_utils_unittest.cc +++ b/update_status_utils_unittest.cc
@@ -37,11 +37,13 @@ .is_install = true, .will_powerwash_after_reboot = true, .last_attempt_error = 0, + .is_interactive = true, }; string print = R"(CURRENT_OP=UPDATE_STATUS_CHECKING_FOR_UPDATE IS_ENTERPRISE_ROLLBACK=true IS_INSTALL=true +IS_INTERACTIVE=true LAST_ATTEMPT_ERROR=ErrorCode::kSuccess LAST_CHECKED_TIME=156000000 NEW_SIZE=888