Commit 14bc3bf4ec3e2346ac5bfa831f7ccc6ad4e296f0

Sylvain 2022-02-07T22:20:05

Android: fix typo to register TOUCHSCREEN device (see #5322, #2718)

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
index 8641ccf..812163c 100644
--- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
+++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
@@ -1204,7 +1204,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
 
         for (int id : ids) {
             InputDevice device = InputDevice.getDevice(id);
-            if (device != null && (device.getSources() & InputDevice.SOURCE_TOUCHSCREEN) != 0) {
+            if (device != null && (device.getSources() & InputDevice.SOURCE_TOUCHSCREEN) == InputDevice.SOURCE_TOUCHSCREEN) {
                 nativeAddTouch(device.getId(), device.getName());
             }
         }