Servicemanager interfaces for libhwbinder.

Main difference between the hardware servicemanager
and the binder servicemanager is that the former supports
versioned interfaces. For now, support registering a single
supported version per interface, on the assumption that
interfaces with a different major version require a different
implementation (and hence a second call to register).

Switch ProcessState to start using /dev/hwbinder.

This also makes IPCThreadState::setTheContextObject() a
valid method for registering yourself as the servicemanager
again. In "plain" binder, this method was not used, because
the servicemanager for binder doesn't link against libbinder
at all.

Note that while any process can calls this method, it's useless
without also being able to tell the kernel driver that you are
the servicemanager. Since that will be SELinux protected, there's
no further need to protect this call.

Change-Id: If9bfb0305d16010788942aaca7ee1279aea88135
diff --git a/IPCThreadState.cpp b/IPCThreadState.cpp
index afdefce..164a4a3 100644
--- a/IPCThreadState.cpp
+++ b/IPCThreadState.cpp
@@ -960,11 +960,9 @@
     return NO_ERROR;
 }
 
-sp<BBinder> the_context_object;
-
-void setTheContextObject(sp<BBinder> obj)
+void IPCThreadState::setTheContextObject(sp<BBinder> obj)
 {
-    the_context_object = obj;
+    mContextObject = obj;
 }
 
 status_t IPCThreadState::executeCommand(int32_t cmd)
@@ -972,7 +970,6 @@
     BBinder* obj;
     RefBase::weakref_type* refs;
     status_t result = NO_ERROR;
-    
     switch ((uint32_t)cmd) {
     case BR_ERROR:
         result = mIn.readInt32();
@@ -1135,8 +1132,7 @@
                 }
 
             } else {
-                error = the_context_object->transact(tr.code, buffer, &reply, tr.flags,
-                        reply_callback);
+                error = mContextObject->transact(tr.code, buffer, &reply, tr.flags, reply_callback);
             }
 
             if ((tr.flags & TF_ONE_WAY) == 0) {