From 38e4b1c6a41acbaf7baac2bbb8ab80951f3ba502 Mon Sep 17 00:00:00 2001 From: inkeliz Date: Mon, 9 Sep 2024 12:52:31 +0100 Subject: [PATCH] app: [android] fix compatibility with older Android versions Previously, setHighRefreshRate requires APIs restricted to Android 30, or higher. Tested on Android 6.0.1 (released on 2015). Signed-off-by: inkeliz --- app/GioView.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/GioView.java b/app/GioView.java index e7bfbc32..25f9e866 100644 --- a/app/GioView.java +++ b/app/GioView.java @@ -259,6 +259,10 @@ public final class GioView extends SurfaceView implements Choreographer.FrameCal } private void setHighRefreshRate() { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) { + return; + } + Context context = getContext(); Display display = context.getDisplay(); Display.Mode[] supportedModes = display.getSupportedModes();