update_engine: Add staging to update_attempter and omaha_request
Modify update_attempter and omaha_request so that they take the user's
staging settings into account. This includes:
* Turning off scattering if staging is on.
* Preserving scattering values if staging is off.
* Setting staging related persisted values if staging is on.
* Deleting the corresponding persisted values if staging is off.
* Making omaha use the max wait time for staging as its max scatter
period if staging is on.
* Add the corresponding unittests for this.
BUG=chromium:858621
TEST=cros_workon_make update_engine --test
Change-Id: I501f90d9e195b5ceef61d3eac67ab52051793ae9
Reviewed-on: https://chromium-review.googlesource.com/1141217
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Adolfo Higueros <adokar@google.com>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
diff --git a/omaha_request_params.h b/omaha_request_params.h
index 62cbdab..c8e26b5 100644
--- a/omaha_request_params.h
+++ b/omaha_request_params.h
@@ -311,14 +311,14 @@
// Whether the client is accepting rollback images too.
bool rollback_allowed_;
- // True if scattering is enabled, in which case waiting_period_ specifies the
- // amount of absolute time that we've to wait for before sending a request to
- // Omaha.
+ // True if scattering or staging are enabled, in which case waiting_period_
+ // specifies the amount of absolute time that we've to wait for before sending
+ // a request to Omaha.
bool wall_clock_based_wait_enabled_;
base::TimeDelta waiting_period_;
- // True if scattering is enabled to denote the number of update checks
- // we've to skip before we can send a request to Omaha. The min and max
+ // True if scattering or staging are enabled to denote the number of update
+ // checks we've to skip before we can send a request to Omaha. The min and max
// values establish the bounds for a random number to be chosen within that
// range to enable such a wait.
bool update_check_count_wait_enabled_;