Allow ProcessState to use another binder dev node.
Since we have different binder domains at different
/dev nodes now, processes using libbinder must be able
to select which /dev node they want to use. This is
achieved with a new ProcessState::initWithDriver() API,
which takes the /dev node to talk to as an argument.
Bug: 36052864
Test: system boots without issues
Change-Id: I5b3b13decf254ca0957665c91abac4b287e448c4
diff --git a/include/binder/ProcessState.h b/include/binder/ProcessState.h
index 64cf72e..05e9d09 100644
--- a/include/binder/ProcessState.h
+++ b/include/binder/ProcessState.h
@@ -35,6 +35,11 @@
{
public:
static sp<ProcessState> self();
+ /* initWithDriver() can be used to configure libbinder to use
+ * a different binder driver dev node. It must be called *before*
+ * any call to ProcessState::self(). /dev/binder remains the default.
+ */
+ static sp<ProcessState> initWithDriver(const char *driver);
void setContextObject(const sp<IBinder>& object);
sp<IBinder> getContextObject(const sp<IBinder>& caller);
@@ -67,7 +72,7 @@
private:
friend class IPCThreadState;
- ProcessState();
+ ProcessState(const char* driver);
~ProcessState();
ProcessState(const ProcessState& o);