summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2018-09-05 17:07:14 -0700
committer Steven Moreland <smoreland@google.com> 2018-09-05 17:09:15 -0700
commit3527c2e81c89f7df096c543e4075f470bcbd32b7 (patch)
treec4a1f89370854e1dc8fb2c8bf44fc20d92a04626
parentd56b315086fe916adef6117e09ee888b0f5a9f0a (diff)
libbinder_ndk: warning for transact on local objs
Since a transaction on these means that you are parceling/unparceling things when you could be calling it in process. Bug: 111445392 Test: runtests.sh Change-Id: I620889ecd565553900b087b638ed29ffd98cedd2
-rw-r--r--libs/binder/ndk/AIBinder.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/binder/ndk/AIBinder.cpp b/libs/binder/ndk/AIBinder.cpp
index 40d3a003e0..80c64c0fc4 100644
--- a/libs/binder/ndk/AIBinder.cpp
+++ b/libs/binder/ndk/AIBinder.cpp
@@ -269,6 +269,10 @@ binder_status_t AIBinder_prepareTransaction(AIBinder* binder, AParcel** in) {
return EX_ILLEGAL_STATE;
}
+ if (!binder->isRemote()) {
+ LOG(WARNING) << "A binder object at " << binder << " is being transacted on, however, this object is in the same process as its proxy. Transacting with this binder is expensive compared to just calling the corresponding functionality in the same process.";
+ }
+
*in = new AParcel(binder);
binder_status_t status = (**in)->writeInterfaceToken(clazz->getInterfaceDescriptor());
if (status != EX_NONE) {