From 39d887d308c0430a5046d7dfaec87dfaaea1a7aa Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Fri, 31 Jan 2020 14:56:45 -0800 Subject: Remove need for libbinderthreadstate. Instead of having this library, libbinder/libhwbinder can keep track of stack pointers so that when they recurse, we know which one was visited most recently. As with the original implementation of libbinderthreadstate, this is somewhat of a hack. An explanation of why this is and what to do instead is added in CallerUtils.h. Bug: 148692216 Test: libbinderthreadstateutils_test Change-Id: Ief28663728fb8786b06bf9e72238052b9af81d87 Merged-In: Ief28663728fb8786b06bf9e72238052b9af81d87 --- libs/gui/BufferQueueThreadState.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libs/gui/BufferQueueThreadState.cpp') diff --git a/libs/gui/BufferQueueThreadState.cpp b/libs/gui/BufferQueueThreadState.cpp index 3b531ec752..c13030b1ed 100644 --- a/libs/gui/BufferQueueThreadState.cpp +++ b/libs/gui/BufferQueueThreadState.cpp @@ -15,6 +15,7 @@ */ #include +#include #include #include #include @@ -22,14 +23,14 @@ namespace android { uid_t BufferQueueThreadState::getCallingUid() { - if (hardware::IPCThreadState::self()->isServingCall()) { + if (getCurrentServingCall() == BinderCallType::HWBINDER) { return hardware::IPCThreadState::self()->getCallingUid(); } return IPCThreadState::self()->getCallingUid(); } pid_t BufferQueueThreadState::getCallingPid() { - if (hardware::IPCThreadState::self()->isServingCall()) { + if (getCurrentServingCall() == BinderCallType::HWBINDER) { return hardware::IPCThreadState::self()->getCallingPid(); } return IPCThreadState::self()->getCallingPid(); -- cgit v1.2.3-59-g8ed1b