Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bcd771bd authored by Daniel Colascione's avatar Daniel Colascione
Browse files

Avoid allocation on Java Binder fast path

We recently added a new API to the native Parcel class that avoids a
string allocation in enforceInterface.  Have the Java JNI glue for
Parcel use this new interface.

Test: builds
Change-Id: I50b29ef95e214812c5fa83514497e0a188a635aa
parent 59d40857
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -625,8 +625,8 @@ static void android_os_Parcel_enforceInterface(JNIEnv* env, jclass clazz, jlong
            IPCThreadState* threadState = IPCThreadState::self();
            IPCThreadState* threadState = IPCThreadState::self();
            const int32_t oldPolicy = threadState->getStrictModePolicy();
            const int32_t oldPolicy = threadState->getStrictModePolicy();
            const bool isValid = parcel->enforceInterface(
            const bool isValid = parcel->enforceInterface(
                String16(reinterpret_cast<const char16_t*>(str),
                reinterpret_cast<const char16_t*>(str),
                         env->GetStringLength(name)),
                env->GetStringLength(name),
                threadState);
                threadState);
            env->ReleaseStringCritical(name, str);
            env->ReleaseStringCritical(name, str);
            if (isValid) {
            if (isValid) {