diff options
author | Brad Fitzpatrick <bradfitz@android.com> | 2010-07-27 09:49:11 -0700 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@android.com> | 2010-07-27 12:28:57 -0700 |
commit | 7bcad8a315f12bd6251a998781efac7b11c2ca84 (patch) | |
tree | 44f9ded1cd1a31254607ddddc2c08cad3d4b6546 /core/jni/android_util_Binder.cpp | |
parent | eb75888e6479317151c2ed44d47bd28ef567a4c7 (diff) | |
download | frameworks_base-7bcad8a315f12bd6251a998781efac7b11c2ca84.zip frameworks_base-7bcad8a315f12bd6251a998781efac7b11c2ca84.tar.gz frameworks_base-7bcad8a315f12bd6251a998781efac7b11c2ca84.tar.bz2 |
Replace several IPCThreadState::get() lookups with one.
Also, make StrictMode's ThreadLocal final.
Change-Id: I08d400ed254fa67bb7a3dae1227f205a54c00df0
Diffstat (limited to 'core/jni/android_util_Binder.cpp')
-rw-r--r-- | core/jni/android_util_Binder.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp index 040b324..5c4e4fd 100644 --- a/core/jni/android_util_Binder.cpp +++ b/core/jni/android_util_Binder.cpp @@ -1566,15 +1566,15 @@ static void android_os_Parcel_enforceInterface(JNIEnv* env, jobject clazz, jstri if (parcel != NULL) { const jchar* str = env->GetStringCritical(name, 0); if (str) { - const int32_t old_strict_policy = - IPCThreadState::self()->getStrictModePolicy(); - int32_t strict_policy; - bool isValid = parcel->enforceInterface( + IPCThreadState* threadState = IPCThreadState::self(); + const int32_t oldPolicy = threadState->getStrictModePolicy(); + const bool isValid = parcel->enforceInterface( String16(str, env->GetStringLength(name)), - &strict_policy); + threadState); env->ReleaseStringCritical(name, str); if (isValid) { - if (old_strict_policy != strict_policy) { + const int32_t newPolicy = threadState->getStrictModePolicy(); + if (oldPolicy != newPolicy) { // Need to keep the Java-level thread-local strict // mode policy in sync for the libcore // enforcements, which involves an upcall back @@ -1582,7 +1582,7 @@ static void android_os_Parcel_enforceInterface(JNIEnv* env, jobject clazz, jstri // Parcel.enforceInterface signature, as it's // pseudo-public, and used via AIDL // auto-generation...) - set_dalvik_blockguard_policy(env, strict_policy); + set_dalvik_blockguard_policy(env, newPolicy); } return; // everything was correct -> return silently } |