Add service "gpu" in the SurfaceFlinger process

This service will handle shell commands for querying information about
the graphics hardware and driver. It currently does nothing.

Most shell command services are provided by ActivityManagerService. I
didn't want to put this there, because I'd rather not load graphics
drivers in the system_service process (robustness, security, etc.).
SurfaceFlinger is going to have them anyway, and is the only other
global always-running process that makes sense for this.

Change-Id: I27e451ea62b71aed01c6ececefd76d6707912eed
diff --git a/services/surfaceflinger/main_surfaceflinger.cpp b/services/surfaceflinger/main_surfaceflinger.cpp
index 4cd7aeb..97a1e8b 100644
--- a/services/surfaceflinger/main_surfaceflinger.cpp
+++ b/services/surfaceflinger/main_surfaceflinger.cpp
@@ -21,6 +21,7 @@
 #include <binder/IPCThreadState.h>
 #include <binder/ProcessState.h>
 #include <binder/IServiceManager.h>
+#include "GpuService.h"
 #include "SurfaceFlinger.h"
 
 using namespace android;
@@ -56,7 +57,11 @@
     sp<IServiceManager> sm(defaultServiceManager());
     sm->addService(String16(SurfaceFlinger::getServiceName()), flinger, false);
 
-    // run in this thread
+    // publish GpuService
+    sp<GpuService> gpuservice = new GpuService();
+    sm->addService(String16(GpuService::SERVICE_NAME), gpuservice, false);
+
+    // run surface flinger in this thread
     flinger->run();
 
     return 0;