update_engine: Don't keep pointer to SystemState available objects
These objects are available thorugh SystemState. No need to keep pointer
to them in various classes (OmahaRequestBuilderXml in this case). This
makes testing/debugging easier because there will be one central
location for getting pointers to these values.
BUG=b:171829801
TEST=cros_workon_make --board reef --test update_engine
Change-Id: I02a36afdc7dcb00e02b1a61263141745afc7fb26
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2543814
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Jae Hoon Kim <kimjae@chromium.org>
Commit-Queue: Amin Hassani <ahassani@chromium.org>
diff --git a/cros/omaha_request_action.cc b/cros/omaha_request_action.cc
index 6f270c0..f847194 100644
--- a/cros/omaha_request_action.cc
+++ b/cros/omaha_request_action.cc
@@ -456,19 +456,17 @@
return;
}
- auto* params = SystemState::Get()->request_params();
OmahaRequestBuilderXml omaha_request(event_.get(),
- params,
ping_only_,
ShouldPing(), // include_ping
ping_active_days_,
ping_roll_call_days_,
GetInstallDate(),
- SystemState::Get()->prefs(),
session_id_);
string request_post = omaha_request.GetRequest();
// Set X-Goog-Update headers.
+ const auto* params = SystemState::Get()->request_params();
http_fetcher_->SetHeader(kXGoogleUpdateInteractivity,
params->interactive() ? "fg" : "bg");
http_fetcher_->SetHeader(kXGoogleUpdateAppId, params->GetAppId());