File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -292,26 +292,19 @@ static void JHwParcel_native_enforceInterface(
292292 return ;
293293 }
294294
295- const jchar *interfaceName = env->GetStringCritical (interfaceNameObj, NULL );
295+ const char *interfaceName = env->GetStringUTFChars (interfaceNameObj, NULL );
296296 if (interfaceName) {
297- String8 interfaceNameCopy = String8 (String16 (
298- reinterpret_cast <const char16_t *>(interfaceName),
299- env->GetStringLength (interfaceNameObj)));
300-
301- env->ReleaseStringCritical (interfaceNameObj, interfaceName);
302- interfaceName = NULL ;
303-
304297 hardware::Parcel *parcel =
305298 JHwParcel::GetNativeContext (env, thiz)->getParcel ();
306-
307- bool valid = parcel->enforceInterface (interfaceNameCopy.string ());
299+ bool valid = parcel->enforceInterface (interfaceName);
308300
309301 if (!valid) {
310302 jniThrowException (
311303 env,
312304 " java/lang/SecurityException" ,
313305 " HWBinder invocation to an incorrect interface" );
314306 }
307+ env->ReleaseStringUTFChars (interfaceNameObj, interfaceName);
315308 }
316309}
317310
You can’t perform that action at this time.
0 commit comments