mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-14 07:38:24 +02:00
Change controller sensor state on the main UI thread on Android
Fixes https://github.com/libsdl-org/SDL/issues/15565
(cherry picked from commit c362f1341f)
This commit is contained in:
@@ -91,7 +91,13 @@ public class SDLControllerManager
|
||||
* This method is called by SDL using JNI.
|
||||
*/
|
||||
static void joystickSetSensorsEnabled(int device_id, boolean enabled) {
|
||||
mJoystickHandler.setSensorsEnabled(device_id, 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user