summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Android.bp4
-rw-r--r--IPCThreadState.cpp11
-rw-r--r--include/hwbinder/IPCThreadState.h30
3 files changed, 1 insertions, 44 deletions
diff --git a/Android.bp b/Android.bp
index f372618..fee5417 100644
--- a/Android.bp
+++ b/Android.bp
@@ -23,7 +23,6 @@ cc_defaults {
"liblog",
"libcutils",
"libutils",
- "libbinderthreadstate",
],
export_shared_lib_headers: [
"libbase",
@@ -72,7 +71,7 @@ cc_library {
defaults: [
"libhwbinder_defaults",
"hwbinder_pgo",
- "hwbinder_lto",
+ "hwbinder_lto"
],
}
@@ -96,7 +95,6 @@ cc_defaults {
enable_profile_use: true,
},
}
-
// Provide lto property to build hwbinder with LTO
cc_defaults {
name: "hwbinder_lto",
diff --git a/IPCThreadState.cpp b/IPCThreadState.cpp
index d97ad12..b275a7e 100644
--- a/IPCThreadState.cpp
+++ b/IPCThreadState.cpp
@@ -17,7 +17,6 @@
#define LOG_TAG "hw-IPCThreadState"
#include <hwbinder/IPCThreadState.h>
-#include <binderthreadstate/IPCThreadStateBase.h>
#include <hwbinder/Binder.h>
#include <hwbinder/BpHwBinder.h>
@@ -765,7 +764,6 @@ IPCThreadState::IPCThreadState()
// TODO(b/67742352): remove this variable from the class
(void)mMyThreadId;
- mIPCThreadStateBase = IPCThreadStateBase::self();
}
IPCThreadState::~IPCThreadState()
@@ -1116,9 +1114,6 @@ status_t IPCThreadState::executeCommand(int32_t cmd)
"Not enough command data for brTRANSACTION");
if (result != NO_ERROR) break;
- // Record the fact that we're in a hwbinder call
- mIPCThreadStateBase->pushCurrentState(
- IPCThreadStateBase::CallState::HWBINDER);
Parcel buffer;
buffer.ipcSetDataReference(
reinterpret_cast<const uint8_t*>(tr.data.ptr.buffer),
@@ -1182,7 +1177,6 @@ status_t IPCThreadState::executeCommand(int32_t cmd)
error = mContextObject->transact(tr.code, buffer, &reply, tr.flags, reply_callback);
}
- mIPCThreadStateBase->popCurrentState();
if ((tr.flags & TF_ONE_WAY) == 0) {
if (!reply_sent) {
// Should have been a reply but there wasn't, so there
@@ -1255,11 +1249,6 @@ status_t IPCThreadState::executeCommand(int32_t cmd)
return result;
}
-bool IPCThreadState::isServingCall() const
-{
- return mIPCThreadStateBase->getCurrentBinderCallState() == IPCThreadStateBase::CallState::HWBINDER;
-}
-
void IPCThreadState::threadDestructor(void *st)
{
IPCThreadState* const self = static_cast<IPCThreadState*>(st);
diff --git a/include/hwbinder/IPCThreadState.h b/include/hwbinder/IPCThreadState.h
index f2112c0..28ae470 100644
--- a/include/hwbinder/IPCThreadState.h
+++ b/include/hwbinder/IPCThreadState.h
@@ -30,9 +30,6 @@ typedef int uid_t;
// ---------------------------------------------------------------------------
namespace android {
-
-class IPCThreadStateBase;
-
namespace hardware {
class IPCThreadState
@@ -98,32 +95,6 @@ public:
bool isLooperThread();
bool isOnlyBinderThread();
- // Is this thread currently serving a hwbinder call. This method
- // returns true if while traversing backwards from the function call
- // stack for this thread, we encounter a function serving a hwbinder
- // call before encountering a binder call / hitting the end of the
- // call stack.
- // Eg: If thread T1 went through the following call pattern
- // 1) T1 receives and executes binder call B1.
- // 2) While handling B1, T1 makes hwbinder call H1.
- // 3) The handler of H1, calls into T1 with a callback H2.
- // If isServingCall() is called during B1 before 3), this method
- // will return false, else true.
- //
- // ----
- // | H2 | ---> While callback H2 is being handled during 3).
- // ----
- // | B1 | ---> While B1 is being handled, hwbinder call H1 made.
- // ----
- // Fig: Thread Call stack while handling H2.
- //
- // This is since after 3), while traversing the thread call stack,
- // we hit a hwbinder call before a binder call / end of stack.
- // This method may be typically used to determine whether to use
- // hardware::IPCThreadState methods or IPCThreadState methods to
- // infer information about thread state.
- bool isServingCall() const;
-
// Tasks which are done on the binder thread after the thread returns to the
// threadpool.
void addPostCommandTask(const std::function<void(void)>& task);
@@ -173,7 +144,6 @@ public:
bool mIsPollingThread;
std::vector<std::function<void(void)>> mPostCommandTasks;
- IPCThreadStateBase *mIPCThreadStateBase;
};
}; // namespace hardware