weaved: Remove handler for base.reboot command am: 94e850c87e
am: f636ab4829

* commit 'f636ab482934d783c45e7bfc5225bd375435b05e':
  weaved: Remove handler for base.reboot command

Change-Id: Ic8cc3051dfb245c04af484ef824b499dd672c9a2
diff --git a/buffet/manager.cc b/buffet/manager.cc
index ef18adc..777ea09 100644
--- a/buffet/manager.cc
+++ b/buffet/manager.cc
@@ -60,8 +60,6 @@
 
 const char kErrorDomain[] = "buffet";
 const char kFileReadError[] = "file_read_error";
-const char kBaseComponent[] = "base";
-const char kRebootCommand[] = "base.reboot";
 
 bool LoadFile(const base::FilePath& file_path,
               std::string* data,
@@ -135,7 +133,6 @@
 }
 
 void Manager::Start() {
-  power_manager_client_.Init();
   RestartWeave();
 }
 
@@ -205,10 +202,6 @@
       base::Bind(&Manager::OnPairingStart, weak_ptr_factory_.GetWeakPtr()),
       base::Bind(&Manager::OnPairingEnd, weak_ptr_factory_.GetWeakPtr()));
 
-  device_->AddCommandHandler(kBaseComponent, kRebootCommand,
-                             base::Bind(&Manager::OnRebootDevice,
-                                        weak_ptr_factory_.GetWeakPtr()));
-
   CreateServicesForClients();
 }
 
@@ -288,21 +281,6 @@
   NotifyServiceManagerChange(ids);
 }
 
-void Manager::OnRebootDevice(const std::weak_ptr<weave::Command>& cmd) {
-  auto command = cmd.lock();
-  if (!command || !command->Complete({}, nullptr))
-    return;
-
-  task_runner_->PostDelayedTask(
-      FROM_HERE,
-      base::Bind(&Manager::RebootDeviceNow, weak_ptr_factory_.GetWeakPtr()),
-      base::TimeDelta::FromSeconds(2));
-}
-
-void Manager::RebootDeviceNow() {
-  power_manager_client_.Reboot(android::RebootReason::DEFAULT);
-}
-
 android::binder::Status Manager::connect(
     const android::sp<android::weave::IWeaveClient>& client) {
   pending_clients_.push_back(client);
diff --git a/buffet/manager.h b/buffet/manager.h
index 1bb638e..3805e77 100644
--- a/buffet/manager.h
+++ b/buffet/manager.h
@@ -26,7 +26,6 @@
 #include <base/values.h>
 #include <brillo/dbus/async_event_sequencer.h>
 #include <brillo/errors/error.h>
-#include <nativepower/power_manager_client.h>
 #include <weave/device.h>
 
 #include "android/weave/BnWeaveServiceManager.h"
@@ -104,8 +103,6 @@
   void OnNotificationListenerDestroyed(
       const WeaveServiceManagerNotificationListener& notification_listener);
   void NotifyServiceManagerChange(const std::vector<int>& notification_ids);
-  void OnRebootDevice(const std::weak_ptr<weave::Command>& cmd);
-  void RebootDeviceNow();
 
   Options options_;
   scoped_refptr<dbus::Bus> bus_;
@@ -124,7 +121,6 @@
   std::map<android::sp<android::weave::IWeaveClient>,
            android::sp<BinderWeaveService>> services_;
   std::set<WeaveServiceManagerNotificationListener> notification_listeners_;
-  android::PowerManagerClient power_manager_client_;
 
   // State properties.
   std::string cloud_id_;