Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3527c2e8 authored by Steven Moreland's avatar Steven Moreland
Browse files

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
parent d56b3150
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -269,6 +269,10 @@ binder_status_t AIBinder_prepareTransaction(AIBinder* binder, AParcel** in) {
        return EX_ILLEGAL_STATE;
        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);
    *in = new AParcel(binder);
    binder_status_t status = (**in)->writeInterfaceToken(clazz->getInterfaceDescriptor());
    binder_status_t status = (**in)->writeInterfaceToken(clazz->getInterfaceDescriptor());
    if (status != EX_NONE) {
    if (status != EX_NONE) {