mediaserver: add more hwbinder threads

Since we're now using HIDL IGraphicBufferSource in CCodec, the
existence of a callstack with mixed binder and hwbinder calls can cause
a stall when all threads are in use. (b/35283480) The recommended
workaround was to increase the number of threads. This CL does that.

Test: atest CtsMediaTestCases
Test: atest CtsCameraTestCases

Bug: 153828976
Change-Id: I37f02b6237ad032e311a8219b209713d2e4463a6
diff --git a/media/mediaserver/main_mediaserver.cpp b/media/mediaserver/main_mediaserver.cpp
index 7b22b05..316732b 100644
--- a/media/mediaserver/main_mediaserver.cpp
+++ b/media/mediaserver/main_mediaserver.cpp
@@ -22,6 +22,7 @@
 #include <binder/IPCThreadState.h>
 #include <binder/ProcessState.h>
 #include <binder/IServiceManager.h>
+#include <hidl/HidlTransportSupport.h>
 #include <utils/Log.h>
 #include "RegisterExtensions.h"
 
@@ -42,6 +43,8 @@
     MediaPlayerService::instantiate();
     ResourceManagerService::instantiate();
     registerExtensions();
+    ::android::hardware::configureRpcThreadpool(16, false);
     ProcessState::self()->startThreadPool();
     IPCThreadState::self()->joinThreadPool();
+    ::android::hardware::joinRpcThreadpool();
 }