diff options
author | Dianne Hackborn <hackbod@google.com> | 2014-09-30 20:23:02 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-30 20:23:02 +0000 |
commit | e4499526eee52a6584aba9382783e9fba327a9bc (patch) | |
tree | 4a907362a423cf688d559c2005ada5e486a05e3a /libs/binder/IPCThreadState.cpp | |
parent | 112a7457aedc694de9ba06359e738893e28c640a (diff) | |
parent | 5ee2c9d20c0fbecf6b4a482eb8d8bfdf85d0d424 (diff) | |
download | frameworks_native-e4499526eee52a6584aba9382783e9fba327a9bc.zip frameworks_native-e4499526eee52a6584aba9382783e9fba327a9bc.tar.gz frameworks_native-e4499526eee52a6584aba9382783e9fba327a9bc.tar.bz2 |
am 5ee2c9d2: Work on issue #17656716: Unhandled exception in Window Manager
* commit '5ee2c9d20c0fbecf6b4a482eb8d8bfdf85d0d424':
Work on issue #17656716: Unhandled exception in Window Manager
Diffstat (limited to 'libs/binder/IPCThreadState.cpp')
-rw-r--r-- | libs/binder/IPCThreadState.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp index ae8f648..442b92c 100644 --- a/libs/binder/IPCThreadState.cpp +++ b/libs/binder/IPCThreadState.cpp @@ -1037,10 +1037,13 @@ status_t IPCThreadState::executeCommand(int32_t cmd) 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; + int curPrio = getpriority(PRIO_PROCESS, mMyThreadId); if (gDisableBackgroundScheduling) { if (curPrio > ANDROID_PRIORITY_NORMAL) { @@ -1062,8 +1065,9 @@ status_t IPCThreadState::executeCommand(int32_t cmd) } //ALOGI(">>>> TRANSACT from pid %d uid %d\n", mCallingPid, mCallingUid); - + Parcel reply; + status_t error; IF_LOG_TRANSACTIONS() { TextOutput::Bundle _b(alog); alog << "BR_TRANSACTION thr " << (void*)pthread_self() @@ -1077,19 +1081,18 @@ status_t IPCThreadState::executeCommand(int32_t cmd) } if (tr.target.ptr) { sp<BBinder> b((BBinder*)tr.cookie); - const status_t error = b->transact(tr.code, buffer, &reply, tr.flags); - if (error < NO_ERROR) reply.setError(error); + error = b->transact(tr.code, buffer, &reply, tr.flags); } else { - const status_t error = the_context_object->transact(tr.code, buffer, &reply, tr.flags); - if (error < NO_ERROR) reply.setError(error); + error = the_context_object->transact(tr.code, buffer, &reply, tr.flags); } - + //ALOGI("<<<< TRANSACT from pid %d restore pid %d uid %d\n", // mCallingPid, origPid, origUid); if ((tr.flags & TF_ONE_WAY) == 0) { LOG_ONEWAY("Sending reply to %d!", mCallingPid); + if (error < NO_ERROR) reply.setError(error); sendReply(reply, 0); } else { LOG_ONEWAY("NOT sending reply to %d!", mCallingPid); @@ -1097,6 +1100,8 @@ status_t IPCThreadState::executeCommand(int32_t cmd) mCallingPid = origPid; mCallingUid = origUid; + mStrictModePolicy = origStrictModePolicy; + mLastTransactionBinderFlags = origTransactionBinderFlags; IF_LOG_TRANSACTIONS() { TextOutput::Bundle _b(alog); |