I have to work with the InputDevice.getSources() method to determine the type (source) of InputDevice. But instead of returning a predetermined integer, it returns a combined bitfield, for example: 16786707 (this is an actual value from my gamepad).
As you can see 16786707 is not listed in the InputDevice documentation page because it is generated on the fly. How do I parse the number 16786707 to determine whether the InputDevice is: a SOURCE_CLASS_JOYSTICK (16), or a SOURCE_GAMEPAD (1025), or SOURCE_JOYSTICK (16777232). My goal is to determine in a initialization method if the InputDevice is a gamepad like the Xbox 360 gamepad or any other gamepad.