From 4ee27039e0ee4d7c1b5314642d51f01096bfa79e Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Mon, 24 Jun 2019 12:55:25 -0700 Subject: [PATCH] Remove binder dependency in init. - unused - using binder requires twoway calls (since getting a service from servicemanager requires two calls) Bug: 135768100 Test: N/A Change-Id: Idc41f487bad2d8343e99ded98812f3a84e2b8e37 --- init/Android.bp | 1 - init/init.cpp | 25 ------------------------- 2 files changed, 26 deletions(-) diff --git a/init/Android.bp b/init/Android.bp index 9c1ed1522..b51314d49 100644 --- a/init/Android.bp +++ b/init/Android.bp @@ -71,7 +71,6 @@ cc_defaults { shared_libs: [ "libbacktrace", "libbase", - "libbinder", "libbootloader_message", "libcutils", "libcrypto", diff --git a/init/init.cpp b/init/init.cpp index 1412e4a5e..26de6ed04 100644 --- a/init/init.cpp +++ b/init/init.cpp @@ -48,10 +48,6 @@ #include #include -#ifndef RECOVERY -#include -#endif - #include "action_parser.h" #include "boringssl_self_test.h" #include "epoll.h" @@ -463,24 +459,6 @@ static Result queue_property_triggers_action(const BuiltinArguments& args) return {}; } -static Result InitBinder(const BuiltinArguments& args) { - // init's use of binder is very limited. init cannot: - // - have any binder threads - // - receive incoming binder calls - // - pass local binder services to remote processes - // - use death recipients - // The main supported usecases are: - // - notifying other daemons (oneway calls only) - // - retrieving data that is necessary to boot - // 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 {}; -} - // Set the UDC controller for the ConfigFS USB Gadgets. // Read the UDC controller in use from "/sys/class/udc". // In case of multiple UDC controllers select the first one. @@ -777,9 +755,6 @@ int SecondStageMain(int argc, char** argv) { // wasn't ready immediately after wait_for_coldboot_done am.QueueBuiltinAction(MixHwrngIntoLinuxRngAction, "MixHwrngIntoLinuxRng"); - // Initialize binder before bringing up other system services - am.QueueBuiltinAction(InitBinder, "InitBinder"); - // Don't mount filesystems or start core system services in charger mode. std::string bootmode = GetProperty("ro.bootmode", ""); if (bootmode == "charger") {