From 7bcad8a315f12bd6251a998781efac7b11c2ca84 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Tue, 27 Jul 2010 09:49:11 -0700 Subject: Replace several IPCThreadState::get() lookups with one. Also, make StrictMode's ThreadLocal final. Change-Id: I08d400ed254fa67bb7a3dae1227f205a54c00df0 --- libs/binder/Parcel.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libs') diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index 60babad..18f75df 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -458,13 +458,13 @@ bool Parcel::checkInterface(IBinder* binder) const } bool Parcel::enforceInterface(const String16& interface, - int32_t* strict_policy_out) const + IPCThreadState* threadState) const { - int32_t strict_policy = readInt32(); - IPCThreadState::self()->setStrictModePolicy(strict_policy); - if (strict_policy_out != NULL) { - *strict_policy_out = strict_policy; + int32_t strictPolicy = readInt32(); + if (threadState == NULL) { + threadState = IPCThreadState::self(); } + threadState->setStrictModePolicy(strictPolicy); const String16 str(readString16()); if (str == interface) { return true; -- cgit v1.1