summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/Android
diff options
context:
space:
mode:
authorweihuoya <zwdreams@gmail.com>2019-05-29 20:22:26 +0800
committerweihuoya <zwdreams@gmail.com>2019-05-29 20:22:26 +0800
commit0dec8feadb1c6ecca2de3764ccd413a8d950c573 (patch)
tree2cb6c81d03fa9caf848aa41c67abf89df90da306 /Source/Core/InputCommon/ControllerInterface/Android
parent3132839113fde2078be4ee60bf8dbf5f15ce16cd (diff)
android: thread local env
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/Android')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/Android/Android.cpp4
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