Fixed Android joystick detection
authorSam Lantinga <slouken@libsdl.org>
Thu, 19 Oct 2017 15:37:52 -0700
changeset 11637a970b2ae1bd7
parent 11636 ec1c9bded2d0
child 11638 2393519f642e
Fixed Android joystick detection
android-project/src/org/libsdl/app/SDLControllerManager.java
     1.1 --- a/android-project/src/org/libsdl/app/SDLControllerManager.java	Thu Oct 19 18:05:42 2017 -0400
     1.2 +++ b/android-project/src/org/libsdl/app/SDLControllerManager.java	Thu Oct 19 15:37:52 2017 -0700
     1.3 @@ -101,7 +101,9 @@
     1.4              Log.v(TAG, "Input device " + device.getName() + " is a gamepad.");
     1.5          }
     1.6  
     1.7 -        return ((sources & (InputDevice.SOURCE_CLASS_JOYSTICK|InputDevice.SOURCE_GAMEPAD)) != 0);
     1.8 +        return (((sources & InputDevice.SOURCE_CLASS_JOYSTICK) == InputDevice.SOURCE_CLASS_JOYSTICK) ||
     1.9 +                ((sources & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD)
    1.10 +        );
    1.11      }
    1.12  
    1.13  }