mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 06:34:35 +00:00
Synchronize controller access on the Java side on Android
(cherry picked from commit 7222c04fbf)
This commit is contained in:
parent
08c33bb861
commit
dfc0e4bb4f
1 changed files with 4 additions and 4 deletions
|
|
@ -340,7 +340,7 @@ class SDLJoystickHandler {
|
|||
}
|
||||
}
|
||||
|
||||
synchronized protected SDLJoystick getJoystick(int device_id) {
|
||||
protected SDLJoystick getJoystick(int device_id) {
|
||||
for (SDLJoystick joystick : mJoysticks) {
|
||||
if (joystick.device_id == device_id) {
|
||||
return joystick;
|
||||
|
|
@ -354,7 +354,7 @@ class SDLJoystickHandler {
|
|||
* @param event the event to be handled.
|
||||
* @return if given event was processed.
|
||||
*/
|
||||
boolean handleMotionEvent(MotionEvent event) {
|
||||
synchronized boolean handleMotionEvent(MotionEvent event) {
|
||||
int actionPointerIndex = event.getActionIndex();
|
||||
int action = event.getActionMasked();
|
||||
if (action == MotionEvent.ACTION_MOVE) {
|
||||
|
|
@ -524,7 +524,7 @@ class SDLJoystickHandler {
|
|||
return button_mask;
|
||||
}
|
||||
|
||||
void setLED(int device_id, int red, int green, int blue) {
|
||||
synchronized void setLED(int device_id, int red, int green, int blue) {
|
||||
if (Build.VERSION.SDK_INT < 31 /* Android 12.0 (S) */) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -542,7 +542,7 @@ class SDLJoystickHandler {
|
|||
joystick.lightsSession.requestLights(lightsRequest.build());
|
||||
}
|
||||
|
||||
void setSensorsEnabled(int device_id, boolean enabled) {
|
||||
synchronized void setSensorsEnabled(int device_id, boolean enabled) {
|
||||
if (Build.VERSION.SDK_INT < 31 /* Android 12.0 (S) */) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue