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.
This commit is contained in:
Po Lu 2023-02-10 19:06:38 +08:00
parent a1941cd7a7
commit 664140fc26

View file

@ -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. */