From b6d0e76682d251af5004713d049d333a6790d7cd Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Fri, 15 Nov 2019 00:51:42 -0800 Subject: libbinder: log fatal when used in APEX Since all users are cleaned up (believed at runtime) but not at build time yet. Bug: 139016109 Test: TH Change-Id: If0f1981c7acd50e23e025180fbf09badccae95d4 --- libs/binder/ProcessState.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libs/binder/ProcessState.cpp') diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp index ea61dc5aff..ce2cd9969f 100644 --- a/libs/binder/ProcessState.cpp +++ b/libs/binder/ProcessState.cpp @@ -385,6 +385,12 @@ ProcessState::ProcessState(const char *driver) , mThreadPoolSeq(1) , mCallRestriction(CallRestriction::NONE) { + +// TODO(b/139016109): enforce in build system +#if defined(__ANDROID_APEX__) && !defined(__ANDROID_APEX_COM_ANDROID_VNDK_CURRENT__) + LOG_ALWAYS_FATAL("Cannot use libbinder in APEX (only system.img libbinder) since it is not stable."); +#endif + if (mDriverFD >= 0) { // mmap the binder, providing a chunk of virtual address space to receive transactions. mVMStart = mmap(nullptr, BINDER_VM_SIZE, PROT_READ, MAP_PRIVATE | MAP_NORESERVE, mDriverFD, 0); -- cgit v1.2.3-59-g8ed1b