InputCommon: Make ControllerInterface RegisterDevicesChangedCallback use Common::HookableEvent.

This commit is contained in:
Jordan Woyak
2025-11-04 14:36:46 -06:00
parent 2170080f53
commit ca6d8e1f0b
7 changed files with 27 additions and 36 deletions

View File

@@ -454,8 +454,8 @@ void RegisterDevicesChangedCallbackIfNeeded(JNIEnv* env, jclass controller_inter
const jmethodID controller_interface_on_devices_changed =
env->GetStaticMethodID(global_controller_interface_class, "onDevicesChanged", "()V");
g_controller_interface.RegisterDevicesChangedCallback(
[global_controller_interface_class, controller_interface_on_devices_changed] {
static Common::EventHook event_hook = g_controller_interface.RegisterDevicesChangedCallback(
"Android", [global_controller_interface_class, controller_interface_on_devices_changed] {
IDCache::GetEnvForThread()->CallStaticVoidMethod(global_controller_interface_class,
controller_interface_on_devices_changed);
});