Experiment: Remove probably-redundant motionevent class check

Could maybe help #14766
This commit is contained in:
Henrik Rydgård 2021-08-28 20:27:26 +02:00
parent 82a96dbc86
commit 51b6c73a2b

View file

@ -44,18 +44,14 @@ public class InputDeviceState {
mDevice = device;
int numAxes = 0;
for (MotionRange range : device.getMotionRanges()) {
if ((range.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) {
numAxes += 1;
}
numAxes += 1;
}
mAxes = new int[numAxes];
int i = 0;
for (MotionRange range : device.getMotionRanges()) {
if ((range.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) {
mAxes[i++] = range.getAxis();
}
mAxes[i++] = range.getAxis();
}
Log.i(TAG, "Registering input device with " + numAxes + " axes: " + device.getName());