diff options
| author | weihuoya <zwdreams@gmail.com> | 2019-05-29 20:22:26 +0800 |
|---|---|---|
| committer | weihuoya <zwdreams@gmail.com> | 2019-05-29 20:22:26 +0800 |
| commit | 0dec8feadb1c6ecca2de3764ccd413a8d950c573 (patch) | |
| tree | 2cb6c81d03fa9caf848aa41c67abf89df90da306 /Source/Core/InputCommon/ControllerInterface | |
| parent | 3132839113fde2078be4ee60bf8dbf5f15ce16cd (diff) | |
android: thread local env
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/Android/Android.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/Android/Android.cpp b/Source/Core/InputCommon/ControllerInterface/Android/Android.cpp index 0ff62ab48d..9ab4cbf0f8 100644 --- a/Source/Core/InputCommon/ControllerInterface/Android/Android.cpp +++ b/Source/Core/InputCommon/ControllerInterface/Android/Android.cpp @@ -237,10 +237,8 @@ void Touchscreen::Motor::SetState(ControlState state) void Touchscreen::Motor::Rumble(int padID, double state) { - JNIEnv* env; - IDCache::GetJavaVM()->AttachCurrentThread(&env, nullptr); + JNIEnv* env = IDCache::GetEnvForThread(); env->CallStaticVoidMethod(IDCache::GetNativeLibraryClass(), IDCache::GetDoRumble(), padID, state); - IDCache::GetJavaVM()->DetachCurrentThread(); } } // namespace Android } // namespace ciface |
