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

Commit fb368f76 authored by Martijn Coenen's avatar Martijn Coenen
Browse files

Fix BINDER_LIB_TEST_NOP_CALL_BACK.

To write in the request Parcel instead of the reply Parcel.

Also fixed reading the callback return value to use
readInt32(&...), so we correctly set the status if
there was no data in the Parcel.

Test: binderLibTest passes
Change-Id: I1c5b075b6f1f6d19c40e7bf9589a94809ce414ff
parent 45b07b49
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -331,10 +331,14 @@ class BinderLibTestCallBack : public BBinder, public BinderLibTestEvent
            (void)reply;
            (void)flags;
            switch(code) {
            case BINDER_LIB_TEST_CALL_BACK:
                m_result = data.readInt32();
            case BINDER_LIB_TEST_CALL_BACK: {
                status_t status = data.readInt32(&m_result);
                if (status != NO_ERROR) {
                    m_result = status;
                }
                triggerEvent();
                return NO_ERROR;
            }
            case BINDER_LIB_TEST_CALL_BACK_VERIFY_BUF: {
                sp<IBinder> server;
                int ret;
@@ -1044,7 +1048,7 @@ class BinderLibTestService : public BBinder
                if (binder == NULL) {
                    return BAD_VALUE;
                }
                reply2.writeInt32(NO_ERROR);
                data2.writeInt32(NO_ERROR);
                binder->transact(BINDER_LIB_TEST_CALL_BACK, data2, &reply2);
                return NO_ERROR;
            }