From 2001898dceb9d0a6dab164e1cbc4ea8edcc26bfe Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 19 Oct 2017 15:37:52 -0700 Subject: [PATCH] Fixed Android joystick detection --- android-project/src/org/libsdl/app/SDLControllerManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/android-project/src/org/libsdl/app/SDLControllerManager.java b/android-project/src/org/libsdl/app/SDLControllerManager.java index 6d97fa8e9..0419306c2 100644 --- a/android-project/src/org/libsdl/app/SDLControllerManager.java +++ b/android-project/src/org/libsdl/app/SDLControllerManager.java @@ -101,7 +101,9 @@ public class SDLControllerManager Log.v(TAG, "Input device " + device.getName() + " is a gamepad."); } - return ((sources & (InputDevice.SOURCE_CLASS_JOYSTICK|InputDevice.SOURCE_GAMEPAD)) != 0); + return (((sources & InputDevice.SOURCE_CLASS_JOYSTICK) == InputDevice.SOURCE_CLASS_JOYSTICK) || + ((sources & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD) + ); } }