Revert "Change controller sensor state on the main UI thread on Android"

This reverts commit c362f1341f.

It turns out this change causes a deadlock:
The main UI thread calls synchronized handleMotionEvent() which then calls SDL_LockJoysticks()
The main app thread calls SDL_LockJoysticks() and then synchronized pollInputDevices()
This commit is contained in:
Sam Lantinga
2026-05-17 12:04:11 -07:00
parent cbd2917324
commit 02975994c1

View File

@@ -91,13 +91,7 @@ public class SDLControllerManager
* This method is called by SDL using JNI.
*/
static void joystickSetSensorsEnabled(int device_id, boolean enabled) {
// Run this on the UI thread so we don't race with enableSensor() in SDLSurface.java
SDL.getContext().runOnUiThread(new Runnable() {
@Override
public void run() {
mJoystickHandler.setSensorsEnabled(device_id, enabled);
}
});
mJoystickHandler.setSensorsEnabled(device_id, enabled);
}
/**