Loading libs/binder/IPCThreadState.cpp +16 −4 Original line number Diff line number Diff line Loading @@ -1248,10 +1248,22 @@ status_t IPCThreadState::executeCommand(int32_t cmd) constexpr uint32_t kForwardReplyFlags = TF_CLEAR_BUF; sendReply(reply, (tr.flags & kForwardReplyFlags)); } else { if (error != OK || reply.dataSize() != 0) { alog << "oneway function results will be dropped but finished with status " << statusToString(error) << " and parcel size " << reply.dataSize() << endl; if (error != OK) { alog << "oneway function results for code " << tr.code << " on binder at " << reinterpret_cast<void*>(tr.target.ptr) << " will be dropped but finished with status " << statusToString(error); // ideally we could log this even when error == OK, but it // causes too much logspam because some manually-written // interfaces have clients that call methods which always // write results, sometimes as oneway methods. if (reply.dataSize() != 0) { alog << " and reply parcel size " << reply.dataSize(); } alog << endl; } LOG_ONEWAY("NOT sending reply to %d!", mCallingPid); } Loading libs/binder/tests/binderLibTest.cpp +12 −4 Original line number Diff line number Diff line Loading @@ -404,6 +404,13 @@ TEST_F(BinderLibTest, NopTransaction) { EXPECT_EQ(NO_ERROR, ret); } TEST_F(BinderLibTest, NopTransactionOneway) { status_t ret; Parcel data, reply; ret = m_server->transact(BINDER_LIB_TEST_NOP_TRANSACTION, data, &reply, TF_ONE_WAY); EXPECT_EQ(NO_ERROR, ret); } TEST_F(BinderLibTest, NopTransactionClear) { status_t ret; Parcel data, reply; Loading Loading @@ -1182,9 +1189,6 @@ class BinderLibTestService : public BBinder virtual status_t onTransact(uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags = 0) { //printf("%s: code %d\n", __func__, code); (void)flags; if (getuid() != (uid_t)IPCThreadState::self()->getCallingUid()) { return PERMISSION_DENIED; } Loading Loading @@ -1258,8 +1262,12 @@ class BinderLibTestService : public BBinder return NO_ERROR; case BINDER_LIB_TEST_NOP_TRANSACTION_WAIT: usleep(5000); return NO_ERROR; [[fallthrough]]; case BINDER_LIB_TEST_NOP_TRANSACTION: // oneway error codes should be ignored if (flags & TF_ONE_WAY) { return UNKNOWN_ERROR; } return NO_ERROR; case BINDER_LIB_TEST_DELAYED_CALL_BACK: { // Note: this transaction is only designed for use with a Loading Loading
libs/binder/IPCThreadState.cpp +16 −4 Original line number Diff line number Diff line Loading @@ -1248,10 +1248,22 @@ status_t IPCThreadState::executeCommand(int32_t cmd) constexpr uint32_t kForwardReplyFlags = TF_CLEAR_BUF; sendReply(reply, (tr.flags & kForwardReplyFlags)); } else { if (error != OK || reply.dataSize() != 0) { alog << "oneway function results will be dropped but finished with status " << statusToString(error) << " and parcel size " << reply.dataSize() << endl; if (error != OK) { alog << "oneway function results for code " << tr.code << " on binder at " << reinterpret_cast<void*>(tr.target.ptr) << " will be dropped but finished with status " << statusToString(error); // ideally we could log this even when error == OK, but it // causes too much logspam because some manually-written // interfaces have clients that call methods which always // write results, sometimes as oneway methods. if (reply.dataSize() != 0) { alog << " and reply parcel size " << reply.dataSize(); } alog << endl; } LOG_ONEWAY("NOT sending reply to %d!", mCallingPid); } Loading
libs/binder/tests/binderLibTest.cpp +12 −4 Original line number Diff line number Diff line Loading @@ -404,6 +404,13 @@ TEST_F(BinderLibTest, NopTransaction) { EXPECT_EQ(NO_ERROR, ret); } TEST_F(BinderLibTest, NopTransactionOneway) { status_t ret; Parcel data, reply; ret = m_server->transact(BINDER_LIB_TEST_NOP_TRANSACTION, data, &reply, TF_ONE_WAY); EXPECT_EQ(NO_ERROR, ret); } TEST_F(BinderLibTest, NopTransactionClear) { status_t ret; Parcel data, reply; Loading Loading @@ -1182,9 +1189,6 @@ class BinderLibTestService : public BBinder virtual status_t onTransact(uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags = 0) { //printf("%s: code %d\n", __func__, code); (void)flags; if (getuid() != (uid_t)IPCThreadState::self()->getCallingUid()) { return PERMISSION_DENIED; } Loading Loading @@ -1258,8 +1262,12 @@ class BinderLibTestService : public BBinder return NO_ERROR; case BINDER_LIB_TEST_NOP_TRANSACTION_WAIT: usleep(5000); return NO_ERROR; [[fallthrough]]; case BINDER_LIB_TEST_NOP_TRANSACTION: // oneway error codes should be ignored if (flags & TF_ONE_WAY) { return UNKNOWN_ERROR; } return NO_ERROR; case BINDER_LIB_TEST_DELAYED_CALL_BACK: { // Note: this transaction is only designed for use with a Loading