update_engine: Call dlcservice's Install/Update Completion DBus APIs

When an Install/Update completes, update_engine will now let dlcservice
know all the DLCs that were installed/updated + verified.

Update_engine will also track during install/update for DLCs which did
not install/update so dlcservice receives the correct list of DLC IDs.

BUG=chromium:1059126
TEST=FEATURES=test emerge-$B update_engine update_engine-client

Cq-Depend: chromium:2141191
Change-Id: Id57f66c7c6957d34870d27119d9a6482fe902503
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2146104
Tested-by: Jae Hoon Kim <kimjae@chromium.org>
Commit-Queue: Jae Hoon Kim <kimjae@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Andrew Lassalle <andrewlassalle@chromium.org>
Auto-Submit: Jae Hoon Kim <kimjae@chromium.org>
diff --git a/common/dlcservice_interface.h b/common/dlcservice_interface.h
index aa24105..3524d50 100644
--- a/common/dlcservice_interface.h
+++ b/common/dlcservice_interface.h
@@ -34,6 +34,14 @@
   // On failure it returns false.
   virtual bool GetInstalled(std::vector<std::string>* dlc_module_ids) = 0;
 
+  // Returns true if dlcservice successfully handled the install completion
+  // method call, otherwise false.
+  virtual bool InstallCompleted(const std::vector<std::string>& ids) = 0;
+
+  // Returns true if dlcservice successfully handled the update completion
+  // method call, otherwise false.
+  virtual bool UpdateCompleted(const std::vector<std::string>& ids) = 0;
+
  protected:
   DlcServiceInterface() = default;
 
diff --git a/common/dlcservice_stub.cc b/common/dlcservice_stub.cc
index c5f9306..3dcb2e0 100644
--- a/common/dlcservice_stub.cc
+++ b/common/dlcservice_stub.cc
@@ -33,4 +33,11 @@
   return true;
 }
 
+bool DlcServiceStub::InstallCompleted(const vector<string>& ids) {
+  return true;
+}
+bool DlcServiceStub::UpdateCompleted(const vector<string>& ids) {
+  return true;
+}
+
 }  // namespace chromeos_update_engine
diff --git a/common/dlcservice_stub.h b/common/dlcservice_stub.h
index 4e12c11..9b27971 100644
--- a/common/dlcservice_stub.h
+++ b/common/dlcservice_stub.h
@@ -32,6 +32,8 @@
 
   // BootControlInterface overrides.
   bool GetInstalled(std::vector<std::string>* dlc_module_ids) override;
+  bool InstallCompleted(const std::vector<std::string>& ids) override;
+  bool UpdateCompleted(const std::vector<std::string>& ids) override;
 
  private:
   DISALLOW_COPY_AND_ASSIGN(DlcServiceStub);