mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-05 22:30:29 +00:00
Reapply "Change controller sensor state on the main UI thread on Android"
This reverts commit02975994c1. Accidentally reverted the wrong commit (cherry picked from commitb19ecb4032)
This commit is contained in:
parent
59b38dfe85
commit
da76e438be
1 changed files with 7 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue