Loading libs/binder/IPCThreadState.cpp +66 −68 Original line number Diff line number Diff line Loading @@ -571,7 +571,7 @@ status_t IPCThreadState::transact(int32_t handle, uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) { status_t err = data.errorCheck(); status_t err; flags |= TF_ACCEPT_FDS; Loading @@ -582,11 +582,9 @@ status_t IPCThreadState::transact(int32_t handle, << indent << data << dedent << endl; } if (err == NO_ERROR) { LOG_ONEWAY(">>>> SEND from pid %d uid %d %s", getpid(), getuid(), (flags & TF_ONE_WAY) == 0 ? "READ REPLY" : "ONE WAY"); err = writeTransactionData(BC_TRANSACTION, flags, handle, code, data, NULL); } if (err != NO_ERROR) { if (reply) reply->setError(err); Loading Loading @@ -720,16 +718,6 @@ IPCThreadState::~IPCThreadState() { } status_t IPCThreadState::sendReply(const Parcel& reply, uint32_t flags) { status_t err; status_t statusBuffer; err = writeTransactionData(BC_REPLY, flags, -1, 0, reply, &statusBuffer); if (err < NO_ERROR) return err; return waitForResponse(NULL, NULL); } status_t IPCThreadState::waitForResponse(Parcel *reply, status_t *acquireResult) { uint32_t cmd; Loading Loading @@ -1052,25 +1040,26 @@ status_t IPCThreadState::executeCommand(int32_t cmd) "Not enough command data for brTRANSACTION"); if (result != NO_ERROR) break; Parcel reply; { Parcel buffer; const pid_t origPid = mCallingPid; const uid_t origUid = mCallingUid; const int32_t origStrictModePolicy = mStrictModePolicy; const int32_t origTransactionBinderFlags = mLastTransactionBinderFlags; buffer.ipcSetDataReference( reinterpret_cast<const uint8_t*>(tr.data.ptr.buffer), tr.data_size, reinterpret_cast<const binder_size_t*>(tr.data.ptr.offsets), tr.offsets_size/sizeof(binder_size_t), freeBuffer, this); const pid_t origPid = mCallingPid; const uid_t origUid = mCallingUid; const int32_t origStrictModePolicy = mStrictModePolicy; const int32_t origTransactionBinderFlags = mLastTransactionBinderFlags; mCallingPid = tr.sender_pid; mCallingUid = tr.sender_euid; mLastTransactionBinderFlags = tr.flags; //ALOGI(">>>> TRANSACT from pid %d uid %d\n", mCallingPid, mCallingUid); Parcel reply; status_t error; IF_LOG_TRANSACTIONS() { TextOutput::Bundle _b(alog); Loading Loading @@ -1105,7 +1094,9 @@ status_t IPCThreadState::executeCommand(int32_t cmd) if ((tr.flags & TF_ONE_WAY) == 0) { LOG_ONEWAY("Sending reply to %d!", mCallingPid); if (error < NO_ERROR) reply.setError(error); sendReply(reply, 0); status_t statusBuffer; result = writeTransactionData(BC_REPLY, 0, -1, 0, reply, &statusBuffer); } else { LOG_ONEWAY("NOT sending reply to %d!", mCallingPid); } Loading @@ -1114,6 +1105,13 @@ status_t IPCThreadState::executeCommand(int32_t cmd) mCallingUid = origUid; mStrictModePolicy = origStrictModePolicy; mLastTransactionBinderFlags = origTransactionBinderFlags; } if (result != NO_ERROR) break; if ((tr.flags & TF_ONE_WAY) == 0) waitForResponse(NULL, NULL); IF_LOG_TRANSACTIONS() { TextOutput::Bundle _b(alog); Loading libs/binder/include/binder/IPCThreadState.h +0 −1 Original line number Diff line number Diff line Loading @@ -93,7 +93,6 @@ private: IPCThreadState(); ~IPCThreadState(); status_t sendReply(const Parcel& reply, uint32_t flags); status_t waitForResponse(Parcel *reply, status_t *acquireResult=NULL); status_t talkWithDriver(bool doReceive=true); Loading Loading
libs/binder/IPCThreadState.cpp +66 −68 Original line number Diff line number Diff line Loading @@ -571,7 +571,7 @@ status_t IPCThreadState::transact(int32_t handle, uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) { status_t err = data.errorCheck(); status_t err; flags |= TF_ACCEPT_FDS; Loading @@ -582,11 +582,9 @@ status_t IPCThreadState::transact(int32_t handle, << indent << data << dedent << endl; } if (err == NO_ERROR) { LOG_ONEWAY(">>>> SEND from pid %d uid %d %s", getpid(), getuid(), (flags & TF_ONE_WAY) == 0 ? "READ REPLY" : "ONE WAY"); err = writeTransactionData(BC_TRANSACTION, flags, handle, code, data, NULL); } if (err != NO_ERROR) { if (reply) reply->setError(err); Loading Loading @@ -720,16 +718,6 @@ IPCThreadState::~IPCThreadState() { } status_t IPCThreadState::sendReply(const Parcel& reply, uint32_t flags) { status_t err; status_t statusBuffer; err = writeTransactionData(BC_REPLY, flags, -1, 0, reply, &statusBuffer); if (err < NO_ERROR) return err; return waitForResponse(NULL, NULL); } status_t IPCThreadState::waitForResponse(Parcel *reply, status_t *acquireResult) { uint32_t cmd; Loading Loading @@ -1052,25 +1040,26 @@ status_t IPCThreadState::executeCommand(int32_t cmd) "Not enough command data for brTRANSACTION"); if (result != NO_ERROR) break; Parcel reply; { Parcel buffer; const pid_t origPid = mCallingPid; const uid_t origUid = mCallingUid; const int32_t origStrictModePolicy = mStrictModePolicy; const int32_t origTransactionBinderFlags = mLastTransactionBinderFlags; buffer.ipcSetDataReference( reinterpret_cast<const uint8_t*>(tr.data.ptr.buffer), tr.data_size, reinterpret_cast<const binder_size_t*>(tr.data.ptr.offsets), tr.offsets_size/sizeof(binder_size_t), freeBuffer, this); const pid_t origPid = mCallingPid; const uid_t origUid = mCallingUid; const int32_t origStrictModePolicy = mStrictModePolicy; const int32_t origTransactionBinderFlags = mLastTransactionBinderFlags; mCallingPid = tr.sender_pid; mCallingUid = tr.sender_euid; mLastTransactionBinderFlags = tr.flags; //ALOGI(">>>> TRANSACT from pid %d uid %d\n", mCallingPid, mCallingUid); Parcel reply; status_t error; IF_LOG_TRANSACTIONS() { TextOutput::Bundle _b(alog); Loading Loading @@ -1105,7 +1094,9 @@ status_t IPCThreadState::executeCommand(int32_t cmd) if ((tr.flags & TF_ONE_WAY) == 0) { LOG_ONEWAY("Sending reply to %d!", mCallingPid); if (error < NO_ERROR) reply.setError(error); sendReply(reply, 0); status_t statusBuffer; result = writeTransactionData(BC_REPLY, 0, -1, 0, reply, &statusBuffer); } else { LOG_ONEWAY("NOT sending reply to %d!", mCallingPid); } Loading @@ -1114,6 +1105,13 @@ status_t IPCThreadState::executeCommand(int32_t cmd) mCallingUid = origUid; mStrictModePolicy = origStrictModePolicy; mLastTransactionBinderFlags = origTransactionBinderFlags; } if (result != NO_ERROR) break; if ((tr.flags & TF_ONE_WAY) == 0) waitForResponse(NULL, NULL); IF_LOG_TRANSACTIONS() { TextOutput::Bundle _b(alog); Loading
libs/binder/include/binder/IPCThreadState.h +0 −1 Original line number Diff line number Diff line Loading @@ -93,7 +93,6 @@ private: IPCThreadState(); ~IPCThreadState(); status_t sendReply(const Parcel& reply, uint32_t flags); status_t waitForResponse(Parcel *reply, status_t *acquireResult=NULL); status_t talkWithDriver(bool doReceive=true); Loading