update_engine: Make policy UpdateCheckParams processing easier
Currently there are a ton of arguments from UpdateCheckParams that is
passed around in the udpate_attampter.cc. With this CL UpdateCheckParams
is directy passed and this simplies the logic.
BUG=b:171829801
TEST=cros_workon_make --board reef --test update_enigne
Change-Id: If454f6393fc6e28d41fa5d14d184f0db32e8bd19
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2504453
Commit-Queue: Amin Hassani <ahassani@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Jae Hoon Kim <kimjae@chromium.org>
diff --git a/update_attempter.h b/update_attempter.h
index 6c93150..3a1bef4 100644
--- a/update_attempter.h
+++ b/update_attempter.h
@@ -76,23 +76,8 @@
virtual bool ScheduleUpdates();
// Checks for update and, if a newer version is available, attempts to update
- // the system. Non-empty |in_app_version| or |in_update_url| prevents
- // automatic detection of the parameter. |target_channel| denotes a
- // policy-mandated channel we are updating to, if not empty. If |obey_proxies|
- // is true, the update will likely respect Chrome's proxy setting. For
- // security reasons, we may still not honor them. |interactive| should be true
- // if this was called from the user (ie dbus).
- virtual void Update(const std::string& app_version,
- const std::string& omaha_url,
- const std::string& target_channel,
- const std::string& lts_tag,
- const std::string& target_version_prefix,
- bool rollback_allowed,
- bool rollback_data_save_requested,
- int rollback_allowed_milestones,
- bool rollback_on_channel_downgrade,
- bool obey_proxies,
- bool interactive);
+ // the system.
+ virtual void Update(const chromeos_update_manager::UpdateCheckParams& params);
// ActionProcessorDelegate methods:
void ProcessingDone(const ActionProcessor* processor,
@@ -371,17 +356,8 @@
// Helper method of Update() to calculate the update-related parameters
// from various sources and set the appropriate state. Please refer to
// Update() method for the meaning of the parameters.
- bool CalculateUpdateParams(const std::string& app_version,
- const std::string& omaha_url,
- const std::string& target_channel,
- const std::string& lts_tag,
- const std::string& target_version_prefix,
- bool rollback_allowed,
- bool rollback_data_save_requested,
- int rollback_allowed_milestones,
- bool rollback_on_channel_downgrade,
- bool obey_proxies,
- bool interactive);
+ bool CalculateUpdateParams(
+ const chromeos_update_manager::UpdateCheckParams& params);
// Calculates all the scattering related parameters (such as waiting period,
// which type of scattering is enabled, etc.) and also updates/deletes