From 09f09139746aca3c93b0cfb1bb6d82c98a1d99f8 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 8 Sep 2022 17:30:19 -0500 Subject: [PATCH] Only request unbuffered touch events on Android 11+ --- app/src/main/java/com/limelight/Game.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/limelight/Game.java b/app/src/main/java/com/limelight/Game.java index 8d41ed26..66ab22d6 100644 --- a/app/src/main/java/com/limelight/Game.java +++ b/app/src/main/java/com/limelight/Game.java @@ -1749,9 +1749,11 @@ public class Game extends Activity implements SurfaceHolder.Callback, @SuppressLint("ClickableViewAccessibility") @Override public boolean onTouch(View view, MotionEvent event) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { if (event.getAction() == MotionEvent.ACTION_DOWN) { // Tell the OS not to buffer input events for us + // + // NB: This is still needed even when we call the newer requestUnbufferedDispatch()! view.requestUnbufferedDispatch(event); } }