summaryrefslogtreecommitdiff
path: root/libs/gui/BufferQueueThreadState.cpp
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2020-01-31 14:56:45 -0800
committerSteven Moreland <smoreland@google.com>2020-02-05 09:40:19 -0800
commit2b3f3cd22249270bddd1834dba5605491726d2a4 (patch)
tree796dc7e5eaa0f2c061d70a1896f192d6a6b1ece0 /libs/gui/BufferQueueThreadState.cpp
parent9ce0322c142533a48093f859ccbdfa1ec848e496 (diff)
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
Diffstat (limited to 'libs/gui/BufferQueueThreadState.cpp')
-rw-r--r--libs/gui/BufferQueueThreadState.cpp5
1 files changed, 3 insertions, 2 deletions
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 <binder/IPCThreadState.h>
+#include <binderthreadstate/CallerUtils.h>
#include <hwbinder/IPCThreadState.h>
#include <private/gui/BufferQueueThreadState.h>
#include <unistd.h>
@@ -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();