summaryrefslogtreecommitdiff
path: root/libs/binder/RpcState.cpp
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2021-09-30 15:21:54 -0700
committer Steven Moreland <smoreland@google.com> 2021-09-30 15:24:18 -0700
commit6709cf43d19717f76b2cfbfad7dd2a64df357c08 (patch)
treecc4a0b0fac53b7be438c3655181193f2a9cb5833 /libs/binder/RpcState.cpp
parenta7e51752c22427dc918281ea739f391aab35bf9f (diff)
libbinder: RPC simplify flush commands
This logic was a bit wonky, and devinmoore@ suggested an improvement, but I delayed fixing it given that it was in a large stack of CLs. Bug: N/A Test: binderRpcTest Change-Id: Ie1a797a88cba5f811c6137c4ce95aee87bd2a3ff
Diffstat (limited to 'libs/binder/RpcState.cpp')
-rw-r--r--libs/binder/RpcState.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/libs/binder/RpcState.cpp b/libs/binder/RpcState.cpp
index 3ff13bcd9b..6c305c26ca 100644
--- a/libs/binder/RpcState.cpp
+++ b/libs/binder/RpcState.cpp
@@ -862,12 +862,6 @@ processTransactInternalTailCall:
}
}
- // Binder refs are flushed for oneway calls only after all calls which are
- // built up are executed. Otherwise, they fill up the binder buffer.
- if (addr != 0 && replyStatus == OK && !oneway) {
- replyStatus = flushExcessBinderRefs(session, addr, target);
- }
-
if (oneway) {
if (replyStatus != OK) {
ALOGW("Oneway call failed with error: %d", replyStatus);
@@ -926,6 +920,12 @@ processTransactInternalTailCall:
return OK;
}
+ // Binder refs are flushed for oneway calls only after all calls which are
+ // built up are executed. Otherwise, they fill up the binder buffer.
+ if (addr != 0 && replyStatus == OK) {
+ replyStatus = flushExcessBinderRefs(session, addr, target);
+ }
+
LOG_ALWAYS_FATAL_IF(std::numeric_limits<int32_t>::max() - sizeof(RpcWireHeader) -
sizeof(RpcWireReply) <
reply.dataSize(),