From: Po Lu Date: Fri, 10 Feb 2023 11:06:38 +0000 (+0800) Subject: Fix buffer swapping on Android 7.1 and earlier X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=664140fc26240726f6ec9babe7deb633dd8c0bd2;p=emacs.git 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. --- 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. */