summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2026-08-27 12:48:49 -0400
committerGitHub <noreply@github.com>2026-08-27 12:48:49 -0400
commit4f8af23db516d8b6e9cd00e7b261a65b026514a8 (patch)
treef44613fc11ba82c609e12b434e0d7bc80c11ac01 /Source/Core/InputCommon/ControllerInterface
parent26d5cd38bd068f878b6e64ee8b705787b3a16164 (diff)
parent82e576a1839306881204948480b1946e73fb1e7b (diff)
Merge pull request #14718 from JosJuice/android-vibration-length
Android: Make vibration length variable
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/Android/Android.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/Android/Android.cpp b/Source/Core/InputCommon/ControllerInterface/Android/Android.cpp
index 40f1e2b096..1aa5275f30 100644
--- a/Source/Core/InputCommon/ControllerInterface/Android/Android.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/Android/Android.cpp
@@ -69,6 +69,7 @@ jmethodID s_controller_interface_unregister_input_device_listener;
jmethodID s_controller_interface_get_vibrator_manager;
jmethodID s_controller_interface_get_system_vibrator_manager;
jmethodID s_controller_interface_vibrate;
+jmethodID s_controller_interface_cancel_vibration;
jclass s_sensor_event_listener_class;
jmethodID s_sensor_event_listener_constructor;
@@ -602,6 +603,11 @@ public:
IDCache::GetEnvForThread()->CallStaticVoidMethod(s_controller_interface_class,
s_controller_interface_vibrate, m_vibrator);
}
+ else if (old_state >= 0.5 && state < 0.5)
+ {
+ IDCache::GetEnvForThread()->CallStaticVoidMethod(
+ s_controller_interface_class, s_controller_interface_cancel_vibration, m_vibrator);
+ }
}
private:
@@ -892,6 +898,8 @@ InputBackend::InputBackend(ControllerInterface* controller_interface)
"()Lorg/dolphinemu/dolphinemu/features/input/model/DolphinVibratorManager;");
s_controller_interface_vibrate =
env->GetStaticMethodID(s_controller_interface_class, "vibrate", "(Landroid/os/Vibrator;)V");
+ s_controller_interface_cancel_vibration = env->GetStaticMethodID(
+ s_controller_interface_class, "cancelVibration", "(Landroid/os/Vibrator;)V");
env->DeleteLocalRef(controller_interface_class);
const jclass sensor_event_listener_class =