update_engine: fix english
Fix the english for accuracy regarding DLC.
BUG=chromium:897882
TEST=None
Change-Id: I72ab9ecb7903bb5fb35597222cd7c8b1f4244cfc
Reviewed-on: https://chromium-review.googlesource.com/1351359
Commit-Ready: Xiaochu Liu <xiaochu@chromium.org>
Tested-by: Xiaochu Liu <xiaochu@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
diff --git a/boot_control_chromeos.cc b/boot_control_chromeos.cc
index 724dab0..40fc349 100644
--- a/boot_control_chromeos.cc
+++ b/boot_control_chromeos.cc
@@ -149,20 +149,21 @@
bool BootControlChromeOS::GetPartitionDevice(const string& partition_name,
unsigned int slot,
string* device) const {
- // Partition name prefixed with |kPartitionNamePrefixDlc| is a DLC.
+ // Partition name prefixed with |kPartitionNamePrefixDlc| is a DLC module.
if (base::StartsWith(partition_name,
kPartitionNamePrefixDlc,
base::CompareCase::SENSITIVE)) {
- // Extract DLC ID from partition_name (DLC ID is the string after
- // |kPartitionNamePrefixDlc| in partition_name).
- const auto dlc_id = partition_name.substr(strlen(kPartitionNamePrefixDlc));
- if (dlc_id.empty()) {
- LOG(ERROR) << " partition name does not contain dlc id:"
+ // Extract DLC module ID from partition_name (DLC module ID is the string
+ // after |kPartitionNamePrefixDlc| in partition_name).
+ const auto dlc_module_id =
+ partition_name.substr(strlen(kPartitionNamePrefixDlc));
+ if (dlc_module_id.empty()) {
+ LOG(ERROR) << " partition name does not contain DLC module ID:"
<< partition_name;
return false;
}
*device = base::FilePath(kDlcInstallRootDirectoryEncrypted)
- .Append(dlc_id)
+ .Append(dlc_module_id)
.Append(slot == 0 ? kPartitionNameDlcA : kPartitionNameDlcB)
.Append(kPartitionNameDlcImage)
.value();
diff --git a/client_library/client_dbus.cc b/client_library/client_dbus.cc
index 2257d2e..e0d1f64 100644
--- a/client_library/client_dbus.cc
+++ b/client_library/client_dbus.cc
@@ -57,14 +57,14 @@
nullptr);
}
-bool DBusUpdateEngineClient::AttemptInstall(const string& omaha_url,
- const vector<string>& dlc_ids) {
+bool DBusUpdateEngineClient::AttemptInstall(
+ const string& omaha_url, const vector<string>& dlc_module_ids) {
// Convert parameters into protobuf.
chromeos_update_engine::DlcParameters dlc_parameters;
dlc_parameters.set_omaha_url(omaha_url);
- for (const auto& dlc_id : dlc_ids) {
+ for (const auto& dlc_module_id : dlc_module_ids) {
chromeos_update_engine::DlcInfo* dlc_info = dlc_parameters.add_dlc_infos();
- dlc_info->set_dlc_id(dlc_id);
+ dlc_info->set_dlc_id(dlc_module_id);
}
string dlc_request;
if (dlc_parameters.SerializeToString(&dlc_request)) {
diff --git a/client_library/client_dbus.h b/client_library/client_dbus.h
index 0fa2cc3..a186d45 100644
--- a/client_library/client_dbus.h
+++ b/client_library/client_dbus.h
@@ -42,7 +42,7 @@
bool at_user_request) override;
bool AttemptInstall(const std::string& omaha_url,
- const std::vector<std::string>& dlc_ids) override;
+ const std::vector<std::string>& dlc_module_ids) override;
bool GetStatus(int64_t* out_last_checked_time,
double* out_progress,
diff --git a/client_library/include/update_engine/client.h b/client_library/include/update_engine/client.h
index 183768d..1bc6111 100644
--- a/client_library/include/update_engine/client.h
+++ b/client_library/include/update_engine/client.h
@@ -48,16 +48,17 @@
const std::string& omaha_url,
bool at_user_request) = 0;
- // Request the update_engine to install a list of DLC.
+ // Request the update_engine to install a list of DLC modules.
// |omaha_url|
// Force update_engine to look for updates from the given server. Passing
// empty indicates update_engine should use its default value. Note that
// update_engine will ignore this parameter in production mode to avoid
// pulling untrusted updates.
- // |dlc_ids|
- // A vector of DLC IDs.
- virtual bool AttemptInstall(const std::string& omaha_url,
- const std::vector<std::string>& dlc_ids) = 0;
+ // |dlc_module_ids|
+ // A list of DLC module IDs.
+ virtual bool AttemptInstall(
+ const std::string& omaha_url,
+ const std::vector<std::string>& dlc_module_ids) = 0;
// Returns the current status of the Update Engine.
//
diff --git a/common_service.cc b/common_service.cc
index 213267c..6420b65 100644
--- a/common_service.cc
+++ b/common_service.cc
@@ -106,8 +106,9 @@
bool UpdateEngineService::AttemptInstall(brillo::ErrorPtr* error,
const string& omaha_url,
- const vector<string>& dlc_ids) {
- if (!system_state_->update_attempter()->CheckForInstall(dlc_ids, omaha_url)) {
+ const vector<string>& dlc_module_ids) {
+ if (!system_state_->update_attempter()->CheckForInstall(dlc_module_ids,
+ omaha_url)) {
// TODO(xiaochu): support more detailed error messages.
LogAndSetError(error, FROM_HERE, "Could not schedule install operation.");
return false;
diff --git a/common_service.h b/common_service.h
index dbf897e..f93855d 100644
--- a/common_service.h
+++ b/common_service.h
@@ -53,12 +53,12 @@
int32_t in_flags_as_int,
bool* out_result);
- // Attempts a DLC install operation.
+ // Attempts a DLC module install operation.
// |omaha_url|: the URL to query for update.
- // |dlc_ids|: a list of DLC IDs.
+ // |dlc_module_ids|: a list of DLC module IDs.
bool AttemptInstall(brillo::ErrorPtr* error,
const std::string& omaha_url,
- const std::vector<std::string>& dlc_ids);
+ const std::vector<std::string>& dlc_module_ids);
bool AttemptRollback(brillo::ErrorPtr* error, bool in_powerwash);
diff --git a/dbus_service.cc b/dbus_service.cc
index 0eec01d..03425b6 100644
--- a/dbus_service.cc
+++ b/dbus_service.cc
@@ -73,16 +73,17 @@
return false;
}
// Extract fields from the protobuf.
- vector<string> dlc_ids;
+ vector<string> dlc_module_ids;
for (const auto& dlc_info : dlc_parameters.dlc_infos()) {
if (dlc_info.dlc_id().empty()) {
*error = brillo::Error::Create(
FROM_HERE, "update_engine", "INTERNAL", "parameters are invalid.");
return false;
}
- dlc_ids.push_back(dlc_info.dlc_id());
+ dlc_module_ids.push_back(dlc_info.dlc_id());
}
- return common_->AttemptInstall(error, dlc_parameters.omaha_url(), dlc_ids);
+ return common_->AttemptInstall(
+ error, dlc_parameters.omaha_url(), dlc_module_ids);
}
bool DBusUpdateEngineService::AttemptRollback(ErrorPtr* error,
diff --git a/mock_update_attempter.h b/mock_update_attempter.h
index eaa0785..c5fcec8 100644
--- a/mock_update_attempter.h
+++ b/mock_update_attempter.h
@@ -53,7 +53,7 @@
UpdateAttemptFlags flags));
MOCK_METHOD2(CheckForInstall,
- bool(const std::vector<std::string>& dlc_ids,
+ bool(const std::vector<std::string>& dlc_module_ids,
const std::string& omaha_url));
MOCK_METHOD0(RefreshDevicePolicy, void(void));
diff --git a/omaha_request_action.cc b/omaha_request_action.cc
index 6adacc3..9cb9b49 100644
--- a/omaha_request_action.cc
+++ b/omaha_request_action.cc
@@ -437,14 +437,15 @@
install_date_in_days,
system_state);
}
- // Create APP ID according to |dlc_id| (sticking the current AppID to the DLC
- // ID with an underscode).
- for (const auto& dlc_id : params->dlc_ids()) {
- OmahaAppData dlc_app = {.id = params->GetAppId() + "_" + dlc_id,
- .version = params->app_version()};
+ // Create APP ID according to |dlc_module_id| (sticking the current AppID to
+ // the DLC module ID with an underscode).
+ for (const auto& dlc_module_id : params->dlc_module_ids()) {
+ OmahaAppData dlc_module_app = {
+ .id = params->GetAppId() + "_" + dlc_module_id,
+ .version = params->app_version()};
app_xml += GetAppXml(event,
params,
- dlc_app,
+ dlc_module_app,
ping_only,
include_ping,
false, /* skip_updatecheck */
diff --git a/omaha_request_action_unittest.cc b/omaha_request_action_unittest.cc
index 06d937d..c758fbd 100644
--- a/omaha_request_action_unittest.cc
+++ b/omaha_request_action_unittest.cc
@@ -317,7 +317,7 @@
request_params_.set_rollback_allowed(false);
request_params_.set_is_powerwash_allowed(false);
request_params_.set_is_install(false);
- request_params_.set_dlc_ids({});
+ request_params_.set_dlc_module_ids({});
fake_system_state_.set_request_params(&request_params_);
fake_system_state_.set_prefs(&fake_prefs_);
@@ -3103,7 +3103,7 @@
TEST_F(OmahaRequestActionTest, InstallTest) {
OmahaResponse response;
request_params_.set_is_install(true);
- request_params_.set_dlc_ids({"dlc_no_0", "dlc_no_1"});
+ request_params_.set_dlc_module_ids({"dlc_no_0", "dlc_no_1"});
brillo::Blob post_data;
ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-1,
@@ -3119,10 +3119,10 @@
&post_data));
// Convert post_data to string.
string post_str(post_data.begin(), post_data.end());
- for (const auto& dlc_id : request_params_.dlc_ids()) {
+ for (const auto& dlc_module_id : request_params_.dlc_module_ids()) {
EXPECT_NE(string::npos,
post_str.find("appid=\"" + fake_update_response_.app_id + "_" +
- dlc_id + "\""));
+ dlc_module_id + "\""));
}
EXPECT_NE(string::npos,
post_str.find("appid=\"" + fake_update_response_.app_id + "\""));
@@ -3134,14 +3134,14 @@
updatecheck_count++;
pos++;
}
- EXPECT_EQ(request_params_.dlc_ids().size(), updatecheck_count);
+ EXPECT_EQ(request_params_.dlc_module_ids().size(), updatecheck_count);
}
TEST_F(OmahaRequestActionTest, InstallMissingPlatformVersionTest) {
fake_update_response_.multi_app_skip_updatecheck = true;
fake_update_response_.multi_app_no_update = false;
request_params_.set_is_install(true);
- request_params_.set_dlc_ids({"dlc_no_0", "dlc_no_1"});
+ request_params_.set_dlc_module_ids({"dlc_no_0", "dlc_no_1"});
request_params_.set_app_id(fake_update_response_.app_id_skip_updatecheck);
OmahaResponse response;
ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
diff --git a/omaha_request_params.cc b/omaha_request_params.cc
index 4b72328..c458424 100644
--- a/omaha_request_params.cc
+++ b/omaha_request_params.cc
@@ -123,7 +123,7 @@
// Set the interactive flag accordingly.
interactive_ = in_interactive;
- dlc_ids_.clear();
+ dlc_module_ids_.clear();
// Set false so it will do update by default.
is_install_ = false;
return true;
diff --git a/omaha_request_params.h b/omaha_request_params.h
index 1bebf1c..1bfa471 100644
--- a/omaha_request_params.h
+++ b/omaha_request_params.h
@@ -165,10 +165,13 @@
inline int64_t max_update_checks_allowed() const {
return max_update_checks_allowed_;
}
- inline void set_dlc_ids(const std::vector<std::string>& dlc_ids) {
- dlc_ids_ = dlc_ids;
+ inline void set_dlc_module_ids(
+ const std::vector<std::string>& dlc_module_ids) {
+ dlc_module_ids_ = dlc_module_ids;
}
- inline std::vector<std::string> dlc_ids() const { return dlc_ids_; }
+ inline std::vector<std::string> dlc_module_ids() const {
+ return dlc_module_ids_;
+ }
inline void set_is_install(bool is_install) { is_install_ = is_install; }
inline bool is_install() const { return is_install_; }
@@ -336,12 +339,12 @@
// When reading files, prepend root_ to the paths. Useful for testing.
std::string root_;
- // A list of DLC ID to install.
- std::vector<std::string> dlc_ids_;
+ // A list of DLC module IDs to install.
+ std::vector<std::string> dlc_module_ids_;
// This variable defines whether the payload is being installed in the current
- // partition. At the moment, his is used for installing DLCs on the current
- // active partition instead of the inactive partition.
+ // partition. At the moment, this is used for installing DLC modules on the
+ // current active partition instead of the inactive partition.
bool is_install_;
DISALLOW_COPY_AND_ASSIGN(OmahaRequestParams);
diff --git a/update_attempter.cc b/update_attempter.cc
index 6019e6d..f47a63e 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -419,8 +419,8 @@
// target channel.
omaha_request_params_->UpdateDownloadChannel();
}
- // Set the DLC ID list.
- omaha_request_params_->set_dlc_ids(dlc_ids_);
+ // Set the DLC module ID list.
+ omaha_request_params_->set_dlc_module_ids(dlc_module_ids_);
omaha_request_params_->set_is_install(is_install_);
LOG(INFO) << "target_version_prefix = "
@@ -797,7 +797,7 @@
bool UpdateAttempter::CheckForUpdate(const string& app_version,
const string& omaha_url,
UpdateAttemptFlags flags) {
- dlc_ids_.clear();
+ dlc_module_ids_.clear();
is_install_ = false;
bool interactive = !(flags & UpdateAttemptFlags::kFlagNonInteractive);
@@ -840,8 +840,8 @@
}
if (forced_update_pending_callback_.get()) {
- if (!system_state_->dlcservice()->GetInstalled(&dlc_ids_)) {
- dlc_ids_.clear();
+ if (!system_state_->dlcservice()->GetInstalled(&dlc_module_ids_)) {
+ dlc_module_ids_.clear();
}
// Make sure that a scheduling request is made prior to calling the forced
// update pending callback.
@@ -852,9 +852,9 @@
return true;
}
-bool UpdateAttempter::CheckForInstall(const vector<string>& dlc_ids,
+bool UpdateAttempter::CheckForInstall(const vector<string>& dlc_module_ids,
const string& omaha_url) {
- dlc_ids_ = dlc_ids;
+ dlc_module_ids_ = dlc_module_ids;
is_install_ = true;
forced_omaha_url_.clear();
diff --git a/update_attempter.h b/update_attempter.h
index 2d020fa..07a66b9 100644
--- a/update_attempter.h
+++ b/update_attempter.h
@@ -149,7 +149,7 @@
UpdateAttemptFlags flags);
// This is the version of CheckForUpdate called by AttemptInstall API.
- virtual bool CheckForInstall(const std::vector<std::string>& dlc_ids,
+ virtual bool CheckForInstall(const std::vector<std::string>& dlc_module_ids,
const std::string& omaha_url);
// This is the internal entry point for going through a rollback. This will
@@ -524,8 +524,8 @@
std::string forced_app_version_;
std::string forced_omaha_url_;
- // A list of DLC IDs.
- std::vector<std::string> dlc_ids_;
+ // A list of DLC module IDs.
+ std::vector<std::string> dlc_module_ids_;
// Whether the operation is install (write to the current slot not the
// inactive slot).
bool is_install_;
diff --git a/update_attempter_unittest.cc b/update_attempter_unittest.cc
index 676f13a..a395e1b 100644
--- a/update_attempter_unittest.cc
+++ b/update_attempter_unittest.cc
@@ -1185,8 +1185,8 @@
testing::Return(true)));
attempter_.CheckForUpdate("", "autest", UpdateAttemptFlags::kNone);
- EXPECT_EQ(attempter_.dlc_ids_.size(), 1);
- EXPECT_EQ(attempter_.dlc_ids_[0], dlc_module_id);
+ EXPECT_EQ(attempter_.dlc_module_ids_.size(), 1);
+ EXPECT_EQ(attempter_.dlc_module_ids_[0], dlc_module_id);
}
TEST_F(UpdateAttempterTest, CheckForUpdateAUTest) {
diff --git a/update_engine_client.cc b/update_engine_client.cc
index 9d1e093..f36949b 100644
--- a/update_engine_client.cc
+++ b/update_engine_client.cc
@@ -296,7 +296,7 @@
DEFINE_bool(last_attempt_error, false, "Show the last attempt error.");
DEFINE_bool(eol_status, false, "Show the current end-of-life status.");
DEFINE_bool(install, false, "Requests an install.");
- DEFINE_string(dlc_ids, "", "colon-separated list of DLC IDs.");
+ DEFINE_string(dlc_module_ids, "", "colon-separated list of DLC IDs.");
// Boilerplate init commands.
base::CommandLine::Init(argc_, argv_);
@@ -481,24 +481,26 @@
}
if (FLAGS_install) {
- // Parse DLC IDs.
- vector<string> dlc_ids;
- if (!FLAGS_dlc_ids.empty()) {
- dlc_ids = base::SplitString(
- FLAGS_dlc_ids, ":", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
+ // Parse DLC module IDs.
+ vector<string> dlc_module_ids;
+ if (!FLAGS_dlc_module_ids.empty()) {
+ dlc_module_ids = base::SplitString(FLAGS_dlc_module_ids,
+ ":",
+ base::TRIM_WHITESPACE,
+ base::SPLIT_WANT_ALL);
}
- if (dlc_ids.empty()) {
- LOG(ERROR) << "dlc_ids is empty:" << FLAGS_dlc_ids;
+ if (dlc_module_ids.empty()) {
+ LOG(ERROR) << "dlc_module_ids is empty:" << FLAGS_dlc_module_ids;
return 1;
}
- if (!client_->AttemptInstall(FLAGS_omaha_url, dlc_ids)) {
+ if (!client_->AttemptInstall(FLAGS_omaha_url, dlc_module_ids)) {
LOG(ERROR) << "AttemptInstall failed.";
return 1;
}
return 0;
- } else if (!FLAGS_dlc_ids.empty()) {
- LOG(ERROR) << "dlc_ids is not empty while install is not set:"
- << FLAGS_dlc_ids;
+ } else if (!FLAGS_dlc_module_ids.empty()) {
+ LOG(ERROR) << "dlc_module_ids is not empty while install is not set:"
+ << FLAGS_dlc_module_ids;
return 1;
}