diff options
Diffstat (limited to 'runtime/native/dalvik_system_DexFile.cc')
-rw-r--r-- | runtime/native/dalvik_system_DexFile.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/runtime/native/dalvik_system_DexFile.cc b/runtime/native/dalvik_system_DexFile.cc index 21e7f777cb..f2c9efcd7d 100644 --- a/runtime/native/dalvik_system_DexFile.cc +++ b/runtime/native/dalvik_system_DexFile.cc @@ -55,6 +55,7 @@ #include "runtime.h" #include "scoped_thread_state_change-inl.h" #include "string_array_utils.h" +#include "thread-current-inl.h" namespace art { @@ -509,7 +510,7 @@ static jobjectArray DexFile_getClassNameList(JNIEnv* env, jclass, jobject cookie } // Now create output array and copy the set into it. - ScopedObjectAccess soa(down_cast<JNIEnvExt*>(env)->GetSelf()); + ScopedObjectAccess soa(Thread::ForEnv(env)); auto descriptor_to_dot = [](const char* descriptor) { return DescriptorToDot(descriptor); }; return soa.AddLocalReference<jobjectArray>(CreateStringArray( soa.Self(), @@ -645,7 +646,7 @@ static jobjectArray DexFile_getDexFileOptimizationStatus(JNIEnv* env, OatFileAssistant::GetOptimizationStatus( filename.c_str(), target_instruction_set, &compilation_filter, &compilation_reason); - ScopedObjectAccess soa(down_cast<JNIEnvExt*>(env)->GetSelf()); + ScopedObjectAccess soa(Thread::ForEnv(env)); return soa.AddLocalReference<jobjectArray>(CreateStringArray(soa.Self(), { compilation_filter.c_str(), compilation_reason.c_str() @@ -900,7 +901,7 @@ static jobjectArray DexFile_getDexFileOutputPaths(JNIEnv* env, filenames[1] = vdex_filename.c_str(); used_filenames = ArrayRef<const char* const>(filenames, 2u); } - ScopedObjectAccess soa(down_cast<JNIEnvExt*>(env)->GetSelf()); + ScopedObjectAccess soa(Thread::ForEnv(env)); return soa.AddLocalReference<jobjectArray>(CreateStringArray(soa.Self(), used_filenames)); } |