Change default hwbinder threadpool behavior.

In order to allow single-threaded server operation,
we want to allow the creation of processes with just
a single thread handling incoming binder transactions.

This is somewhat tricky, because registering an interface
by itself will start a threadpool (in auto-generated code).
The only way to really prevent this is to allow clients/servers
to configure their desired threadpool configuration in advance.

To that end, ProcessState::setThreadPoolConfiguration() tells
libhwbinder how many RPC threads the caller wants in its process,
and whether the caller wants to join the threadpool itself. If it
does, it must follow up with a call to IPCThreadState::joinThreadPool()
later.

The main change in behavior is that by default, we now only spawn
a single hwbinder thread, and don't allow the kernel to create any
additional threads beyond that.

Bug: 31226656
Test: mma, hidl_test
Change-Id: Id5caa2702e6b2d7fb266801ee0aad2523107e8dd
4 files changed