Compile libupdate_engine without DBus.
Test: mma with and without BRILLO_USE_DBUS=1
Test: adb shell /data/nativetest/update_engine_unittests/update_engine_unittests
Bug: 28800946
Change-Id: If3b05e7bc7a123d3d9b0dcc4597d915249a2de33
diff --git a/real_system_state.cc b/real_system_state.cc
index 70bef8c..5fc0b71 100644
--- a/real_system_state.cc
+++ b/real_system_state.cc
@@ -129,9 +129,15 @@
new CertificateChecker(prefs_.get(), &openssl_wrapper_));
certificate_checker_->Init();
+#if USE_LIBCROS
+ LibCrosProxy* libcros_proxy = &libcros_proxy_;
+#else
+ LibCrosProxy* libcros_proxy = nullptr;
+#endif // USE_LIBCROS
+
// Initialize the UpdateAttempter before the UpdateManager.
update_attempter_.reset(
- new UpdateAttempter(this, certificate_checker_.get(), &libcros_proxy_));
+ new UpdateAttempter(this, certificate_checker_.get(), libcros_proxy));
update_attempter_->Init();
weave_service_ = ConstructWeaveService(update_attempter_.get());
@@ -141,7 +147,7 @@
// Initialize the Update Manager using the default state factory.
chromeos_update_manager::State* um_state =
chromeos_update_manager::DefaultStateFactory(
- &policy_provider_, &libcros_proxy_, this);
+ &policy_provider_, libcros_proxy, this);
if (!um_state) {
LOG(ERROR) << "Failed to initialize the Update Manager.";
return false;