update_engine: Use GetDlcsToUpdate() instead of GetInstalled()

The meaning of GetInstalled() DBus in dlcservice have changed. So we need
to get the list of DLCs that ought to be updated from the new DBus
GetDlcsToUpdate().

Also rename all dlc_module_ids to dlc_ids.

BUG=chromium:1071654
TEST=cros_workon_make --board reef --test update_engine

Cq-Depend: chromium:2157669
Change-Id: I02e450a1fd75f8b387eb8a107c9c8a32f3e01e6e
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2163441
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Andrew Lassalle <andrewlassalle@chromium.org>
Reviewed-by: Jae Hoon Kim <kimjae@chromium.org>
Commit-Queue: Amin Hassani <ahassani@chromium.org>
diff --git a/update_attempter.cc b/update_attempter.cc
index c45fe4f..ae7f71e 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -717,10 +717,10 @@
 }
 
 void UpdateAttempter::CalculateDlcParams() {
-  // Set the |dlc_module_ids_| only for an update. This is required to get the
+  // Set the |dlc_ids_| only for an update. This is required to get the
   // currently installed DLC(s).
   if (!is_install_ &&
-      !system_state_->dlcservice()->GetInstalled(&dlc_module_ids_)) {
+      !system_state_->dlcservice()->GetDlcsToUpdate(&dlc_ids_)) {
     LOG(INFO) << "Failed to retrieve DLC module IDs from dlcservice. Check the "
                  "state of dlcservice, will not update DLC modules.";
   }
@@ -730,8 +730,7 @@
   base::FileEnumerator dir_enum(metadata_root_path,
                                 false /* recursive */,
                                 base::FileEnumerator::DIRECTORIES);
-  std::unordered_set<string> dlc_ids(dlc_module_ids_.begin(),
-                                     dlc_module_ids_.end());
+  std::unordered_set<string> dlc_ids(dlc_ids_.begin(), dlc_ids_.end());
   for (base::FilePath name = dir_enum.Next(); !name.empty();
        name = dir_enum.Next()) {
     string id = name.BaseName().value();
@@ -742,7 +741,7 @@
     }
   }
   std::map<std::string, OmahaRequestParams::AppParams> dlc_apps_params;
-  for (const auto& dlc_id : dlc_module_ids_) {
+  for (const auto& dlc_id : dlc_ids_) {
     OmahaRequestParams::AppParams dlc_params{
         .active_counting_type = OmahaRequestParams::kDateBased,
         .name = dlc_id,
@@ -1012,7 +1011,7 @@
   return true;
 }
 
-bool UpdateAttempter::CheckForInstall(const vector<string>& dlc_module_ids,
+bool UpdateAttempter::CheckForInstall(const vector<string>& dlc_ids,
                                       const string& omaha_url) {
   if (status_ != UpdateStatus::IDLE) {
     LOG(INFO) << "Refusing to do an install as there is an "
@@ -1021,7 +1020,7 @@
     return false;
   }
 
-  dlc_module_ids_ = dlc_module_ids;
+  dlc_ids_ = dlc_ids;
   is_install_ = true;
   forced_omaha_url_.clear();