From 664140fc26240726f6ec9babe7deb633dd8c0bd2 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Fri, 10 Feb 2023 19:06:38 +0800 Subject: [PATCH] Fix buffer swapping on Android 7.1 and earlier * java/org/gnu/emacs/EmacsSurfaceView.java (reconfigureFrontBuffer): Don't use function only present on Android 8.0 and later. --- java/org/gnu/emacs/EmacsSurfaceView.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/java/org/gnu/emacs/EmacsSurfaceView.java b/java/org/gnu/emacs/EmacsSurfaceView.java index e9bae623930..2d80be0881a 100644 --- a/java/org/gnu/emacs/EmacsSurfaceView.java +++ b/java/org/gnu/emacs/EmacsSurfaceView.java @@ -79,10 +79,16 @@ public class EmacsSurfaceView extends View if (bitmap != null && frontBuffer == null) { - frontBuffer = Bitmap.createBitmap (bitmap.getWidth (), - bitmap.getHeight (), - Bitmap.Config.ARGB_8888, - false); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) + frontBuffer = Bitmap.createBitmap (bitmap.getWidth (), + bitmap.getHeight (), + Bitmap.Config.ARGB_8888, + false); + else + frontBuffer = Bitmap.createBitmap (bitmap.getWidth (), + bitmap.getHeight (), + Bitmap.Config.ARGB_8888); + bitmapCanvas = new Canvas (frontBuffer); /* And copy over the bitmap contents. */ -- 2.39.5