From dc1f24777a3e450b4bb0c02e8def8e58e78e9e46 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Fri, 11 Jan 2019 14:39:45 -0800 Subject: [PATCH] Init: error on oneway calls. Before, this process had no threadpool, so it could make blocking calls, but if it did, they would block forever. Now when this happens, an error is logged so that we can easily see this happen. Bug: 36424585 Test: boot Change-Id: I7d2fa12b6d5a243bdde13ce4d974a444133749f7 --- init/init.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init/init.cpp b/init/init.cpp index dc46a82c5..d360fdd6b 100644 --- a/init/init.cpp +++ b/init/init.cpp @@ -451,6 +451,8 @@ static Result InitBinder(const BuiltinArguments& args) { // Also, binder can't be used by recovery. #ifndef RECOVERY android::ProcessState::self()->setThreadPoolMaxThreadCount(0); + android::ProcessState::self()->setCallRestriction( + ProcessState::CallRestriction::ERROR_IF_NOT_ONEWAY); #endif return Success(); }