Implement dumpsys for BufferHubBinderService

Relanding CL ag/5073949

Now you can run "adb shell dumpsys bufferhubd" to get information from
the bufferhubd binder service. Information from BufferHubService, which
is the PDX service, will also be dumped. If the PDX service is not
present, a message will indicate that.

Note that currently the binder service has no valuable info to share, so
this command actually only return the PDX service info.

Renaming the variable name in bufferhubd.cpp is for preventing
confusion. As during migrating we will have the binder service and pdx
service at the same time, distinguishing them is necessary while both of
them are called "bufferhubd service".

Adjust some newlines to meet 80-char column limit.

Test: "adb shell dumpsys bufferhubd"
Should out put the same as command
"adb shell pdx_tool --dump /dev/socket/pdx/system/buffer_hub/client"
"atest buffer_hub-test" passed.

Change-Id: Id8c38ae03dc3523fbfc2393ac9dabcff9c932e42
Fixes: 115435506
diff --git a/services/vr/bufferhubd/bufferhubd.cpp b/services/vr/bufferhubd/bufferhubd.cpp
index 0ca7edc..3e10b26 100644
--- a/services/vr/bufferhubd/bufferhubd.cpp
+++ b/services/vr/bufferhubd/bufferhubd.cpp
@@ -10,7 +10,7 @@
 
 int main(int, char**) {
   int ret = -1;
-  std::shared_ptr<android::pdx::Service> service;
+  std::shared_ptr<android::dvr::BufferHubService> pdx_service;
   std::unique_ptr<android::pdx::ServiceDispatcher> dispatcher;
 
   // We need to be able to create endpoints with full perms.
@@ -33,15 +33,16 @@
   else
     ALOGI("New nofile limit is %llu/%llu.", rlim.rlim_cur, rlim.rlim_max);
 
-  CHECK_ERROR(android::dvr::BufferHubBinderService::start() != android::OK,
-              error, "Failed to create bufferhub binder service\n");
-
   dispatcher = android::pdx::ServiceDispatcher::Create();
   CHECK_ERROR(!dispatcher, error, "Failed to create service dispatcher\n");
 
-  service = android::dvr::BufferHubService::Create();
-  CHECK_ERROR(!service, error, "Failed to create bufferhubd service\n");
-  dispatcher->AddService(service);
+  pdx_service = android::dvr::BufferHubService::Create();
+  CHECK_ERROR(!pdx_service, error, "Failed to create bufferhub pdx service\n");
+  dispatcher->AddService(pdx_service);
+
+  ret = android::dvr::BufferHubBinderService::start(pdx_service);
+  CHECK_ERROR(ret != android::NO_ERROR, error,
+              "Failed to create bufferhub binder service\n");
 
   ret = dvrSetSchedulerClass(0, "graphics");
   CHECK_ERROR(ret < 0, error, "Failed to set thread priority");