summaryrefslogtreecommitdiffstats
path: root/core/jni
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2014-09-30 11:28:18 -0700
committerDianne Hackborn <hackbod@google.com>2014-09-30 11:28:18 -0700
commitce92b0d070c4967914698b4e257c203d7121c972 (patch)
tree623258629ecfaa48b79a8e21379cd61f70592768 /core/jni
parent38646c19d8badea143113c0dc48ccdacb18badc4 (diff)
downloadframeworks_base-ce92b0d070c4967914698b4e257c203d7121c972.zip
frameworks_base-ce92b0d070c4967914698b4e257c203d7121c972.tar.gz
frameworks_base-ce92b0d070c4967914698b4e257c203d7121c972.tar.bz2
More work on issue #17656716: Unhandled exception in Window Manager
Drop down the limit on when we log, since under normal operation we will never get more than a few K of data due to strict mode. Try to clean up the code paths coming in and out of binder IPCs to plug any places where we could disrupt the gather flag of a thread, causing it to keep gathering stack crawls (which is the thing that is causing our strict mode data to become so large). Change-Id: I9a46512283d33e863c429840b465855d1fabb74e
Diffstat (limited to 'core/jni')
-rw-r--r--core/jni/android_util_Binder.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp
index 2dbd382..e400698 100644
--- a/core/jni/android_util_Binder.cpp
+++ b/core/jni/android_util_Binder.cpp
@@ -264,8 +264,7 @@ protected:
ALOGV("onTransact() on %p calling object %p in env %p vm %p\n", this, mObject, env, mVM);
IPCThreadState* thread_state = IPCThreadState::self();
- const int strict_policy_before = thread_state->getStrictModePolicy();
- thread_state->setLastTransactionBinderFlags(flags);
+ const int32_t strict_policy_before = thread_state->getStrictModePolicy();
//printf("Transact from %p to Java code sending: ", this);
//data.print();
@@ -284,15 +283,11 @@ protected:
env->DeleteLocalRef(excep);
}
- // Restore the Java binder thread's state if it changed while
- // processing a call (as it would if the Parcel's header had a
- // new policy mask and Parcel.enforceInterface() changed
- // it...)
- const int strict_policy_after = thread_state->getStrictModePolicy();
- if (strict_policy_after != strict_policy_before) {
- // Our thread-local...
- thread_state->setStrictModePolicy(strict_policy_before);
- // And the Java-level thread-local...
+ // Check if the strict mode state changed while processing the
+ // call. The Binder state will be restored by the underlying
+ // Binder system in IPCThreadState, however we need to take care
+ // of the parallel Java state as well.
+ if (thread_state->getStrictModePolicy() != strict_policy_before) {
set_dalvik_blockguard_policy(env, strict_policy_before);
}