Add the ability to remove a component from component tree
This functionality will be neaded on Brillo side to remove components
added by vendor daemons when those daemons exit (normally or abnormally).
This will allow those daemons to re-add the same component when they get
restarted.
Change-Id: Ida350cfa38d4f1265d1e86fccca893cdf7f5030c
Reviewed-on: https://weave-review.googlesource.com/2087
Reviewed-by: Vitaly Buka <vitalybuka@google.com>
diff --git a/src/device_manager.cc b/src/device_manager.cc
index 67a2c86..1158df7 100644
--- a/src/device_manager.cc
+++ b/src/device_manager.cc
@@ -106,6 +106,10 @@
return component_manager_->AddComponent("", name, traits, error);
}
+bool DeviceManager::RemoveComponent(const std::string& name, ErrorPtr* error) {
+ return component_manager_->RemoveComponent("", name, error);
+}
+
void DeviceManager::AddComponentTreeChangedCallback(
const base::Closure& callback) {
component_manager_->AddComponentTreeChangedCallback(callback);