Set 1 rather than 10 incoming threads.
Bug: 268335700
Test: atest MicrodroidTests
Change-Id: Idc0a7ee493dcafb1b506d1c00ebc556027d2792b
diff --git a/javalib/jni/android_system_virtualmachine_VirtualMachine.cpp b/javalib/jni/android_system_virtualmachine_VirtualMachine.cpp
index 9281e73..b3354cc 100644
--- a/javalib/jni/android_system_virtualmachine_VirtualMachine.cpp
+++ b/javalib/jni/android_system_virtualmachine_VirtualMachine.cpp
@@ -58,9 +58,10 @@
RpcSessionHandle session;
// We need a thread pool to be able to support linkToDeath, or callbacks
- // (b/268335700). This if a fairly arbitrary number, although it happens to
- // match the default max outgoing threads.
- ARpcSession_setMaxIncomingThreads(session.get(), 10);
+ // (b/268335700). These threads are currently created eagerly, so we don't
+ // want too many. The number 1 is chosen after some discussion, and to match
+ // the server-side default (mMaxThreads on RpcServer).
+ ARpcSession_setMaxIncomingThreads(session.get(), 1);
auto client = ARpcSession_setupPreconnectedClient(session.get(), requestFunc, &args);
return AIBinder_toJavaBinder(env, client);
}