update_engine: support DLC update
All DLC update related code is hide behind USE_dlc flag so platform
update never touches this new code path unless enabled later.
In CheckForUpdate, update_engine calls dlcservice to get a list of DLC
module and set 'dlc_ids_' accordingly.
BUG=chromium:900653
TEST=unittest
Change-Id: I654e37effa7c1b70b25147a027f2b16abe6bf9e1
Reviewed-on: https://chromium-review.googlesource.com/1321009
Commit-Ready: Xiaochu Liu <xiaochu@chromium.org>
Tested-by: Xiaochu Liu <xiaochu@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
diff --git a/update_attempter.cc b/update_attempter.cc
index 581b901..f1ec174 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -44,6 +44,7 @@
#include "update_engine/common/boot_control_interface.h"
#include "update_engine/common/clock_interface.h"
#include "update_engine/common/constants.h"
+#include "update_engine/common/dlcservice_interface.h"
#include "update_engine/common/hardware_interface.h"
#include "update_engine/common/platform_constants.h"
#include "update_engine/common/prefs_interface.h"
@@ -840,6 +841,9 @@
}
if (forced_update_pending_callback_.get()) {
+ if (!system_state_->dlcservice()->GetInstalled(&dlc_ids_)) {
+ dlc_ids_.clear();
+ }
// Make sure that a scheduling request is made prior to calling the forced
// update pending callback.
ScheduleUpdates();