powerd: Add handler for GCD 'base.reboot' command.

When powerd is built for boards that uses Buffet (with 'buffet'
USE flag), we import Buffet's D-Bus object proxies and listen for
new commands arriving. Powerd responds to 'base.reboot' command by
rebooting the device.

Also, made sure Buffet's test daemon does not "process" any commands
that do not belong to it (and removed 'base.reboot' from its handler).

BUG=brillo:806
TEST=built image, deployed on device and observed how sending base.reboot
     restarts the device.
CQ-DEPEND=CL:265570,CL:265533,CL:265571

Change-Id: I70008dc98d41125bb2a0654c5e3bfe03d5915171
Reviewed-on: https://chromium-review.googlesource.com/265558
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
diff --git a/buffet/etc/buffet/commands/test.json b/buffet/etc/buffet/commands/test.json
index f6201c7..4d11f82 100644
--- a/buffet/etc/buffet/commands/test.json
+++ b/buffet/etc/buffet/commands/test.json
@@ -1,11 +1,5 @@
 {
   "base": {
-    "reboot": {
-      "parameters": {
-      },
-      "results": {
-      }
-    },
     "_jump": {
       "parameters": {
         "_height":"integer"
diff --git a/buffet/test_daemon/main.cc b/buffet/test_daemon/main.cc
index 65372fb..c87eff8 100644
--- a/buffet/test_daemon/main.cc
+++ b/buffet/test_daemon/main.cc
@@ -19,6 +19,10 @@
 
 #include "buffet/dbus-proxies.h"
 
+namespace {
+const char kTestCommandCategory[] = "test";
+}  // anonymous namespace
+
 class Daemon : public chromeos::DBusDaemon {
  public:
   Daemon() = default;
@@ -68,6 +72,10 @@
 }
 
 void Daemon::OnBuffetCommand(org::chromium::Buffet::CommandProxy* command) {
+  // "Handle" only commands that belong to this daemon's category.
+  if (command->category() != kTestCommandCategory)
+    return;
+
   command->SetPropertyChangedCallback(base::Bind(&Daemon::OnPropertyChange,
                                                  base::Unretained(this)));
   printf("++++++++++++++++++++++++++++++++++++++++++++++++\n");